Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.188

Version Description

Nov 2 2022 =

Lot of improvements of the EmailEncoder , wpForo topics and posts protection , a honeypot for Gravity forms, parameters without cookies improved and some minor issues fixed

  • New. wpForo - add topic and post under protection
  • New. GravityForms - added honeypot
  • New. Readme. Compatibility tested up to WP 6.1
  • New. EmailEncoder. Exclude content from encoding by tag attributes (at least placeholders and values).
  • Mod. Cloud. Remove all_cookies header before send requests to the cloud.
  • Fix. NoCookie mod. Data collection improvements.
  • Fix. bbPress registration now redirect back to the form on bad submissions.
  • Fix. EmailEncoder. Minor improvements.
  • Fix. EmailEncoder. Decoding process logic fixed.
  • Fix. EmailEncoder. Do not show the comment for the allowed requests.
  • Fix. EmailEncoder. Comment about decoding process fixed.
  • Fix. Common. GDPR checkbox fixed.
  • Fix. WPMS. Custom column on sites list page fixed.
  • Fix. Common. Deleting visible fields hidden input after its processed.
  • Fix. Readme. Requires WP 4.7+.
  • Fix. Integration. Skip some Smart Quiz Builder requests.
  • Fix. Common. Visible fields hidden input value is on base64 now.
  • Fix. JS. ApbctJsLib updated.
  • Fix. Comments. Calling hook 'comment_post' priority fixed.
  • Fix. Mautic integration fixes.
  • Fix. Honeypot flag fixes.
Download this release

Release Info

Developer alexandergull
Plugin Icon 128x128 Spam protection, AntiSpam, FireWall by CleanTalk
Version 5.188
Comparing to
See all releases

Code changes from version 5.187 to 5.188

cleantalk.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Anti-Spam by CleanTalk
5
  Plugin URI: https://cleantalk.org
6
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
7
- Version: 5.187
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
@@ -240,6 +240,11 @@ if ( ! is_admin() && ! apbct_is_ajax() && ! defined('DOING_CRON')
240
  }
241
  }
242
 
 
 
 
 
 
243
  // Early checks
244
 
245
  // Iphorm
@@ -248,10 +253,6 @@ if (
248
  Post::get('iphorm_id') !== '' &&
249
  Post::get('iphorm_uid') !== ''
250
  ) {
251
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate-skip-functions.php');
252
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate.php');
253
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
254
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-integrations.php');
255
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
256
  ct_ajax_hook();
257
  }
@@ -261,10 +262,6 @@ if ( $apbct->settings['forms__general_contact_forms_test'] == 1
261
  && ( Post::get('action') === 'fb_intialize')
262
  && ! empty(Post::get('FB_userdata'))
263
  ) {
264
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate-skip-functions.php');
265
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate.php');
266
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
267
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-integrations.php');
268
  if ( apbct_is_user_enable() ) {
269
  ct_registration_errors(null);
270
  }
@@ -381,6 +378,11 @@ $apbct_active_integrations = array(
381
  'setting' => 'forms__registrations_test',
382
  'ajax' => false
383
  ),
 
 
 
 
 
384
  );
385
  new \Cleantalk\Antispam\Integrations($apbct_active_integrations, (array)$apbct->settings);
386
 
@@ -528,6 +530,8 @@ if ( ! empty($apbct->settings['data__use_ajax']) &&
528
  add_action('wp_ajax_ct_get_cookie', 'ct_get_cookie', 1);
529
  }
530
 
 
 
531
  // Admin panel actions
532
  if ( is_admin() || is_network_admin() ) {
533
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-find-spam.php');
@@ -555,10 +559,6 @@ if ( is_admin() || is_network_admin() ) {
555
  $_cleantalk_hooked_actions = array();
556
  $_cleantalk_ajax_actions_to_check = array();
557
 
558
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate-skip-functions.php');
559
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate.php');
560
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
561
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-integrations.php');
562
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
563
 
564
  // Feedback for comments
@@ -594,14 +594,10 @@ if ( is_admin() || is_network_admin() ) {
594
 
595
  // Some of plugins to register a users use AJAX context.
596
  add_filter('registration_errors', 'ct_registration_errors', 1, 3);
597
- add_filter('registration_errors', 'ct_check_registration_erros', 999999, 3);
598
  add_action('user_register', 'apbct_user_register');
599
 
600
  if ( class_exists('BuddyPress') ) {
601
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate-skip-functions.php');
602
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate.php');
603
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
604
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-integrations.php');
605
  add_filter(
606
  'bp_activity_is_spam_before_save',
607
  'apbct_integration__buddyPres__activityWall',
@@ -612,10 +608,6 @@ if ( is_admin() || is_network_admin() ) {
612
  }
613
  }
614
 
615
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate-skip-functions.php');
616
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate.php');
617
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
618
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-integrations.php');
619
  //Bitrix24 contact form
620
  if ( $apbct->settings['forms__general_contact_forms_test'] == 1 &&
621
  ! empty(Post::get('your-phone')) &&
@@ -646,11 +638,6 @@ if ( is_admin() || is_network_admin() ) {
646
  }
647
  // Public pages actions
648
  } else {
649
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate-skip-functions.php');
650
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate.php');
651
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
652
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-integrations.php');
653
-
654
  add_action('wp_enqueue_scripts', 'ct_enqueue_scripts_public');
655
  add_action('wp_enqueue_scripts', 'ct_enqueue_styles_public');
656
  add_action('login_enqueue_scripts', 'ct_enqueue_styles_public');
@@ -658,10 +645,6 @@ if ( is_admin() || is_network_admin() ) {
658
  // Init action.
659
  add_action('plugins_loaded', 'apbct_init', 1);
660
 
661
- if ( Post::get('ct_no_cookie_hidden_field') ) {
662
- apbct_form__get_no_cookie_data();
663
- }
664
-
665
  // Comments
666
  add_filter('preprocess_comment', 'ct_preprocess_comment', 1, 1); // param - comment data array
667
  add_filter('comment_text', 'ct_comment_text');
@@ -675,7 +658,7 @@ if ( is_admin() || is_network_admin() ) {
675
  add_action('login_enqueue_scripts', 'apbct_login__scripts');
676
  add_action('register_form', 'ct_register_form');
677
  add_filter('registration_errors', 'ct_registration_errors', 1, 3);
678
- add_filter('registration_errors', 'ct_check_registration_erros', 999999, 3);
679
  add_action('user_register', 'apbct_user_register');
680
 
681
  // WordPress Multisite registrations
4
  Plugin Name: Anti-Spam by CleanTalk
5
  Plugin URI: https://cleantalk.org
6
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
7
+ Version: 5.188
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
240
  }
241
  }
242
 
243
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate-skip-functions.php');
244
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-validate.php');
245
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
246
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public-integrations.php');
247
+
248
  // Early checks
249
 
250
  // Iphorm
253
  Post::get('iphorm_id') !== '' &&
254
  Post::get('iphorm_uid') !== ''
255
  ) {
 
 
 
 
256
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
257
  ct_ajax_hook();
258
  }
262
  && ( Post::get('action') === 'fb_intialize')
263
  && ! empty(Post::get('FB_userdata'))
264
  ) {
 
 
 
 
265
  if ( apbct_is_user_enable() ) {
266
  ct_registration_errors(null);
267
  }
378
  'setting' => 'forms__registrations_test',
379
  'ajax' => false
380
  ),
381
+ 'WpForo' => array(
382
+ 'hook' => array('wpforo_action_topic_add', 'wpforo_action_post_add'),
383
+ 'setting' => 'data__protect_logged_in',
384
+ 'ajax' => false
385
+ ),
386
  );
387
  new \Cleantalk\Antispam\Integrations($apbct_active_integrations, (array)$apbct->settings);
388
 
530
  add_action('wp_ajax_ct_get_cookie', 'ct_get_cookie', 1);
531
  }
532
 
533
+ apbct_form__get_no_cookie_data();
534
+
535
  // Admin panel actions
536
  if ( is_admin() || is_network_admin() ) {
537
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-find-spam.php');
559
  $_cleantalk_hooked_actions = array();
560
  $_cleantalk_ajax_actions_to_check = array();
561
 
 
 
 
 
562
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
563
 
564
  // Feedback for comments
594
 
595
  // Some of plugins to register a users use AJAX context.
596
  add_filter('registration_errors', 'ct_registration_errors', 1, 3);
597
+ add_filter('registration_errors', 'ct_check_registration_errors', 999999, 3);
598
  add_action('user_register', 'apbct_user_register');
599
 
600
  if ( class_exists('BuddyPress') ) {
 
 
 
 
601
  add_filter(
602
  'bp_activity_is_spam_before_save',
603
  'apbct_integration__buddyPres__activityWall',
608
  }
609
  }
610
 
 
 
 
 
611
  //Bitrix24 contact form
612
  if ( $apbct->settings['forms__general_contact_forms_test'] == 1 &&
613
  ! empty(Post::get('your-phone')) &&
638
  }
639
  // Public pages actions
640
  } else {
 
 
 
 
 
641
  add_action('wp_enqueue_scripts', 'ct_enqueue_scripts_public');
642
  add_action('wp_enqueue_scripts', 'ct_enqueue_styles_public');
643
  add_action('login_enqueue_scripts', 'ct_enqueue_styles_public');
645
  // Init action.
646
  add_action('plugins_loaded', 'apbct_init', 1);
647
 
 
 
 
 
648
  // Comments
649
  add_filter('preprocess_comment', 'ct_preprocess_comment', 1, 1); // param - comment data array
650
  add_filter('comment_text', 'ct_comment_text');
658
  add_action('login_enqueue_scripts', 'apbct_login__scripts');
659
  add_action('register_form', 'ct_register_form');
660
  add_filter('registration_errors', 'ct_registration_errors', 1, 3);
661
+ add_filter('registration_errors', 'ct_check_registration_errors', 999999, 3);
662
  add_action('user_register', 'apbct_user_register');
663
 
664
  // WordPress Multisite registrations
inc/cleantalk-admin.php CHANGED
@@ -1226,7 +1226,7 @@ function apbct__add_debug_tab($links)
1226
  */
1227
  function apbct__wpmu_blogs_columns_filter($sites_columns)
1228
  {
1229
- $sites_columns[] = esc_html__('CleanTalk Status', 'cleantalk-spam-protect');
1230
 
1231
  return $sites_columns;
1232
  }
@@ -1241,8 +1241,12 @@ add_filter('wpmu_blogs_columns', 'apbct__wpmu_blogs_columns_filter');
1241
  *
1242
  * @return void
1243
  */
1244
- function apbct__manage_sites_custom_column_action($_column_name, $site_id)
1245
  {
 
 
 
 
1246
  $cleantalk_data = get_blog_option($site_id, 'cleantalk_data');
1247
  $key_is_ok_text = esc_html__('The Access key is set and correct', 'cleantalk-spam-protect');
1248
  $key_is_bad_text = esc_html__('The Access key is not set or is incorrect', 'cleantalk-spam-protect');
1226
  */
1227
  function apbct__wpmu_blogs_columns_filter($sites_columns)
1228
  {
1229
+ $sites_columns['cleantalk_status'] = esc_html__('CleanTalk Status', 'cleantalk-spam-protect');
1230
 
1231
  return $sites_columns;
1232
  }
1241
  *
1242
  * @return void
1243
  */
1244
+ function apbct__manage_sites_custom_column_action($column_name, $site_id)
1245
  {
1246
+ if ( $column_name !== 'cleantalk_status' ) {
1247
+ return;
1248
+ }
1249
+
1250
  $cleantalk_data = get_blog_option($site_id, 'cleantalk_data');
1251
  $key_is_ok_text = esc_html__('The Access key is set and correct', 'cleantalk-spam-protect');
1252
  $key_is_bad_text = esc_html__('The Access key is not set or is incorrect', 'cleantalk-spam-protect');
inc/cleantalk-common.php CHANGED
@@ -210,10 +210,11 @@ function apbct_base_call($params = array(), $reg_flag = false)
210
  /**
211
  * Add honeypot_field to $base_call_data if forms__wc_honeypot on
212
  */
213
- if ( $apbct->settings['data__honeypot_field'] && ! isset($params['honeypot_field']) ) {
214
  $honeypot_filled_fields = apbct_get_honeypot_filled_fields();
 
215
 
216
- if ( ! empty($honeypot_filled_fields) ) {
217
  $params['sender_info']['honeypot_field_value'] = $honeypot_filled_fields['field_value'];
218
  $params['sender_info']['honeypot_field_source'] = $honeypot_filled_fields['field_source'];
219
  $params['honeypot_field'] = 0;
@@ -390,6 +391,14 @@ function apbct_exclusions_check($func = null)
390
  case 'ct_contact_form_validate':
391
  if (
392
  apbct_array($_POST)->getKeys('members_search_submit')->result()
 
 
 
 
 
 
 
 
393
  ) {
394
  return true;
395
  }
@@ -528,12 +537,17 @@ function apbct_get_sender_info()
528
 
529
  // Visible fields processing
530
  $visible_fields_collection = Cookie::getVisibleFields();
531
- if ( !$visible_fields_collection || is_array($visible_fields_collection) && !$visible_fields_collection[0] ) {
532
- $visible_fields_collection = stripslashes(Post::get('apbct_visible_fields'));
533
  }
534
 
535
  $visible_fields = apbct_visible_fields__process($visible_fields_collection);
536
 
 
 
 
 
 
537
  // preparation of some parameters when cookies are disabled and data is received from localStorage
538
  $param_email_check = Cookie::get('ct_checked_emails') ? json_encode(
539
  Cookie::get('ct_checked_emails')
@@ -1340,7 +1354,10 @@ function apbct_need_to_process_unknown_post_request()
1340
 
1341
  /**
1342
  * Handles gained POST and GET data to find filled honeypot fields.
1343
- * @return array array [honeypot_field_value, honeypot_field_source] or empty array
 
 
 
1344
  */
1345
  function apbct_get_honeypot_filled_fields()
1346
  {
@@ -1357,7 +1374,8 @@ function apbct_get_honeypot_filled_fields()
1357
  'apbct__email_id__wp_register' => Post::get('apbct__email_id__wp_register_' . $apbct_event_id),
1358
  'apbct__email_id__wp_contact_form_7' => Post::get('apbct__email_id__wp_contact_form_7_' . $apbct_event_id),
1359
  'apbct__email_id__wp_wpforms' => Post::get('apbct__email_id__wp_wpforms_' . $apbct_event_id),
1360
- 'apbct__email_id__search_form' => Post::get('apbct__email_id__search_form_' . $apbct_event_id)
 
1361
  );
1362
  } elseif ( ! empty($_GET) ) {
1363
  /**
@@ -1383,9 +1401,13 @@ function apbct_get_honeypot_filled_fields()
1383
  * Handle potential values
1384
  */
1385
  $result = array();
 
1386
  // if source is filled then pass them to params as additional fields
1387
  if ( !empty($honeypot_potential_values) ) {
1388
  foreach ( $honeypot_potential_values as $source_name => $source_value ) {
 
 
 
1389
  if ( $source_value ) {
1390
  $result['field_value'] = $source_value;
1391
  $result['field_source'] = $source_name;
@@ -1394,14 +1416,17 @@ function apbct_get_honeypot_filled_fields()
1394
  }
1395
  }
1396
 
1397
- return $result;
1398
  }
1399
 
1400
  function apbct_form__get_no_cookie_data()
1401
  {
1402
  global $apbct;
1403
- if ( $apbct->data['cookies_type'] === 'none' ) {
1404
- $apbct->stats['no_cookie_data_taken'] = \Cleantalk\ApbctWP\Variables\NoCookie::setDataFromHiddenField();
1405
- $apbct->save('stats');
 
1406
  }
 
 
1407
  }
210
  /**
211
  * Add honeypot_field to $base_call_data if forms__wc_honeypot on
212
  */
213
+ if ( $apbct->settings['data__honeypot_field'] && !isset($params['honeypot_field']) ) {
214
  $honeypot_filled_fields = apbct_get_honeypot_filled_fields();
215
+ $params['honeypot_field'] = $honeypot_filled_fields === false ? null : 1;
216
 
217
+ if ( !empty($honeypot_filled_fields) && $honeypot_filled_fields !== false ) {
218
  $params['sender_info']['honeypot_field_value'] = $honeypot_filled_fields['field_value'];
219
  $params['sender_info']['honeypot_field_source'] = $honeypot_filled_fields['field_source'];
220
  $params['honeypot_field'] = 0;
391
  case 'ct_contact_form_validate':
392
  if (
393
  apbct_array($_POST)->getKeys('members_search_submit')->result()
394
+ || (
395
+ (int)$apbct->settings['data__protect_logged_in'] === 1
396
+ && (
397
+ Post::equal('wpfaction', 'topic_add')
398
+ || Post::equal('wpfaction', 'post_add')
399
+ )
400
+ && apbct_is_plugin_active('wpforo/wpforo.php')
401
+ )
402
  ) {
403
  return true;
404
  }
537
 
538
  // Visible fields processing
539
  $visible_fields_collection = Cookie::getVisibleFields();
540
+ if ( !$visible_fields_collection || (is_array($visible_fields_collection) && !$visible_fields_collection[0]) ) {
541
+ $visible_fields_collection = base64_decode(Post::get('apbct_visible_fields'));
542
  }
543
 
544
  $visible_fields = apbct_visible_fields__process($visible_fields_collection);
545
 
546
+ // It is a service field. Need to be deleted before the processing.
547
+ if ( isset($_POST['apbct_visible_fields']) ) {
548
+ unset($_POST['apbct_visible_fields']);
549
+ }
550
+
551
  // preparation of some parameters when cookies are disabled and data is received from localStorage
552
  $param_email_check = Cookie::get('ct_checked_emails') ? json_encode(
553
  Cookie::get('ct_checked_emails')
1354
 
1355
  /**
1356
  * Handles gained POST and GET data to find filled honeypot fields.
1357
+ * @return array|false
1358
+ * - array [honeypot_field_value, honeypot_field_source] if we have filled field,
1359
+ * - empty array if we have not
1360
+ * - false if POST has no honeypot signs
1361
  */
1362
  function apbct_get_honeypot_filled_fields()
1363
  {
1374
  'apbct__email_id__wp_register' => Post::get('apbct__email_id__wp_register_' . $apbct_event_id),
1375
  'apbct__email_id__wp_contact_form_7' => Post::get('apbct__email_id__wp_contact_form_7_' . $apbct_event_id),
1376
  'apbct__email_id__wp_wpforms' => Post::get('apbct__email_id__wp_wpforms_' . $apbct_event_id),
1377
+ 'apbct__email_id__search_form' => Post::get('apbct__email_id__search_form_' . $apbct_event_id),
1378
+ 'apbct__email_id__gravity_form' => Post::get('apbct__email_id__gravity_form_' . $apbct_event_id)
1379
  );
1380
  } elseif ( ! empty($_GET) ) {
1381
  /**
1401
  * Handle potential values
1402
  */
1403
  $result = array();
1404
+ $post_has_a_honeypot_key = false;
1405
  // if source is filled then pass them to params as additional fields
1406
  if ( !empty($honeypot_potential_values) ) {
1407
  foreach ( $honeypot_potential_values as $source_name => $source_value ) {
1408
+ if ( $source_name ) {
1409
+ $post_has_a_honeypot_key = true;
1410
+ }
1411
  if ( $source_value ) {
1412
  $result['field_value'] = $source_value;
1413
  $result['field_source'] = $source_name;
1416
  }
1417
  }
1418
 
1419
+ return $post_has_a_honeypot_key ? $result : false;
1420
  }
1421
 
1422
  function apbct_form__get_no_cookie_data()
1423
  {
1424
  global $apbct;
1425
+ $flag = null;
1426
+
1427
+ if ( Post::get('ct_no_cookie_hidden_field') && $apbct->data['cookies_type'] === 'none' ) {
1428
+ $flag = \Cleantalk\ApbctWP\Variables\NoCookie::setDataFromHiddenField();
1429
  }
1430
+ $apbct->stats['no_cookie_data_taken'] = $flag;
1431
+ $apbct->save('stats');
1432
  }
inc/cleantalk-pluggable.php CHANGED
@@ -797,6 +797,17 @@ function apbct_is_skip_request($ajax = false)
797
  ) {
798
  return 'Wishlist Member - skip login';
799
  }
 
 
 
 
 
 
 
 
 
 
 
800
  } else {
801
  /*****************************************/
802
  /* Here is non-ajax requests skipping */
797
  ) {
798
  return 'Wishlist Member - skip login';
799
  }
800
+
801
+ // Skip some Smart Quiz Builder requests
802
+ if (
803
+ apbct_is_plugin_active('smartquizbuilder/smartquizbuilder.php') &&
804
+ (
805
+ Post::get('action') === 'sqb_lead_save' ||
806
+ Post::get('action') === 'SQBSendNotificationAjax'
807
+ )
808
+ ) {
809
+ return 'Smart Quiz Builder - skip some requests';
810
+ }
811
  } else {
812
  /*****************************************/
813
  /* Here is non-ajax requests skipping */
inc/cleantalk-public-integrations.php CHANGED
@@ -1125,7 +1125,7 @@ function ct_preprocess_comment($comment)
1125
 
1126
  // Change comment flow only for new authors
1127
  if ( ! empty($new_user) || empty($base_call_data['post_info']['post_url']) ) {
1128
- add_action('comment_post', 'ct_set_meta', 10, 2);
1129
  }
1130
 
1131
  if ( $ct_result->allow ) { // Pass if allowed
@@ -1196,21 +1196,21 @@ function ct_preprocess_comment($comment)
1196
  // Trash comment.
1197
  if ( $ct_result->spam == 2 ) {
1198
  add_filter('pre_comment_approved', 'ct_set_comment_spam', 997, 2);
1199
- add_action('comment_post', 'ct_wp_trash_comment', 997, 2);
1200
  }
1201
 
1202
  // Spam comment
1203
  if ( $ct_result->spam == 1 ) {
1204
- add_filter('pre_comment_approved', 'ct_set_comment_spam', 997, 2);
1205
  }
1206
 
1207
  // Move to pending folder. Contains stop_words.
1208
  if ( $ct_result->stop_words ) {
1209
  add_filter('pre_comment_approved', 'ct_set_not_approved', 998, 2);
1210
- add_action('comment_post', 'ct_mark_red', 998, 2);
1211
  }
1212
 
1213
- add_action('comment_post', 'ct_die', 999, 2);
1214
  }
1215
 
1216
  if ( $apbct->settings['comments__remove_comments_links'] == 1 ) {
@@ -1573,7 +1573,13 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
1573
  $_POST['FB_userdata']['name'] = '';
1574
 
1575
  return;
1576
- } elseif ( defined('MGM_PLUGIN_NAME') ) {
 
 
 
 
 
 
1577
  ct_die_extended($ct_result->comment);
1578
  } else {
1579
  if ( is_wp_error($errors) ) {
@@ -1706,7 +1712,7 @@ function apbct_registration__UltimateMembers__check($args)
1706
  *
1707
  * @return mixed
1708
  */
1709
- function ct_check_registration_erros($errors, $_sanitized_user_login = null, $_user_email = null)
1710
  {
1711
  global $bp, $ct_registration_error_comment;
1712
 
@@ -2730,8 +2736,9 @@ function apbct_form__gravityForms__addField($form_string, $form)
2730
  $search = "</form>";
2731
 
2732
  // Adding JS code
2733
- $js_code = ct_add_hidden_fields($ct_hidden_field, true, false);
2734
- $form_string = str_replace($search, $js_code . $search, $form_string);
 
2735
 
2736
  // Adding field for multipage form. Look for cleantalk.php -> apbct_cookie();
2737
  $append_string = isset($form['lastPageButton']) ? "<input type='hidden' name='ct_multipage_form' value='yes'>" : '';
1125
 
1126
  // Change comment flow only for new authors
1127
  if ( ! empty($new_user) || empty($base_call_data['post_info']['post_url']) ) {
1128
+ add_action('comment_post', 'ct_set_meta', 6, 2);
1129
  }
1130
 
1131
  if ( $ct_result->allow ) { // Pass if allowed
1196
  // Trash comment.
1197
  if ( $ct_result->spam == 2 ) {
1198
  add_filter('pre_comment_approved', 'ct_set_comment_spam', 997, 2);
1199
+ add_action('comment_post', 'ct_wp_trash_comment', 7, 2);
1200
  }
1201
 
1202
  // Spam comment
1203
  if ( $ct_result->spam == 1 ) {
1204
+ add_filter('pre_comment_approved', 'ct_set_comment_spam', 7, 2);
1205
  }
1206
 
1207
  // Move to pending folder. Contains stop_words.
1208
  if ( $ct_result->stop_words ) {
1209
  add_filter('pre_comment_approved', 'ct_set_not_approved', 998, 2);
1210
+ add_action('comment_post', 'ct_mark_red', 8, 2);
1211
  }
1212
 
1213
+ add_action('comment_post', 'ct_die', 9, 2);
1214
  }
1215
 
1216
  if ( $apbct->settings['comments__remove_comments_links'] == 1 ) {
1573
  $_POST['FB_userdata']['name'] = '';
1574
 
1575
  return;
1576
+ } elseif (
1577
+ /**
1578
+ * present conditions there if we need to set a custom registration break for a plugin
1579
+ **/
1580
+ defined('MGM_PLUGIN_NAME')
1581
+ || apbct_is_plugin_active('bbpress/bbpress.php')
1582
+ ) {
1583
  ct_die_extended($ct_result->comment);
1584
  } else {
1585
  if ( is_wp_error($errors) ) {
1712
  *
1713
  * @return mixed
1714
  */
1715
+ function ct_check_registration_errors($errors, $_sanitized_user_login = null, $_user_email = null)
1716
  {
1717
  global $bp, $ct_registration_error_comment;
1718
 
2736
  $search = "</form>";
2737
 
2738
  // Adding JS code
2739
+ $js_code = ct_add_hidden_fields($ct_hidden_field, true, false);
2740
+ $honeypot = ct_add_honeypot_field('gravity_form');
2741
+ $form_string = str_replace($search, $js_code . $honeypot . $search, $form_string);
2742
 
2743
  // Adding field for multipage form. Look for cleantalk.php -> apbct_cookie();
2744
  $append_string = isset($form['lastPageButton']) ? "<input type='hidden' name='ct_multipage_form' value='yes'>" : '';
inc/cleantalk-public.php CHANGED
@@ -215,7 +215,7 @@ function apbct_init()
215
  add_action('bp_before_registration_submit_buttons', 'ct_register_form', 1);
216
  add_action('messages_message_before_save', 'apbct_integration__buddyPres__private_msg_check', 1);
217
  add_filter('bp_signup_validate', 'ct_registration_errors', 1);
218
- add_filter('bp_signup_validate', 'ct_check_registration_erros', 999999);
219
  }
220
 
221
  if ( defined('PROFILEPRESS_SYSTEM_FILE_PATH') ) {
@@ -1237,6 +1237,7 @@ function ct_enqueue_scripts_public($_hook)
1237
  'By using this form you agree with the storage and processing of your data by using the Privacy Policy on this website.',
1238
  'cleantalk-spam-protect'
1239
  ),
 
1240
  ));
1241
  }
1242
  }
215
  add_action('bp_before_registration_submit_buttons', 'ct_register_form', 1);
216
  add_action('messages_message_before_save', 'apbct_integration__buddyPres__private_msg_check', 1);
217
  add_filter('bp_signup_validate', 'ct_registration_errors', 1);
218
+ add_filter('bp_signup_validate', 'ct_check_registration_errors', 999999);
219
  }
220
 
221
  if ( defined('PROFILEPRESS_SYSTEM_FILE_PATH') ) {
1237
  'By using this form you agree with the storage and processing of your data by using the Privacy Policy on this website.',
1238
  'cleantalk-spam-protect'
1239
  ),
1240
+ 'gdpr_title' => esc_html__('Please, apply the GDPR agreement.', 'cleantalk-spam-protect'),
1241
  ));
1242
  }
1243
  }
js/apbct-public-bundle.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,i,a=[],r=!0,c=!1;try{for(o=o.call(e);!(r=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);r=!0);}catch(e){c=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(c)throw i}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(o){var n=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(o);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var o,n,i,a,r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return n=!(o=!0),{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){n=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(n)throw i}}};if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return r&&(e=r),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function _typeof(e){return(_typeof="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})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t),t.add(e)}function _classPrivateFieldInitSpec(e,t,o){_checkPrivateRedeclaration(e,t),t.set(e,o)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function _classPrivateFieldGet(e,t){return _classApplyDescriptorGet(e,_classExtractFieldDescriptor(e,t,"get"))}function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}function _classPrivateMethodGet(e,t,o){if(t.has(e))return o;throw new TypeError("attempted to get private field on non-instance")}function _classPrivateFieldSet(e,t,o){return _classApplyDescriptorSet(e,_classExtractFieldDescriptor(e,t,"set"),o),o}function _classExtractFieldDescriptor(e,t,o){if(t.has(e))return t.get(e);throw new TypeError("attempted to "+o+" private field on non-instance")}function _classApplyDescriptorSet(e,t,o){if(t.set)t.set.call(e,o);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=o}}var _selector=new WeakMap,_eventCallback=new WeakMap,_eventSelector=new WeakMap,_event=new WeakMap,_addElement=new WeakSet,_push=new WeakSet,_reduce=new WeakSet,_deselect=new WeakSet,_onChecker=new WeakSet,_isElem=new WeakSet,_isWithoutSelector=new WeakSet,ApbctCore=function(){function t(e){_classCallCheck(this,t),_classPrivateMethodInitSpec(this,_isWithoutSelector),_classPrivateMethodInitSpec(this,_isElem),_classPrivateMethodInitSpec(this,_onChecker),_classPrivateMethodInitSpec(this,_deselect),_classPrivateMethodInitSpec(this,_reduce),_classPrivateMethodInitSpec(this,_push),_classPrivateMethodInitSpec(this,_addElement),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"rest_parameters",{}),_classPrivateFieldInitSpec(this,_selector,{writable:!0,value:null}),_defineProperty(this,"elements",[]),_classPrivateFieldInitSpec(this,_eventCallback,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,_eventSelector,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,_event,{writable:!0,value:void 0}),this.select(e)}return _createClass(t,[{key:"select",value:function(e){return e instanceof HTMLCollection?(_classPrivateFieldSet(this,_selector,null),this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(_classPrivateFieldSet(this,_selector,null),this.elements=[],this.elements[0]=e):"string"==typeof e?(_classPrivateFieldSet(this,_selector,e),this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):_classPrivateMethodGet(this,_deselect,_deselect2).call(this),this}},{key:"css",value:function(e,t){if(t|=!1,"object"===_typeof(e)){for(var o in e)for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),i=0;i<this.elements.length;i++)this.elements[i].style[n]=e[o];return this}var a;if("string"==typeof e)return void 0!==(a=getComputedStyle(this.elements[0])[e])&&!t&&(a=a.replace(/(\d)(em|pt|%|px){1,2}$/,"$1"),Number(a)==a)?Number(a):a}},{key:"hide",value:function(){this.prop("prev-display",this.css("display")),this.css({display:"none"})}},{key:"show",value:function(){this.css({display:this.prop("prev-display")})}},{key:"addClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.add(className)}},{key:"removeClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.remove(className)}},{key:"toggleClass",value:function(e){for(var t=0;t<this.elements.length;t++)this.elements[t].classList.toggle(e)}},{key:"ajax",value:function(e){return this.ajax_parameters=e,new ApbctAjax(e)}},{key:"rest",value:function(e){return this.rest_parameters=e,new ApbctRest(e)}},{key:"on",value:function(){_classPrivateFieldSet(this,_event,arguments.length<=0?void 0:arguments[0]),_classPrivateFieldSet(this,_eventCallback,(arguments.length<=2?void 0:arguments[2])||(arguments.length<=1?void 0:arguments[1])),_classPrivateFieldSet(this,_eventSelector,"string"==typeof(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:null);for(var e=0;e<this.elements.length;e++)this.elements[e].addEventListener(_classPrivateFieldGet(this,_event),null!==_classPrivateFieldGet(this,_eventSelector)?_classPrivateMethodGet(this,_onChecker,_onChecker2).bind(this):_classPrivateFieldGet(this,_eventCallback))}},{key:"ready",value:function(e){document.addEventListener("DOMContentLoaded",e)}},{key:"change",value:function(e){this.on("change",e)}},{key:"attr",value:function(e){for(var t=[],o=0;o<this.elements.length;o++)void 0!==_typeof(this.elements[o][e])?t.push(this.elements[o][e]):t.push(this.elements[o].getAttribute(e));return 1===t.length?t[0]:t}},{key:"prop",value:function(e,t){if(void 0!==t){for(var o=0;o<this.elements.length;o++)this.elements[o][e]=t;return this}for(var n=[],i=0;i<this.elements.length;i++)n.push(this.elements[i][e]);return 1===n.length?n[0]:n}},{key:"html",value:function(e){return void 0!==e?this.prop("innerHTML",e):this.prop("innerHTML")}},{key:"val",value:function(e){return void 0!==e?this.prop("value",e):this.prop("value")}},{key:"data",value:function(e,t){return void 0!==t?this.prop("apbct-data",e,t):this.prop("apbct-data")}},{key:"is",value:function(e){var t,o=!1,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)var i=t.value,o=o||_classPrivateMethodGet(this,_isElem,_isElem2).call(this,i,e)}catch(e){n.e(e)}finally{n.f()}return o}},{key:"filter",value:function(e){_classPrivateFieldSet(this,_selector,null);for(var t=this.elements.length-1;0<=t;t--)_classPrivateMethodGet(this,_isElem,_isElem2).call(this,this.elements[t],e)||this.elements.splice(Number(t),1);return this}},{key:"parent",value:function(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||_classPrivateMethodGet(this,_deselect,_deselect2).call(this),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)_classPrivateMethodGet(this,_push,_push2).call(this,this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}},{key:"children",value:function(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}},{key:"siblings",value:function(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}},{key:"remove",value:function(){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)e.value.remove()}catch(e){t.e(e)}finally{t.f()}}},{key:"after",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.after(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"append",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.append(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"fadeIn",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=0,t.style.display="block",+new Date);(function e(){t.style.opacity=+t.style.opacity+(new Date-o)/n,o=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))})()}()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=1,+new Date);(function e(){t.style.opacity=+t.style.opacity-(new Date-o)/n,o=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"})()}()}catch(e){t.e(e)}finally{t.f()}}}]),t}();function _addElement2(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(_classPrivateFieldSet(this,_selector,e),this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):_classPrivateMethodGet(this,_deselect,_deselect2).call(this)}function _push2(e){this.elements.push(e)}function _reduce2(){this.elements=this.elements.slice(0,-1)}function _deselect2(){this.elements=[]}function _onChecker2(e){if(e.target===document.querySelector(_classPrivateFieldGet(this,_eventSelector)))return e.stopPropagation(),_classPrivateFieldGet(this,_eventCallback).call(this,e)}function _isElem2(e,t){var o=!1;return"function"==typeof t&&(o=o||t.call(this,e)),o="string"==typeof t?t.match(/^[a-z]/)&&function(e){e=document.createElement(e).constructor;return!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))}(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==_classPrivateFieldGet(this,_selector)?null!==document.querySelector(_classPrivateFieldGet(this,_selector)+t):_classPrivateMethodGet(this,_isWithoutSelector,_isWithoutSelector2).call(this,e,t)):o}function _isWithoutSelector2(e,t){var o,n=!1,i=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(i.s();!(o=i.n()).done;)var a=o.value,n=n||e===a}catch(e){i.e(e)}finally{i.f()}return n}function apbct(e){return(new ApbctCore).select(e)}var _xhr=new WeakMap,_methods_to_convert_data_to_URL=new WeakMap,_body=new WeakMap,_http_code=new WeakMap,_status_text=new WeakMap,_prepare=new WeakSet,_complete=new WeakSet,_error=new WeakSet,ApbctXhr=function(){function o(e){for(var t in _classCallCheck(this,o),_classPrivateMethodInitSpec(this,_error),_classPrivateMethodInitSpec(this,_complete),_classPrivateMethodInitSpec(this,_prepare),_classPrivateFieldInitSpec(this,_xhr,{writable:!0,value:new XMLHttpRequest}),_defineProperty(this,"method","POST"),_defineProperty(this,"url",""),_defineProperty(this,"async",!0),_defineProperty(this,"user",null),_defineProperty(this,"password",null),_defineProperty(this,"data",{}),_defineProperty(this,"button",null),_defineProperty(this,"spinner",null),_defineProperty(this,"progressbar",null),_defineProperty(this,"context",this),_defineProperty(this,"callback",null),_defineProperty(this,"onErrorCallback",null),_defineProperty(this,"responseType","json"),_defineProperty(this,"headers",{}),_defineProperty(this,"timeout",15e3),_classPrivateFieldInitSpec(this,_methods_to_convert_data_to_URL,{writable:!0,value:["GET","HEAD"]}),_classPrivateFieldInitSpec(this,_body,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,_http_code,{writable:!0,value:0}),_classPrivateFieldInitSpec(this,_status_text,{writable:!0,value:""}),console.log("%cXHR%c started","color: red; font-weight: bold;","color: grey; font-weight: normal;"),e)void 0!==this[t]&&(this[t]=e[t]);if(_classPrivateMethodGet(this,_prepare,_prepare2).call(this),Object.keys(this.data).length&&(this.deleteDoubleJSONEncoding(this.data),this.convertData()),!this.url)return console.log("%cXHR%c not URL provided","color: red; font-weight: bold;","color: grey; font-weight: normal;"),!1;_classPrivateFieldGet(this,_xhr).open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),_classPrivateFieldGet(this,_xhr).responseType=this.responseType,_classPrivateFieldGet(this,_xhr).timeout=this.timeout,_classPrivateFieldGet(this,_xhr).onreadystatechange=function(){this.onReadyStateChange()}.bind(this),_classPrivateFieldGet(this,_xhr).onload=function(){this.onLoad()}.bind(this),_classPrivateFieldGet(this,_xhr).onprogress=function(e){this.onProgress(e)}.bind(this),_classPrivateFieldGet(this,_xhr).onerror=function(){this.onError()}.bind(this),_classPrivateFieldGet(this,_xhr).ontimeout=function(){this.onTimeout()}.bind(this),_classPrivateFieldGet(this,_xhr).send(_classPrivateFieldGet(this,_body))}return _createClass(o,[{key:"onReadyStateChange",value:function(){null!==this.on_ready_state_change&&"function"==typeof this.on_ready_state_change&&this.on_ready_state_change()}},{key:"onProgress",value:function(e){null!==this.on_progress&&"function"==typeof this.on_progress&&this.on_progress()}},{key:"onError",value:function(){console.log("error"),_classPrivateMethodGet(this,_complete,_complete2).call(this),_classPrivateMethodGet(this,_error,_error2).call(this,_classPrivateFieldGet(this,_http_code),_classPrivateFieldGet(this,_status_text)),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(_classPrivateFieldGet(this,_status_text))}},{key:"onTimeout",value:function(){_classPrivateMethodGet(this,_complete,_complete2).call(this),_classPrivateMethodGet(this,_error,_error2).call(this,0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(_classPrivateMethodGet(this,_complete,_complete2).call(this),"json"===this.responseType){if(null===_classPrivateFieldGet(this,_xhr).response)return _classPrivateMethodGet(this,_error,_error2).call(this,_classPrivateFieldGet(this,_http_code),_classPrivateFieldGet(this,_status_text),"No response"),!1;if(void 0!==_classPrivateFieldGet(this,_xhr).response.error)return _classPrivateMethodGet(this,_error,_error2).call(this,_classPrivateFieldGet(this,_http_code),_classPrivateFieldGet(this,_status_text),_classPrivateFieldGet(this,_xhr).response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,_classPrivateFieldGet(this,_xhr).response,this.data)}},{key:"errorOutput",value:function(e){console.log("%c ctXHR error: %c"+e,"color: red;","color: grey;")}},{key:"setHeaders",value:function(){for(var e in this.headers)void 0!==this.headers[e]&&_classPrivateFieldGet(this,_xhr).setRequestHeader(e,this.headers[e])}},{key:"convertData",value:function(){return~_classPrivateFieldGet(this,_methods_to_convert_data_to_URL).indexOf(this.method)?this.convertDataToURL():this.convertDataToBody()}},{key:"convertDataToURL",value:function(){var e=new URLSearchParams(this.data).toString(),t=this.url.match(/^(https?:\/{2})?[a-z0-9.]+\?/)?"&":"?";return this.url+=t+e,this.url}},{key:"convertDataToBody",value:function(){for(var e in _classPrivateFieldSet(this,_body,new FormData),this.data)_classPrivateFieldGet(this,_body).append(e,"object"===_typeof(this.data[e])?JSON.stringify(this.data[e]):this.data[e]);return _classPrivateFieldGet(this,_body)}},{key:"deleteDoubleJSONEncoding",value:function(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=this.deleteDoubleJSONEncoding(e[t])),"string"!=typeof e[t]||null===e[t].match(/^[\[{].*?[\]}]$/)||"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}}]),o}();function _prepare2(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}function _complete2(){_classPrivateFieldSet(this,_http_code,_classPrivateFieldGet(this,_xhr).status),_classPrivateFieldSet(this,_status_text,_classPrivateFieldGet(this,_xhr).statusText),this.button&&(this.button.removeAttribute("disabled"),this.button.style.cursor="auto"),this.spinner&&(this.spinner.style.display="none"),this.progressbar&&this.progressbar.fadeOut("slow")}function _error2(e,t,o){var n="";"timeout"===t?n+="Server response timeout":200===e?"parsererror"===t?n+="Unexpected response from server. See console for details.":(n+="Unexpected error. Status: "+t+".",void 0!==o&&(n+=" Additional error info: "+o)):n+=500===e?"Internal server error.":"Unexpected response code:"+e,this.errorOutput(n)}var ApbctAjax=function(){_inherits(t,ApbctXhr);var e=_createSuper(t);function t(){return _classCallCheck(this,t),e.call(this,arguments.length<=0?void 0:arguments[0])}return _createClass(t)}(),ApbctRest=function(){_inherits(a,ApbctXhr);var i=_createSuper(a);function a(){for(var e,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return _classCallCheck(this,a),(o=o[0]).url=a.default_route+o.route,o.headers={"X-WP-Nonce":ctPublicFunctions._rest_nonce},_defineProperty(_assertThisInitialized(e=i.call(this,o)),"route",""),e}return _createClass(a)}();function ctSetCookie(e,t,o){var n;if(("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(n="ct_pointer_data"===e,e=[[e,t,o]]),"none"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){apbctLocalStorage.set(e[0],encodeURIComponent(e[1]))}),ctNoCookieAttachHiddenFieldsToForms();else if("native"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){var n=void 0!==e[2]?"expires="+n+"; ":"",i="https:"===location.protocol?"; secure":"";document.cookie=ctPublicFunctions.cookiePrefix+e[0]+"="+encodeURIComponent(e[1])+"; "+n+"path=/; samesite=lax"+i});else if("alternative"===ctPublicFunctions.data__cookies_type&&!n){"function"==typeof getJavascriptClientData?e=getJavascriptClientData(e):console.log("APBCT ERROR: getJavascriptClientData() is not loaded");try{JSON.parse(e)}catch(e){return void console.log("APBCT ERROR: JSON parse error:"+e)}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{notJson:1})}}function ctGetCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}function ctDeleteCookie(e){var t;"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?(t="https:"===location.protocol?"; secure":"",document.cookie=e+'=""; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax'+t):ctPublicFunctions.data__cookies_type)}function apbct_public_sendAJAX(e,t,o){var n=[];n.callback=t.callback||null,n.onErrorCallback=t.onErrorCallback||null,n.callback_context=t.callback_context||null,n.callback_params=t.callback_params||null,n.async=t.async||!0,n.notJson=t.notJson||null,n.timeout=t.timeout||15e3,n.obj=o||null,n.button=t.button||null,n.progressbar=t.progressbar||null,n.silent=t.silent||null,n.no_nonce=t.no_nonce||null,n.data=e,n.url=ctPublicFunctions._ajax_url,"string"==typeof e?(n.no_nonce||(n.data=n.data+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce),n.data=n.data+"&no_cache="+Math.random()):(n.no_nonce||(n.data._ajax_nonce=ctPublicFunctions._ajax_nonce),n.data.no_cache=Math.random()),(new ApbctCore).ajax(n)}function apbct_public_sendREST(e,t){var o=[];o.route=e,o.callback=t.callback||null,o.onErrorCallback=t.onErrorCallback||null,o.data=t.data||[],o.method=t.method||"POST",(new ApbctCore).rest(o)}_defineProperty(ApbctRest,"default_route",ctPublicFunctions._rest_url+"cleantalk-antispam/v1/");var apbctLocalStorage={get:function(t,e){void 0===e&&(e="value");t=localStorage.getItem(t);if(null!==t)try{var o=JSON.parse(t);return o.hasOwnProperty(e)?JSON.parse(o[e]):o}catch(e){return t}return!1},set:function(e,t){var o;!(2<arguments.length&&void 0!==arguments[2])||arguments[2]?(o={value:JSON.stringify(t),timestamp:Math.floor((new Date).getTime()/1e3)},localStorage.setItem(e,JSON.stringify(o))):localStorage.setItem(e,t)},isAlive:function(e,t){return void 0===t&&(t=86400),this.get(e,"timestamp")+t>Math.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t<localStorage.length;t++){var o=localStorage.key(t);-1===o.indexOf("ct_")&&-1===o.indexOf("apbct_")||(e[o.toString()]=apbctLocalStorage.get(o))}return e}},ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctCheckedEmails={};function apbct_attach_event_handler(e,t,o){"function"==typeof window.addEventListener?e.addEventListener(t,o):e.attachEvent(t,o)}function apbct_remove_event_handler(e,t,o){"function"==typeof window.removeEventListener?e.removeEventListener(t,o):e.detachEvent(t,o)}var ctFunctionFirstKey=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200),ctFunctionMouseMove=function(e){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter&&ctMouseStopData())};function ctMouseStopData(){apbct_remove_event_handler(document,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(document,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(document,"keydown",ctFunctionFirstKey)}function checkEmail(e){var t=e.target.value;!t||t in ctCheckedEmails||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}))}function ctSetPixelImg(e){var t;ctSetCookie("apbct_pixel_url",e),+ctPublic.pixel__enabled&&!document.getElementById("apbct_pixel")&&((t=document.createElement("img")).setAttribute("alt","CleanTalk Pixel"),t.setAttribute("id","apbct_pixel"),t.setAttribute("style","display: none; left: 99999px;"),t.setAttribute("src",e),apbct("body").append(t))}function ctGetPixelUrl(){var e=apbctLocalStorage.get("apbct_pixel_url");if(!1!==e){if(!apbctLocalStorage.isAlive("apbct_pixel_url",10800))return void ctSetPixelImg(e);apbctLocalStorage.delete("apbct_pixel_url")}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}})}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0))}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0))}function ctPreloadLocalStorage(){ctPublic.data__to_local_storage&&Object.entries(ctPublic.data__to_local_storage).forEach(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];apbctLocalStorage.set(t,e)})}function apbct_ready(){ctPreloadLocalStorage();var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ct_date.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if(apbctLocalStorage.set("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),apbctLocalStorage.set("ct_fkp_timestamp","0"),apbctLocalStorage.set("ct_pointer_data","0"),apbctLocalStorage.set("ct_timezone",ct_date.getTimezoneOffset()/60*-1),apbctLocalStorage.set("ct_screen_info",apbctGetScreenInfo()),apbctLocalStorage.set("apbct_headless",navigator.webdriver),"native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var o=0;o<t.length;o++){var n=t[o].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(+ctPublic.pixel__enabled?ctGetPixelUrl():e.push(["apbct_pixel_url",ctPublic.pixel__url])),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),apbct("input[type = 'email'], #email").on("blur",checkEmail)),apbctLocalStorage.isSet("ct_checkjs")?e.push(["ct_checkjs",apbctLocalStorage.get("ct_checkjs")]):e.push(["ct_checkjs",0]),ctSetCookie(e),setTimeout(function(){ctNoCookieAttachHiddenFieldsToForms();for(var e=0;e<document.forms.length;e++){var t,o,n=document.forms[e];0==+ctPublic.data__visible_fields_required||"get"===n.method.toString().toLowerCase()||n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"===n.id||n.classList&&n.classList.contains("tinkoffPayRow")||n.classList&&n.classList.contains("give-form")||n.id&&"ult-forgot-password-form"===n.id||n.id&&-1!==n.id.toString().indexOf("calculatedfields")||n.id&&-1!==n.id.toString().indexOf("sac-form")||n.id&&-1!==n.id.toString().indexOf("cp_tslotsbooking_pform")||n.name&&-1!==n.name.toString().indexOf("cp_tslotsbooking_pform")||"https://epayment.epymtservice.com/epay.jhtml"===n.action.toString()||n.name&&-1!==n.name.toString().indexOf("tribe-bar-form")||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("id","apbct_visible_fields_"+e),t.setAttribute("name","apbct_visible_fields"),(o={})[0]=apbct_collect_visible_fields(n),t.value=JSON.stringify(o),n.append(t),n.onsubmit_prev=n.onsubmit,n.ctFormIndex=e,n.onsubmit=function(e){var t;"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&((t={})[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t,e.target.ctFormIndex)),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3);var i=document.querySelectorAll("[data-original-string]");if(i.length)for(var a=0;a<i.length;++a)i[a].parentElement.href||i[a].parentElement.parentElement.href||i[a].addEventListener("click",ctFillDecodedEmailHandler)}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler),apbctAjaxEmailDecode(e,this)}function apbctAjaxEmailDecode(e,t){var o=e.target,n={event_javascript_data:getJavascriptClientData(),post_url:document.location.href,referrer:document.referrer},i=(void 0!==t.href&&0===t.href.indexOf("mailto:")&&e.preventDefault(),o.setAttribute("title",ctPublicFunctions.text__wait_for_decoding),o.style.cursor="progress",document.createElement("div")),a=(i.setAttribute("class","apbct-tooltip"),document.createElement("div")),r=(a.setAttribute("class","apbct-tooltip--text"),document.createElement("div")),a=(r.setAttribute("class","apbct-tooltip--arrow"),apbct(o).append(i),apbct(i).append(a),apbct(i).append(r),ctShowDecodeComment(o,ctPublicFunctions.text__wait_for_decoding),e.target.dataset.originalString);void 0!==t.href&&0===t.href.indexOf("mailto:")&&(a=t.dataset.originalString),n.encodedEmail=a,"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:n,method:"POST",callback:function(e){apbctEmailEncoderCallback(e,t,o)},onErrorCallback:function(e){o.addEventListener("click",ctFillDecodedEmailHandler),o.removeAttribute("style"),ctShowDecodeComment(o,"Error occurred: "+e)}}):(n.action="apbct_decode_email",apbct_public_sendAJAX(n,{notJson:!0,callback:function(e){apbctEmailEncoderCallback(e,t,o)},onErrorCallback:function(e){o.addEventListener("click",ctFillDecodedEmailHandler),o.removeAttribute("style"),ctShowDecodeComment(o,"Error occurred: "+e)}}))}function apbctEmailEncoderCallback(e,t,o){var n,i;e.success?void 0!==t.href&&0===t.href.indexOf("mailto:")?(n=t.href.replace("mailto:",""),i=t.innerHTML,t.innerHTML=i.replace(n,e.data.decoded_email),t.href="mailto:"+e.data.decoded_email,t.click()):setTimeout(function(){ctProcessDecodedDataResult(e.data,o)},3e3):(o.removeAttribute("style"),ctShowDecodeComment(o,e.data.comment))}function getJavascriptClientData(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t={},o=(t.apbct_headless=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless"),t.apbct_pixel_url=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),t.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),t.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),t.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),t.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),t.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),t.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),t.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone"),apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved")),n=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),i=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),a=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),r=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type");if(t.ct_mouse_moved=void 0!==o?o:a,t.ct_has_scrolled=void 0!==n?n:r,t.ct_cookies_type=void 0!==i?i:c,"object"===_typeof(e)&&e!==[])for(var l=0;l<e.length;++l)"object"===_typeof(e[l][1])?t[e[l][1][0]]=e[l][1][1]:t[e[l][0]]=e[l][1];else console.log("APBCT JS ERROR: Collecting data type mismatch");return t=removeDoubleJsonEncoding(t),JSON.stringify(t)}function removeDoubleJsonEncoding(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=removeDoubleJsonEncoding(e[t])),"string"!=typeof e[t]||null===e[t].match(/^[\[{].*?[\]}]$/)||"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),e.is_allowed&&ctFillDecodedEmail(t,e.decoded_email),e.show_comment&&ctShowDecodeComment(t,e.comment)}function ctFillDecodedEmail(e,t){apbct(e).html(apbct(e).html().replace(/.+?(<div class=["']apbct-tooltip["'].+?<\/div>)/,t+"$1"))}function ctShowDecodeComment(e,t){t&&(apbct(e.getElementsByClassName("apbct-tooltip")).fadeIn(300),apbct(e.getElementsByClassName("apbct-tooltip--text")).html(t),setTimeout(function(){apbct(e.getElementsByClassName("apbct-tooltip")).fadeOut(700)},5e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",i=0,a="",r=0,c=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===c.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(c.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),i++):(a+=" "+e.getAttribute("name"),r++))}),a=a.trim(),{visible_fields:n=n.trim(),visible_fields_count:i,invisible_fields:a,invisible_fields_count:r}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10<n)return;ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(o[n]))}else"none"===ctPublic.data__cookies_type?ctSetCookie("apbct_visible_fields",JSON.stringify(o[0])):ctSetCookie("apbct_visible_fields",JSON.stringify(o))}function apbct_js_keys__set_input_value(e,t,o,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var i=document.querySelectorAll("[name^=ct_checkjs]"),a=0;a<i.length;a++)i[a].value=e.js_key}function apbctGetScreenInfo(){return JSON.stringify({fullWidth:document.documentElement.scrollWidth,fullHeight:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),visibleWidth:document.documentElement.clientWidth,visibleHeight:document.documentElement.clientHeight})}function ctParseBlockMessage(e){void 0!==e.apbct&&(e=e.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:e.comment}})),cleantalkModal.loaded=e.comment,cleantalkModal.open(),1==+e.stop_script&&window.stop())}function ctSetPixelUrlLocalstorage(e){ctSetCookie("apbct_pixel_url",e)}function ctNoCookieConstructHiddenField(){var e="",t=apbctLocalStorage.getCleanTalkData(),t=JSON.stringify(t);return t=btoa(t),(e=document.createElement("input")).setAttribute("id","ct_no_cookie_hidden_field"),e.setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",t),e.setAttribute("type","hidden"),e}function ctNoCookieGetForms(){var e=document.forms;return e||!1}function ctNoCookieAttachHiddenFieldsToForms(){if("none"===ctPublic.data__cookies_type){var e=ctNoCookieGetForms();if(e)for(var t=0;t<e.length;t++)if(null===document.forms[t].getAttribute("method")||"post"===document.forms[t].getAttribute("method").toLowerCase()){var o=document.getElementsByName("ct_no_cookie_hidden_field");if(o)for(var n=0;n<o.length;n++)o[n].parentNode.removeChild(o[n]);document.forms[t].append(ctNoCookieConstructHiddenField())}}}apbct_attach_event_handler(document,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(document,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(document,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(document,"scroll",ctSetHasScrolled),"loading"!==document.readyState?apbct_ready():apbct_attach_event_handler(document,"DOMContentLoaded",apbct_ready),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,o){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){try{var n=JSON.parse(t.responseText)}catch(e){return void console.log(e.toString())}ctParseBlockMessage(n)}});var cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e,t="";for(e in this.styles)t+=e+":"+this.styles[e]+";";return t}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},i={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},r={styles:{overflow:"hidden"},toString:e},c=document.createElement("style"),r=(c.setAttribute("id","cleantalk-modal-styles"),c.innerHTML="body.cleantalk-modal-opened{"+r+"}",c.innerHTML+="#cleantalk-modal-overlay{"+t+"}",c.innerHTML+="#cleantalk-modal-close{"+n+"}",c.innerHTML+="#cleantalk-modal-close:before{"+i+"}",c.innerHTML+="#cleantalk-modal-close:after{"+a+"}",document.body.append(c),document.createElement("div")),t=(r.setAttribute("id","cleantalk-modal-overlay"),document.body.append(r),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),r.append(t),document.createElement("div")),i=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?i.innerHTML=this.loaded:(i.innerHTML="Loading...",this.load("get_options_template")),i.setAttribute("id","cleantalk-modal-content"),t.append(i),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}},buttons_to_handle=(document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),[]),gdpr_notice_for_button="Please, apply the GDPR agreement.";function apbct_gdpr_handle_buttons(){try{buttons_to_handle!==[]&&buttons_to_handle.forEach(function(e){var t='[id="apbct_gdpr_'+e.index+'"]',t=jQuery(t);jQuery(t).prop("checked")?(e.button.disabled=!1,jQuery(e.button).prop("title",e.old_notice)):(e.button.disabled=!0,jQuery(e.button).prop("title",gdpr_notice_for_button))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not handle form buttons "+e)}}function ct_protect_external(){for(var e=0;e<document.forms.length;e++)if(void 0===document.forms[e].cleantalk_hidden_action&&void 0===document.forms[e].cleantalk_hidden_method){var t,o=document.forms[e];if(o.parentElement&&0<o.parentElement.classList.length&&-1!==o.parentElement.classList[0].indexOf("mewtwo"))return;"string"==typeof o.action&&(isIntegratedForm(o)?apbctProcessExternalForm(o,e,document):-1===o.action.indexOf("http://")&&-1===o.action.indexOf("https://")||o.action.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((t=document.createElement("input")).name="cleantalk_hidden_action",t.value=o.action,t.type="hidden",o.appendChild(t),(t=document.createElement("input")).name="cleantalk_hidden_method",t.value=o.method,t.type="hidden",o.method="POST",o.appendChild(t),o.action=document.location))}var n=document.getElementsByTagName("iframe");if(0<n.length)for(var i=0;i<n.length;i++)if(null!=n[i].contentDocument){var a=n[i].contentDocument.forms;if(0===a.length)return;for(var r=0;r<a.length;r++)apbctProcessExternalForm(a[r],r,n[i].contentDocument)}}function apbctProcessExternalForm(e,n,i){var t=document.createElement("i"),t=(t.className="cleantalk_placeholder",t.style="display: none",e.parentElement.insertBefore(t,e),e.previousSibling),o=e.outerHTML,a=e,e=(e.parentElement.removeChild(e),document.createElement("div")),o=(e.innerHTML=o,t.after(e.firstElementChild),document.createElement("input")),r=(o.name="action",o.value="cleantalk_force_ajax_check",o.type="hidden",i.forms[n]),c=(r.appendChild(o),r.apbctPrev=t,r.apbctFormOriginal=a,!1);void 0!==r.classList&&["newsletterform","ml-block-form"].forEach(function(e){r.classList.contains(e)&&(c=e)}),c?void 0!==(e=jQuery("form."+c).find('button[type="submit"]'))&&e.click(function(e){e.preventDefault(),sendAjaxCheckingFormData(e.currentTarget)}):i.forms[n].onsubmit=function(e){var t,o;e.preventDefault(),-1!==i.forms[n].id.indexOf("mauticform")&&0<(t=jQuery(i.forms[n]).find('input[id*="checkbox_rgpd"]')).length&&!0===t.prop("checked")&&0<(o=jQuery(".cleantalk_placeholder")).length&&o[0].setAttribute("mautic_hidden_gdpr_id",t.prop("id")),jQuery(e.currentTarget).prev(),jQuery(e.currentTarget).clone();sendAjaxCheckingFormData(e.currentTarget)}}function apbct_replace_inputs_values_from_other_form(e,t){var e=jQuery(e).find("button, input, textarea, select"),o=jQuery(t).find("button, input, textarea, select");e.each(function(e,n){var i=jQuery(n);o.each(function(e,t){var o=jQuery(t);n.outerHTML===t.outerHTML&&o.val(i.val())})})}function isIntegratedForm(e){var t=e.action,o=e.id;return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("webto.salesforce.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com")||-1!==t.indexOf("mautic")||-1!==o.indexOf("mauticform_"))}function sendAjaxCheckingFormData(d,e,t){var o={},n=(o[0]=apbct_collect_visible_fields(d),apbct_visible_fields_set_cookie(o),{}),o=d.elements;(o=Array.prototype.slice.call(o)).forEach(function(e,t){""===e.name?n["input_"+t]=e.value:n[e.name]=e.value}),apbct_public_sendAJAX(n,{async:!1,callback:function(e,t,o,n){if(void 0===e.apbct||!+e.apbct.blocked){var i=jQuery(d).detach(),a=d.apbctPrev,r=d.apbctFormOriginal,c=!1,l=(apbct_replace_inputs_values_from_other_form(i,r),-1!==r.id.indexOf("mautic")&&(c=!0),document.getElementsByClassName("cleantalk_placeholder"));if(l)for(var s=0;s<l.length;s++){var u=l[s].getAttribute("mautic_hidden_gdpr_id");void 0===u||void 0!==(u=jQuery(r).find("#"+u))&&u.prop("checked",!0)}a.after(r),jQuery(r).find('input[name="apbct_visible_fields"]').remove(),jQuery(r).find('input[value="cleantalk_force_ajax_check"]').remove();i=jQuery(r).find("button[type=submit]");if(0!==i.length)return i[0].click(),void(c&&setTimeout(function(){ct_protect_external()},1500));if(0!==(i=jQuery(r).find("input[type=submit]")).length)return void i[0].click();if(0!==(i=jQuery(r).find('button[data-element="submit"]')).length)return void i[0].click();0!==(i=jQuery(r).find('input[type="image"][name="submit"]')).length&&i[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function ct_check_internal(t){var e,o={},n=t.elements;for(e in n)"submit"!=n[e].type&&null!=n[e].value&&""!=n[e].value&&(o[n[e].name]=t.elements[e].value);o.action="ct_check_internal",apbct_public_sendAJAX(o,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.submit()}})}function ct_check_internal__is_exclude_form(t){return["wp-login.php","wp-comments-post.php"].some(function(e){return null!==t.match(new RegExp(ctPublic.blog_home+".*"+e))})}document.addEventListener("DOMContentLoaded",function(){if(buttons_to_handle=[],"undefined"!=typeof ctPublicGDPR&&ctPublicGDPR.gdpr_forms.length&&"undefined"!=typeof jQuery)try{ctPublicGDPR.gdpr_forms.forEach(function(e,t){var o=jQuery("#"+e+", ."+e),e=(o.is("form")||(o.find("form")[0]?o=o.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+e)?o=jQuery(".wpcf7[role=form]").children("form"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+e)?o=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+e)&&(o=jQuery(".wpforms-form"))),!1),n=o.find('input[type|="submit"]');n.length&&(!1!==(e=n[0])&&(e.disabled=!0,n=jQuery(e).prop("title")?jQuery(e).prop("title"):"",buttons_to_handle.push({index:t,button:e,old_notice:n}),jQuery(e).prop("title",gdpr_notice_for_button)),!o.is("form")&&"form"!==o.attr("role")||o.append('<input id="apbct_gdpr_'+t+'" type="checkbox" required="required" style=" margin-right: 10px;" onchange="apbct_gdpr_handle_buttons()">').append('<label style="display: inline;" for="apbct_gdpr_'+t+'">'+ctPublicGDPR.gdpr_text+"</label>"))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not add GDPR notice"+e)}}),window.onload=function(){+ctPublic.settings__forms__check_external&&"undefined"!=typeof jQuery&&setTimeout(function(){ct_protect_external()},1500)},document.addEventListener("DOMContentLoaded",function(){var e,t="";if(+ctPublic.settings__forms__check_internal)for(var o=0;o<document.forms.length;o++)"string"!=typeof document.forms[o].action||null===(t=(e=document.forms[o]).action).indexOf("https?://")||null===t.match(ctPublic.blog_home+".*?.php")||ct_check_internal__is_exclude_form(t)||(e.click,"undefined"!=typeof jQuery&&(jQuery(e).off("**"),jQuery(e).off(),jQuery(e).on("submit",function(e){return ct_check_internal(e.target),!1})))});
1
+ "use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,i,r=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(r.push(n.value),!t||r.length!==t);a=!0);}catch(e){c=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(c)throw i}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(o){var n=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(o);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var o,n,i,r,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return n=!(o=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return o=e.done,e},e:function(e){n=!0,i=e},f:function(){try{o||null==a.return||a.return()}finally{if(n)throw i}}};if(Array.isArray(e)||(a=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function _typeof(e){return(_typeof="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})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var ApbctCore=function(){function t(e){_classCallCheck(this,t),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"rest_parameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(e)}return _createClass(t,[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t|=!1,"object"===_typeof(e)){for(var o in e)for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),i=0;i<this.elements.length;i++)this.elements[i].style[n]=e[o];return this}var r;if("string"==typeof e)return void 0!==(r=getComputedStyle(this.elements[0])[e])&&!t&&(r=r.replace(/(\d)(em|pt|%|px){1,2}$/,"$1"),Number(r)==r)?Number(r):r}},{key:"hide",value:function(){this.prop("prev-display",this.css("display")),this.css({display:"none"})}},{key:"show",value:function(){this.css({display:this.prop("prev-display")})}},{key:"addClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.add(className)}},{key:"removeClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.remove(className)}},{key:"toggleClass",value:function(e){for(var t=0;t<this.elements.length;t++)this.elements[t].classList.toggle(e)}},{key:"ajax",value:function(e){return this.ajax_parameters=e,new ApbctAjax(e)}},{key:"rest",value:function(e){return this.rest_parameters=e,new ApbctRest(e)}},{key:"on",value:function(){this.event=arguments.length<=0?void 0:arguments[0],this.eventCallback=(arguments.length<=2?void 0:arguments[2])||(arguments.length<=1?void 0:arguments[1]),this.eventSelector="string"==typeof(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:null;for(var e=0;e<this.elements.length;e++)this.elements[e].addEventListener(this.event,null!==this.eventSelector?this.onChecker.bind(this):this.eventCallback)}},{key:"onChecker",value:function(e){if(e.target===document.querySelector(this.eventSelector))return e.stopPropagation(),this.eventCallback(e)}},{key:"ready",value:function(e){document.addEventListener("DOMContentLoaded",e)}},{key:"change",value:function(e){this.on("change",e)}},{key:"attr",value:function(e){for(var t=[],o=0;o<this.elements.length;o++)void 0!==_typeof(this.elements[o][e])?t.push(this.elements[o][e]):t.push(this.elements[o].getAttribute(e));return 1===t.length?t[0]:t}},{key:"prop",value:function(e,t){if(void 0!==t){for(var o=0;o<this.elements.length;o++)this.elements[o][e]=t;return this}for(var n=[],i=0;i<this.elements.length;i++)n.push(this.elements[i][e]);return 1===n.length?n[0]:n}},{key:"html",value:function(e){return void 0!==e?this.prop("innerHTML",e):this.prop("innerHTML")}},{key:"val",value:function(e){return void 0!==e?this.prop("value",e):this.prop("value")}},{key:"data",value:function(e,t){return void 0!==t?this.prop("apbct-data",e,t):this.prop("apbct-data")}},{key:"is",value:function(e){var t,o=!1,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)var i=t.value,o=o||this.isElem(i,e)}catch(e){n.e(e)}finally{n.f()}return o}},{key:"isElem",value:function(e,t){var o=!1;return"function"==typeof t&&(o=o||t.call(this,e)),o="string"==typeof t?t.match(/^[a-z]/)&&function(e){e=document.createElement(e).constructor;return!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))}(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,i=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(i.s();!(o=i.n()).done;)var r=o.value,n=n||e===r}catch(e){i.e(e)}finally{i.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(this.elements[t],e)||this.elements.splice(Number(t),1);return this}},{key:"parent",value:function(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}},{key:"children",value:function(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}},{key:"siblings",value:function(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}},{key:"remove",value:function(){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)e.value.remove()}catch(e){t.e(e)}finally{t.f()}}},{key:"after",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.after(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"append",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.append(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"fadeIn",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=0,t.style.display="block",+new Date);(function e(){t.style.opacity=+t.style.opacity+(new Date-o)/n,o=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))})()}()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=1,+new Date);(function e(){t.style.opacity=+t.style.opacity-(new Date-o)/n,o=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"})()}()}catch(e){t.e(e)}finally{t.f()}}}]),t}();function apbct(e){return(new ApbctCore).select(e)}var ApbctXhr=function(){function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",new XMLHttpRequest),_defineProperty(this,"method","POST"),_defineProperty(this,"url",""),_defineProperty(this,"async",!0),_defineProperty(this,"user",null),_defineProperty(this,"password",null),_defineProperty(this,"data",{}),_defineProperty(this,"button",null),_defineProperty(this,"spinner",null),_defineProperty(this,"progressbar",null),_defineProperty(this,"context",this),_defineProperty(this,"callback",null),_defineProperty(this,"onErrorCallback",null),_defineProperty(this,"responseType","json"),_defineProperty(this,"headers",{}),_defineProperty(this,"timeout",15e3),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),console.log("%cXHR%c started","color: red; font-weight: bold;","color: grey; font-weight: normal;"),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),Object.keys(this.data).length&&(this.deleteDoubleJSONEncoding(this.data),this.convertData()),!this.url)return console.log("%cXHR%c not URL provided","color: red; font-weight: bold;","color: grey; font-weight: normal;"),!1;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=this.xhr.statusText,this.button&&(this.button.removeAttribute("disabled"),this.button.style.cursor="auto"),this.spinner&&(this.spinner.style.display="none"),this.progressbar&&this.progressbar.fadeOut("slow")}},{key:"onReadyStateChange",value:function(){null!==this.on_ready_state_change&&"function"==typeof this.on_ready_state_change&&this.on_ready_state_change()}},{key:"onProgress",value:function(e){null!==this.on_progress&&"function"==typeof this.on_progress&&this.on_progress()}},{key:"onError",value:function(){console.log("error"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"error",value:function(e,t,o){var n="";"timeout"===t?n+="Server response timeout":200===e?"parsererror"===t?n+="Unexpected response from server. See console for details.":(n+="Unexpected error. Status: "+t+".",void 0!==o&&(n+=" Additional error info: "+o)):n+=500===e?"Internal server error.":"Unexpected response code:"+e,this.errorOutput(n)}},{key:"errorOutput",value:function(e){console.log("%c ctXHR error: %c"+e,"color: red;","color: grey;")}},{key:"setHeaders",value:function(){for(var e in this.headers)void 0!==this.headers[e]&&this.xhr.setRequestHeader(e,this.headers[e])}},{key:"convertData",value:function(){return~this.methods_to_convert_data_to_URL.indexOf(this.method)?this.convertDataToURL():this.convertDataToBody()}},{key:"convertDataToURL",value:function(){var e=new URLSearchParams(this.data).toString(),t=this.url.match(/^(https?:\/{2})?[a-z0-9.]+\?/)?"&":"?";return this.url+=t+e,this.url}},{key:"convertDataToBody",value:function(){for(var e in this.body=new FormData,this.data)this.body.append(e,"object"===_typeof(this.data[e])?JSON.stringify(this.data[e]):this.data[e]);return this.body}},{key:"deleteDoubleJSONEncoding",value:function(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=this.deleteDoubleJSONEncoding(e[t])),"string"==typeof e[t]&&null!==e[t].match(/^[\[{].*?[\]}]$/)&&"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}}]),o}(),ApbctAjax=function(){_inherits(t,ApbctXhr);var e=_createSuper(t);function t(){return _classCallCheck(this,t),e.call(this,arguments.length<=0?void 0:arguments[0])}return _createClass(t)}(),ApbctRest=function(){_inherits(r,ApbctXhr);var i=_createSuper(r);function r(){for(var e,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return _classCallCheck(this,r),(o=o[0]).url=r.default_route+o.route,o.headers={"X-WP-Nonce":ctPublicFunctions._rest_nonce},_defineProperty(_assertThisInitialized(e=i.call(this,o)),"route",""),e}return _createClass(r)}();function ctSetCookie(e,t,o){var n;if(("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(n="ct_pointer_data"===e,e=[[e,t,o]]),"none"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){apbctLocalStorage.set(e[0],encodeURIComponent(e[1]))}),ctNoCookieAttachHiddenFieldsToForms();else if("native"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){var n=void 0!==e[2]?"expires="+n+"; ":"",i="https:"===location.protocol?"; secure":"";document.cookie=ctPublicFunctions.cookiePrefix+e[0]+"="+encodeURIComponent(e[1])+"; "+n+"path=/; samesite=lax"+i});else if("alternative"===ctPublicFunctions.data__cookies_type&&!n){"function"==typeof getJavascriptClientData?e=getJavascriptClientData(e):console.log("APBCT ERROR: getJavascriptClientData() is not loaded");try{JSON.parse(e)}catch(e){return void console.log("APBCT ERROR: JSON parse error:"+e)}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{notJson:1})}}function ctGetCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}function ctDeleteCookie(e){var t;"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?(t="https:"===location.protocol?"; secure":"",document.cookie=e+'=""; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax'+t):ctPublicFunctions.data__cookies_type)}function apbct_public_sendAJAX(e,t,o){var n=[];n.callback=t.callback||null,n.onErrorCallback=t.onErrorCallback||null,n.callback_context=t.callback_context||null,n.callback_params=t.callback_params||null,n.async=t.async||!0,n.notJson=t.notJson||null,n.timeout=t.timeout||15e3,n.obj=o||null,n.button=t.button||null,n.progressbar=t.progressbar||null,n.silent=t.silent||null,n.no_nonce=t.no_nonce||null,n.data=e,n.url=ctPublicFunctions._ajax_url,"string"==typeof e?(n.no_nonce||(n.data=n.data+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce),n.data=n.data+"&no_cache="+Math.random()):(n.no_nonce||(n.data._ajax_nonce=ctPublicFunctions._ajax_nonce),n.data.no_cache=Math.random()),(new ApbctCore).ajax(n)}function apbct_public_sendREST(e,t){var o=[];o.route=e,o.callback=t.callback||null,o.onErrorCallback=t.onErrorCallback||null,o.data=t.data||[],o.method=t.method||"POST",(new ApbctCore).rest(o)}_defineProperty(ApbctRest,"default_route",ctPublicFunctions._rest_url+"cleantalk-antispam/v1/");var apbctLocalStorage={get:function(t,e){void 0===e&&(e="value");t=localStorage.getItem(t);if(null!==t)try{var o=JSON.parse(t);return o.hasOwnProperty(e)?JSON.parse(o[e]):o}catch(e){return t}return!1},set:function(e,t){var o;!(2<arguments.length&&void 0!==arguments[2])||arguments[2]?(o={value:JSON.stringify(t),timestamp:Math.floor((new Date).getTime()/1e3)},localStorage.setItem(e,JSON.stringify(o))):localStorage.setItem(e,t)},isAlive:function(e,t){return void 0===t&&(t=86400),this.get(e,"timestamp")+t>Math.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t<localStorage.length;t++){var o=localStorage.key(t);-1===o.indexOf("ct_")&&-1===o.indexOf("apbct_")||(e[o.toString()]=apbctLocalStorage.get(o))}return e}},ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctCheckedEmails={};function apbct_attach_event_handler(e,t,o){"function"==typeof window.addEventListener?e.addEventListener(t,o):e.attachEvent(t,o)}function apbct_remove_event_handler(e,t,o){"function"==typeof window.removeEventListener?e.removeEventListener(t,o):e.detachEvent(t,o)}var ctFunctionFirstKey=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200),ctFunctionMouseMove=function(e){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter)&&ctMouseStopData()};function ctMouseStopData(){apbct_remove_event_handler(document,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(document,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(document,"keydown",ctFunctionFirstKey)}function checkEmail(e){var t=e.target.value;!t||t in ctCheckedEmails||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}))}function ctSetPixelImg(e){var t;ctSetCookie("apbct_pixel_url",e),+ctPublic.pixel__enabled&&!document.getElementById("apbct_pixel")&&((t=document.createElement("img")).setAttribute("alt","CleanTalk Pixel"),t.setAttribute("id","apbct_pixel"),t.setAttribute("style","display: none; left: 99999px;"),t.setAttribute("src",e),apbct("body").append(t))}function ctGetPixelUrl(){var e=apbctLocalStorage.get("apbct_pixel_url");if(!1!==e){if(!apbctLocalStorage.isAlive("apbct_pixel_url",10800))return void ctSetPixelImg(e);apbctLocalStorage.delete("apbct_pixel_url")}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}})}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0))}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0))}function ctPreloadLocalStorage(){ctPublic.data__to_local_storage&&Object.entries(ctPublic.data__to_local_storage).forEach(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];apbctLocalStorage.set(t,e)})}function apbct_ready(){ctPreloadLocalStorage();var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ct_date.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if(apbctLocalStorage.set("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),apbctLocalStorage.set("ct_fkp_timestamp","0"),apbctLocalStorage.set("ct_pointer_data","0"),apbctLocalStorage.set("ct_timezone",ct_date.getTimezoneOffset()/60*-1),apbctLocalStorage.set("ct_screen_info",apbctGetScreenInfo()),apbctLocalStorage.set("apbct_headless",navigator.webdriver),"native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var o=0;o<t.length;o++){var n=t[o].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(+ctPublic.pixel__enabled?ctGetPixelUrl():e.push(["apbct_pixel_url",ctPublic.pixel__url])),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),apbct("input[type = 'email'], #email").on("blur",checkEmail)),apbctLocalStorage.isSet("ct_checkjs")?e.push(["ct_checkjs",apbctLocalStorage.get("ct_checkjs")]):e.push(["ct_checkjs",0]),ctSetCookie(e),setTimeout(function(){ctNoCookieAttachHiddenFieldsToForms();for(var e=0;e<document.forms.length;e++){var t,o,n=document.forms[e];0==+ctPublic.data__visible_fields_required||"get"===n.method.toString().toLowerCase()||n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"===n.id||n.classList&&n.classList.contains("tinkoffPayRow")||n.classList&&n.classList.contains("give-form")||n.id&&"ult-forgot-password-form"===n.id||n.id&&-1!==n.id.toString().indexOf("calculatedfields")||n.id&&-1!==n.id.toString().indexOf("sac-form")||n.id&&-1!==n.id.toString().indexOf("cp_tslotsbooking_pform")||n.name&&-1!==n.name.toString().indexOf("cp_tslotsbooking_pform")||"https://epayment.epymtservice.com/epay.jhtml"===n.action.toString()||n.name&&-1!==n.name.toString().indexOf("tribe-bar-form")||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("id","apbct_visible_fields_"+e),t.setAttribute("name","apbct_visible_fields"),(o={})[0]=apbct_collect_visible_fields(n),t.value=btoa(JSON.stringify(o)),n.append(t),n.onsubmit_prev=n.onsubmit,n.ctFormIndex=e,n.onsubmit=function(e){var t;"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&((t={})[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t,e.target.ctFormIndex)),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3);var i=document.querySelectorAll("[data-original-string]");if(i.length)for(var r=0;r<i.length;++r)i[r].parentElement.href||i[r].parentElement.parentElement.href||i[r].addEventListener("click",ctFillDecodedEmailHandler)}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler),apbctAjaxEmailDecode(e,this)}function apbctAjaxEmailDecode(e,t){var o=e.target,n={event_javascript_data:getJavascriptClientData(),post_url:document.location.href,referrer:document.referrer},i=(void 0!==t.href&&0===t.href.indexOf("mailto:")&&e.preventDefault(),o.setAttribute("title",ctPublicFunctions.text__wait_for_decoding),o.style.cursor="progress",document.createElement("div")),r=(i.setAttribute("class","apbct-tooltip"),document.createElement("div")),a=(r.setAttribute("class","apbct-tooltip--text"),document.createElement("div")),r=(a.setAttribute("class","apbct-tooltip--arrow"),apbct(o).append(i),apbct(i).append(r),apbct(i).append(a),ctShowDecodeComment(o,ctPublicFunctions.text__wait_for_decoding),e.target.dataset.originalString);void 0!==t.href&&0===t.href.indexOf("mailto:")&&(r=t.dataset.originalString),n.encodedEmail=r,"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:n,method:"POST",callback:function(e){apbctEmailEncoderCallback(e,t,o)},onErrorCallback:function(e){o.addEventListener("click",ctFillDecodedEmailHandler),o.removeAttribute("style"),ctShowDecodeComment(o,"Error occurred: "+e)}}):(n.action="apbct_decode_email",apbct_public_sendAJAX(n,{notJson:!0,callback:function(e){apbctEmailEncoderCallback(e,t,o)},onErrorCallback:function(e){o.addEventListener("click",ctFillDecodedEmailHandler),o.removeAttribute("style"),ctShowDecodeComment(o,"Error occurred: "+e)}}))}function apbctEmailEncoderCallback(e,t,o){var n,i;e.success?void 0!==t.href&&0===t.href.indexOf("mailto:")?(n=t.href.replace("mailto:",""),i=t.innerHTML,t.innerHTML=i.replace(n,e.data.decoded_email),t.href="mailto:"+e.data.decoded_email,t.click()):setTimeout(function(){ctProcessDecodedDataResult(e.data,o)},3e3):(o.removeAttribute("style"),ctShowDecodeComment(o,e.data.comment))}function getJavascriptClientData(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t={},o=(t.apbct_headless=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless"),t.apbct_pixel_url=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),t.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),t.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),t.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),t.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),t.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),t.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),t.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone"),apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved")),n=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),i=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),r=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),a=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type");if(t.ct_mouse_moved=void 0!==o?o:r,t.ct_has_scrolled=void 0!==n?n:a,t.ct_cookies_type=void 0!==i?i:c,"object"===_typeof(e)&&e!==[])for(var l=0;l<e.length;++l)"object"===_typeof(e[l][1])?t[e[l][1][0]]=e[l][1][1]:t[e[l][0]]=e[l][1];else console.log("APBCT JS ERROR: Collecting data type mismatch");return t=removeDoubleJsonEncoding(t),JSON.stringify(t)}function removeDoubleJsonEncoding(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=removeDoubleJsonEncoding(e[t])),"string"==typeof e[t]&&null!==e[t].match(/^[\[{].*?[\]}]$/)&&"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),e.is_allowed&&ctFillDecodedEmail(t,e.decoded_email),e.show_comment&&ctShowDecodeComment(t,e.comment)}function ctFillDecodedEmail(e,t){apbct(e).html(apbct(e).html().replace(/.+?(<div class=["']apbct-tooltip["'].+?<\/div>)/,t+"$1"))}function ctShowDecodeComment(e,t){t&&(apbct(e.getElementsByClassName("apbct-tooltip")).fadeIn(300),apbct(e.getElementsByClassName("apbct-tooltip--text")).html(t),setTimeout(function(){apbct(e.getElementsByClassName("apbct-tooltip")).fadeOut(700)},5e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",i=0,r="",a=0,c=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===c.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(c.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),i++):(r+=" "+e.getAttribute("name"),a++))}),r=r.trim(),{visible_fields:n=n.trim(),visible_fields_count:i,invisible_fields:r,invisible_fields_count:a}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10<n)return;ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(o[n]))}else"none"===ctPublic.data__cookies_type?ctSetCookie("apbct_visible_fields",JSON.stringify(o[0])):ctSetCookie("apbct_visible_fields",JSON.stringify(o))}function apbct_js_keys__set_input_value(e,t,o,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var i=document.querySelectorAll("[name^=ct_checkjs]"),r=0;r<i.length;r++)i[r].value=e.js_key}function apbctGetScreenInfo(){return JSON.stringify({fullWidth:document.documentElement.scrollWidth,fullHeight:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),visibleWidth:document.documentElement.clientWidth,visibleHeight:document.documentElement.clientHeight})}function ctParseBlockMessage(e){void 0!==e.apbct&&(e=e.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:e.comment}})),cleantalkModal.loaded=e.comment,cleantalkModal.open(),1==+e.stop_script)&&window.stop()}function ctSetPixelUrlLocalstorage(e){ctSetCookie("apbct_pixel_url",e)}function ctNoCookieConstructHiddenField(){var e="",t=apbctLocalStorage.getCleanTalkData(),t=JSON.stringify(t);return t=btoa(t),(e=document.createElement("input")).setAttribute("id","ct_no_cookie_hidden_field"),e.setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",t),e.setAttribute("type","hidden"),e}function ctNoCookieGetForms(){var e=document.forms;return e||!1}function ctNoCookieAttachHiddenFieldsToForms(){if("none"===ctPublic.data__cookies_type){var e=ctNoCookieGetForms();if(e){var t=document.getElementsByName("ct_no_cookie_hidden_field");if(t)for(var o=0;o<t.length;o++)t[o].parentNode.removeChild(t[o]);for(var n=0;n<e.length;n++)null!==document.forms[n].getAttribute("method")&&"post"!==document.forms[n].getAttribute("method").toLowerCase()||document.forms[n].append(ctNoCookieConstructHiddenField())}}}apbct_attach_event_handler(document,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(document,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(document,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(document,"scroll",ctSetHasScrolled),"loading"!==document.readyState?apbct_ready():apbct_attach_event_handler(document,"DOMContentLoaded",apbct_ready),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,o){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){try{var n=JSON.parse(t.responseText)}catch(e){return void console.log(e.toString())}ctParseBlockMessage(n)}});var cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e,t="";for(e in this.styles)t+=e+":"+this.styles[e]+";";return t}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},i={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},r={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},a={styles:{overflow:"hidden"},toString:e},c=document.createElement("style"),a=(c.setAttribute("id","cleantalk-modal-styles"),c.innerHTML="body.cleantalk-modal-opened{"+a+"}",c.innerHTML+="#cleantalk-modal-overlay{"+t+"}",c.innerHTML+="#cleantalk-modal-close{"+n+"}",c.innerHTML+="#cleantalk-modal-close:before{"+i+"}",c.innerHTML+="#cleantalk-modal-close:after{"+r+"}",document.body.append(c),document.createElement("div")),t=(a.setAttribute("id","cleantalk-modal-overlay"),document.body.append(a),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),a.append(t),document.createElement("div")),i=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?i.innerHTML=this.loaded:(i.innerHTML="Loading...",this.load("get_options_template")),i.setAttribute("id","cleantalk-modal-content"),t.append(i),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}},buttons_to_handle=(document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),[]);function apbct_gdpr_handle_buttons(){try{buttons_to_handle!==[]&&buttons_to_handle.forEach(function(e){var t='[id="apbct_gdpr_'+e.index+'"]',t=jQuery(t);jQuery(t).prop("checked")?(e.button.disabled=!1,jQuery(e.button).prop("title",e.old_notice)):(e.button.disabled=!0,jQuery(e.button).prop("title",gdpr_notice_for_button))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not handle form buttons "+e)}}function ct_protect_external(){for(var e=0;e<document.forms.length;e++)if(void 0===document.forms[e].cleantalk_hidden_action&&void 0===document.forms[e].cleantalk_hidden_method){var t,o=document.forms[e];if(o.parentElement&&0<o.parentElement.classList.length&&-1!==o.parentElement.classList[0].indexOf("mewtwo"))return;"string"==typeof o.action&&(isIntegratedForm(o)?apbctProcessExternalForm(o,e,document):-1===o.action.indexOf("http://")&&-1===o.action.indexOf("https://")||o.action.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((t=document.createElement("input")).name="cleantalk_hidden_action",t.value=o.action,t.type="hidden",o.appendChild(t),(t=document.createElement("input")).name="cleantalk_hidden_method",t.value=o.method,t.type="hidden",o.method="POST",o.appendChild(t),o.action=document.location))}var n=document.getElementsByTagName("iframe");if(0<n.length)for(var i=0;i<n.length;i++)if(null!=n[i].contentDocument){var r=n[i].contentDocument.forms;if(0===r.length)return;for(var a=0;a<r.length;a++)apbctProcessExternalForm(r[a],a,n[i].contentDocument)}}function apbctProcessExternalForm(e,n,i){var t=document.createElement("i"),t=(t.className="cleantalk_placeholder",t.style="display: none",e.parentElement.insertBefore(t,e),e.previousSibling),o=e.outerHTML,r=e,e=(e.parentElement.removeChild(e),document.createElement("div")),o=(e.innerHTML=o,t.after(e.firstElementChild),document.createElement("input")),a=(o.name="action",o.value="cleantalk_force_ajax_check",o.type="hidden",i.forms[n]),c=(a.appendChild(o),a.apbctPrev=t,a.apbctFormOriginal=r,!1);void 0!==a.classList&&["newsletterform","ml-block-form"].forEach(function(e){a.classList.contains(e)&&(c=e)}),c?void 0!==(e=jQuery("form."+c).find('button[type="submit"]'))&&e.click(function(e){e.preventDefault(),sendAjaxCheckingFormData(e.currentTarget)}):i.forms[n].onsubmit=function(e){var t,o;e.preventDefault(),-1!==i.forms[n].id.indexOf("mauticform")&&0<(t=jQuery(i.forms[n]).find('input[id*="checkbox_rgpd"]')).length&&!0===t.prop("checked")&&0<(o=jQuery(".cleantalk_placeholder")).length&&o[0].setAttribute("mautic_hidden_gdpr_id",t.prop("id")),jQuery(e.currentTarget).prev(),jQuery(e.currentTarget).clone();sendAjaxCheckingFormData(e.currentTarget)}}function apbct_replace_inputs_values_from_other_form(e,t){var e=jQuery(e).find("button, input, textarea, select"),o=jQuery(t).find("button, input, textarea, select");e.each(function(e,n){var i=jQuery(n);o.each(function(e,t){var o=jQuery(t);n.outerHTML===t.outerHTML&&o.val(i.val())})})}function isIntegratedForm(e){var t=e.action,o=e.id;return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("webto.salesforce.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com")||-1!==t.indexOf("mautic")||-1!==o.indexOf("mauticform_"))}function sendAjaxCheckingFormData(d,e,t){var o={},n=(o[0]=apbct_collect_visible_fields(d),apbct_visible_fields_set_cookie(o),{}),o=d.elements;(o=Array.prototype.slice.call(o)).forEach(function(e,t){""===e.name?n["input_"+t]=e.value:n[e.name]=e.value}),apbct_public_sendAJAX(n,{async:!1,callback:function(e,t,o,n){if(void 0===e.apbct||!+e.apbct.blocked){var i=jQuery(d).detach(),r=d.apbctPrev,a=d.apbctFormOriginal,c=!1,l=(apbct_replace_inputs_values_from_other_form(i,a),-1!==a.id.indexOf("mautic")&&(c=!0),document.getElementsByClassName("cleantalk_placeholder"));if(l)for(var s=0;s<l.length;s++){var u=l[s].getAttribute("mautic_hidden_gdpr_id");void 0!==u&&void 0!==(u=jQuery(a).find("#"+u))&&u.prop("checked",!0)}r.after(a),jQuery(a).find('input[name="apbct_visible_fields"]').remove(),jQuery(a).find('input[value="cleantalk_force_ajax_check"]').remove();i=jQuery(a).find("button[type=submit]");if(0!==i.length)return i[0].click(),void(c&&setTimeout(function(){ct_protect_external()},1500));if(0!==(i=jQuery(a).find("input[type=submit]")).length)return void i[0].click();if(0!==(i=jQuery(a).find('button[data-element="submit"]')).length)return void i[0].click();0!==(i=jQuery(a).find('input[type="image"][name="submit"]')).length&&i[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function ct_check_internal(t){var e,o={},n=t.elements;for(e in n)"submit"!=n[e].type&&null!=n[e].value&&""!=n[e].value&&(o[n[e].name]=t.elements[e].value);o.action="ct_check_internal",apbct_public_sendAJAX(o,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.submit()}})}function ct_check_internal__is_exclude_form(t){return["wp-login.php","wp-comments-post.php"].some(function(e){return null!==t.match(new RegExp(ctPublic.blog_home+".*"+e))})}document.addEventListener("DOMContentLoaded",function(){if("undefined"!=typeof ctPublicGDPR&&ctPublicGDPR.gdpr_forms.length){var i=ctPublicGDPR.gdpr_title;if("undefined"!=typeof jQuery)try{ctPublicGDPR.gdpr_forms.forEach(function(e,t){var o=jQuery("#"+e+", ."+e),e=(o.is("form")||(o.find("form")[0]?o=o.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+e)?o=jQuery(".wpcf7[role=form]").children("form"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+e)?o=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+e)&&(o=jQuery(".wpforms-form"))),!1),n=o.find('input[type|="submit"],button[type|="submit"]');n.length&&(!1!==(e=n[0])&&(e.disabled=!0,n=jQuery(e).prop("title")?jQuery(e).prop("title"):"",buttons_to_handle.push({index:t,button:e,old_notice:n}),jQuery(e).prop("title",i)),!o.is("form")&&"form"!==o.attr("role")||o.append('<input id="apbct_gdpr_'+t+'" type="checkbox" required="required" style=" margin-right: 10px;" onchange="apbct_gdpr_handle_buttons()">').append('<label style="display: inline;" for="apbct_gdpr_'+t+'">'+ctPublicGDPR.gdpr_text+"</label>"))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not add GDPR notice"+e)}}}),window.onload=function(){+ctPublic.settings__forms__check_external&&"undefined"!=typeof jQuery&&setTimeout(function(){ct_protect_external()},1500)},document.addEventListener("DOMContentLoaded",function(){var e,t="";if(+ctPublic.settings__forms__check_internal)for(var o=0;o<document.forms.length;o++)"string"!=typeof document.forms[o].action||null===(t=(e=document.forms[o]).action).indexOf("https?://")||null===t.match(ctPublic.blog_home+".*?.php")||ct_check_internal__is_exclude_form(t)||(e.click,"undefined"!=typeof jQuery&&(jQuery(e).off("**"),jQuery(e).off(),jQuery(e).on("submit",function(e){return ct_check_internal(e.target),!1})))});
js/apbct-public-bundle.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"apbct-public-bundle.min.js","sources":["apbct-public-bundle.js"],"sourcesContent":["class ApbctCore{\n\n ajax_parameters = {};\n rest_parameters = {};\n\n #selector = null;\n elements = [];\n\n // Event properties\n #eventCallback;\n #eventSelector;\n #event;\n\n /**\n * Default constructor\n */\n constructor(selector){\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param selector\n * @returns {*}\n */\n select(selector) {\n\n if(selector instanceof HTMLCollection){\n this.#selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n }else if( typeof selector === 'object' ){\n this.#selector = null;\n this.elements = [];\n this.elements[0] = selector;\n }else if( typeof selector === 'string' ){\n this.#selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n }else{\n this.#deselect();\n }\n\n return this;\n }\n\n #addElement(elemToAdd){\n if( typeof elemToAdd === 'object' ){\n this.elements.push(elemToAdd);\n }else if( typeof elemToAdd === 'string' ){\n this.#selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n }else{\n this.#deselect();\n }\n }\n\n #push(elem){\n this.elements.push(elem);\n }\n\n #reduce(){\n this.elements = this.elements.slice(0,-1);\n }\n\n #deselect(){\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param style\n * @param getRaw\n *\n * @returns {boolean|*}\n */\n css(style, getRaw){\n\n getRaw = getRaw | false;\n\n // Set style\n if(typeof style === \"object\"){\n\n const stringToCamelCase = str =>\n str.replace(/([-_][a-z])/g, group =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', '')\n );\n\n // Apply multiple styles\n for(let style_name in style){\n let DOM_style_name = stringToCamelCase(style_name);\n\n // Apply to multiple elements (currently selected)\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].style[DOM_style_name] = style[style_name];\n }\n }\n\n return this;\n }\n\n // Get style of first currently selected element\n if(typeof style === 'string'){\n\n let computedStyle = getComputedStyle(this.elements[0])[style];\n\n // Process\n if( typeof computedStyle !== 'undefined' && ! getRaw){\n computedStyle = computedStyle.replace(/(\\d)(em|pt|%|px){1,2}$/, '$1'); // Cut of units\n computedStyle = Number(computedStyle) == computedStyle ? Number(computedStyle) : computedStyle; // Cast to INT\n return computedStyle;\n }\n\n // Return unprocessed\n return computedStyle;\n }\n }\n\n hide(){\n this.prop('prev-display', this.css('display'));\n this.css({'display': 'none'});\n }\n\n show(){\n this.css({'display': this.prop('prev-display')});\n }\n\n addClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.add(className);\n }\n }\n\n removeClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.remove(className);\n }\n }\n\n toggleClass(className){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.toggle(className);\n }\n }\n\n /**\n * Wrapper for apbctAJAX class\n *\n * @param ajax_parameters\n * @returns {ApbctAjax}\n */\n ajax(ajax_parameters){\n this.ajax_parameters = ajax_parameters;\n return new ApbctAjax(ajax_parameters);\n }\n\n /**\n * Wrapper for apbctREST class\n *\n * @param rest_parameters\n * @returns {ApbctRest}\n */\n rest(rest_parameters){\n this.rest_parameters = rest_parameters;\n return new ApbctRest(rest_parameters);\n }\n\n /************** EVENTS **************/\n\n /**\n *\n * Why the mess with arguments?\n *\n * Because we need to support the following function signatures:\n * on('click', function(){ alert('some'); });\n * on('click', 'inner_selector', function(){ alert('some'); });\n *\n * @param args\n */\n on(...args){\n\n this.#event = args[0];\n this.#eventCallback = args[2] || args[1];\n this.#eventSelector = typeof args[1] === \"string\" ? args[1] : null;\n\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].addEventListener(\n this.#event,\n this.#eventSelector !== null\n ? this.#onChecker.bind(this)\n : this.#eventCallback\n );\n }\n }\n\n /**\n * Check if a selector of an event matches current target\n *\n * @param event\n * @returns {*}\n */\n #onChecker(event){\n if(event.target === document.querySelector(this.#eventSelector)){\n event.stopPropagation();\n return this.#eventCallback(event);\n }\n }\n\n ready(callback){\n document.addEventListener('DOMContentLoaded', callback);\n }\n\n change(callback){\n this.on('change', callback);\n }\n\n /************** ATTRIBUTES **************/\n\n /**\n * Get an attribute or property of an element\n *\n * @param attrName\n * @returns {*|*[]}\n */\n attr(attrName){\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n\n // Use property instead of attribute if possible\n if(typeof this.elements[i][attrName] !== undefined){\n outputValue.push(this.elements[i][attrName]);\n }else{\n outputValue.push(this.elements[i].getAttribute(attrName));\n }\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n\n prop(propName, value){\n\n // Setting values\n if(typeof value !== \"undefined\"){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i][propName] = value;\n }\n\n return this;\n\n // Getting values\n }else{\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n outputValue.push(this.elements[i][propName]);\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n }\n\n /**\n * Set or get inner HTML\n *\n * @param value\n * @returns {*|*[]}\n */\n html(value){\n return typeof value !== 'undefined'\n ? this.prop('innerHTML', value)\n : this.prop('innerHTML');\n }\n\n /**\n * Set or get value of input tags\n *\n * @param value\n * @returns {*|*[]|undefined}\n */\n val(value){\n return typeof value !== 'undefined'\n ? this.prop('value', value)\n : this.prop('value');\n }\n\n data(name, value){\n return typeof value !== 'undefined'\n ? this.prop('apbct-data', name, value)\n : this.prop('apbct-data');\n }\n\n /************** END OF ATTRIBUTES **************/\n\n /************** FILTERS **************/\n\n /**\n * Check if the current elements are corresponding to filter\n *\n * @param filter\n * @returns {boolean}\n */\n is(filter){\n\n let outputValue = false;\n\n for(let elem of this.elements){\n outputValue ||= this.#isElem(elem, filter);\n }\n\n return outputValue;\n }\n\n #isElem(elemToCheck, filter){\n\n let is = false;\n let isRegisteredTagName = function(name){\n let newlyCreatedElement = document.createElement(name).constructor;\n return ! Boolean( ~[HTMLElement, HTMLUnknownElement].indexOf(newlyCreatedElement) );\n };\n\n // Check for filter function\n if(typeof filter === 'function') {\n is ||= filter.call(this, elemToCheck);\n }\n\n // Check for filter function\n if(typeof filter === 'string') {\n\n // Filter is tag name\n if( filter.match(/^[a-z]/) && isRegisteredTagName(filter) ){\n is ||= elemToCheck.tagName.toLowerCase() === filter.toLowerCase();\n\n // Filter is property\n }else if( filter.match(/^[a-z]/) ){\n is ||= Boolean(elemToCheck[filter]);\n\n // Filter is CSS selector\n }else {\n is ||= this.#selector !== null\n ? document.querySelector(this.#selector + filter) !== null // If possible\n : this.#isWithoutSelector(elemToCheck, filter); // Search through all elems with such selector\n }\n }\n\n return is;\n }\n\n #isWithoutSelector(elemToCheck, filter){\n\n let elems = document.querySelectorAll(filter);\n let outputValue = false;\n\n for(let elem of elems){\n outputValue ||= elemToCheck === elem;\n }\n\n return outputValue;\n }\n\n filter(filter){\n\n this.#selector = null;\n\n for( let i = this.elements.length - 1; i >= 0; i-- ){\n if( ! this.#isElem(this.elements[i], filter) ){\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /************** NODES **************/\n\n parent(filter){\n\n this.select(this.elements[0].parentElement);\n\n if( typeof filter !== 'undefined' && ! this.is(filter) ){\n this.#deselect();\n }\n\n return this;\n }\n\n parents(filter){\n\n this.select(this.elements[0]);\n\n for ( ; this.elements[ this.elements.length - 1].parentElement !== null ; ) {\n this.#push(this.elements[ this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0,1); // Deleting initial element from the set\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n children(filter){\n\n this.select(this.elements[0].children);\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n siblings(filter){\n\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /************** DOM MANIPULATIONS **************/\n remove(){\n for(let elem of this.elements){\n elem.remove();\n }\n }\n\n after(content){\n for(let elem of this.elements){\n elem.after(content);\n }\n }\n\n append(content){\n for(let elem of this.elements){\n elem.append(content);\n }\n }\n\n /** ANIMATION **/\n fadeIn(time) {\n for(let elem of this.elements){\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n fadeOut(time) {\n for(let elem of this.elements){\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * Enter point to ApbctCore class\n *\n * @param params\n * @returns {*}\n */\nfunction apbct(params){\n return new ApbctCore()\n .select(params);\n}\nclass ApbctXhr{\n\n #xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n #methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n #body = null;\n #http_code = 0;\n #status_text = '';\n\n constructor(parameters){\n\n console.log('%cXHR%c started', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n\n // Set class properties\n for( let key in parameters ){\n if( typeof this[key] !== 'undefined' ){\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.#prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if( ! this.url ){\n console.log('%cXHR%c not URL provided', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;')\n return false;\n }\n\n // Configure the request\n this.#xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.#xhr.responseType = this.responseType;\n this.#xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.#xhr.onreadystatechange = function(){\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.#xhr.onload = function(){\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.#xhr.onprogress = function(event){\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.#xhr.onerror = function(){\n this.onError();\n }.bind(this);\n\n this.#xhr.ontimeout = function(){\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.#xhr.send(this.#body);\n }\n\n #prepare(){\n\n // Disable button\n if(this.button){\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n #complete(){\n\n this.#http_code = this.#xhr.status;\n this.#status_text = this.#xhr.statusText;\n\n // Disable button\n if(this.button){\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n onReadyStateChange(){\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function'){\n this.on_ready_state_change();\n }\n }\n\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function'){\n this.on_progress();\n }\n }\n\n onError(){\n\n console.log('error');\n\n this.#complete();\n this.#error(\n this.#http_code,\n this.#status_text\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback(this.#status_text);\n }\n }\n\n onTimeout(){\n this.#complete();\n this.#error(\n 0,\n 'timeout'\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback('Timeout');\n }\n }\n\n onLoad(){\n\n this.#complete();\n\n if (this.responseType === 'json' ){\n if(this.#xhr.response === null){\n this.#error(this.#http_code, this.#status_text, 'No response');\n return false;\n }else if( typeof this.#xhr.response.error !== 'undefined') {\n this.#error(this.#http_code, this.#status_text, this.#xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.#xhr.response, this.data);\n }\n }\n\n #error(http_code, status_text, additional_msg){\n\n let error_string = '';\n\n if( status_text === 'timeout' ){\n error_string += 'Server response timeout'\n\n }else if( http_code === 200 ){\n\n if( status_text === 'parsererror' ){\n error_string += 'Unexpected response from server. See console for details.';\n }else {\n error_string += 'Unexpected error. Status: ' + status_text + '.';\n if( typeof additional_msg !== 'undefined' )\n error_string += ' Additional error info: ' + additional_msg;\n }\n\n }else if(http_code === 500){\n error_string += 'Internal server error.';\n\n }else {\n error_string += 'Unexpected response code:' + http_code;\n }\n\n this.errorOutput( error_string );\n }\n\n errorOutput(error_msg){\n console.log( '%c ctXHR error: %c' + error_msg, 'color: red;', 'color: grey;' );\n }\n\n setHeaders(){\n // Set headers if passed\n for( let header_name in this.headers ){\n if( typeof this.headers[header_name] !== 'undefined' ){\n this.#xhr.setRequestHeader(header_name, this.headers[header_name]);\n }\n }\n }\n\n convertData()\n {\n // GET, HEAD request-type\n if( ~this.#methods_to_convert_data_to_URL.indexOf( this.method ) ){\n return this.convertDataToURL();\n\n // POST request-type\n }else{\n return this.convertDataToBody()\n }\n }\n\n convertDataToURL(){\n let params_appendix = new URLSearchParams(this.data).toString();\n let params_prefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += params_prefix + params_appendix;\n\n return this.url;\n }\n\n /**\n *\n * @returns {null}\n */\n convertDataToBody()\n {\n this.#body = new FormData();\n\n for (let dataKey in this.data) {\n this.#body.append(\n dataKey,\n typeof this.data[dataKey] === 'object'\n ? JSON.stringify(this.data[dataKey])\n : this.data[dataKey]\n );\n }\n\n return this.#body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\n deleteDoubleJSONEncoding(object){\n\n if( typeof object === 'object'){\n\n for (let objectKey in object) {\n\n // Recursion\n if( typeof object[objectKey] === 'object'){\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if(\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ){\n let parsedValue = JSON.parse(object[objectKey]);\n if( typeof parsedValue === 'object' ){\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n }\n}\nclass ApbctAjax extends ApbctXhr{\n\n constructor(...args) {\n super(args[0]);\n }\n}\nclass ApbctRest extends ApbctXhr{\n\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n constructor(...args) {\n args = args[0];\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n \"X-WP-Nonce\": ctPublicFunctions._rest_nonce\n };\n super(args);\n }\n}\n\nfunction ctSetCookie( cookies, value, expires ){\n\n if( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){\n var skip_alt = cookies === 'ct_pointer_data';\n cookies = [ [ cookies, value, expires ] ];\n }\n\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n cookies.forEach( function (item, i, arr\t) {\n apbctLocalStorage.set(item[0], encodeURIComponent(item[1]))\n });\n ctNoCookieAttachHiddenFieldsToForms()\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n cookies.forEach( function (item, i, arr\t) {\n var expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix + item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n });\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' && ! skip_alt ){\n\n if (typeof (getJavascriptClientData) === \"function\"){\n //reprocess already gained cookies data\n cookies = getJavascriptClientData(cookies);\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded')\n }\n\n try {\n JSON.parse(cookies)\n } catch (e){\n console.log('APBCT ERROR: JSON parse error:' + e)\n return\n }\n\n // Using REST API handler\n if( ctPublicFunctions.data__ajax_type === 'rest' ){\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: { cookies: cookies }\n }\n );\n\n // Using AJAX request and handler\n } else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n }\n );\n }\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n return;\n\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + \"=\\\"\\\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax\" + ctSecure;\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' ){\n // @ToDo implement this logic\n }\n}\n\nfunction apbct_public_sendAJAX(data, params, obj){\n\n // Default params\n let _params = [];\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"callback_context\"] = params.callback_context || null;\n _params[\"callback_params\"] = params.callback_params || null;\n _params[\"async\"] = params.async || true;\n _params[\"notJson\"] = params.notJson || null;\n _params[\"timeout\"] = params.timeout || 15000;\n _params[\"obj\"] = obj || null;\n _params[\"button\"] = params.button || null;\n _params[\"progressbar\"] = params.progressbar || null;\n _params[\"silent\"] = params.silent || null;\n _params[\"no_nonce\"] = params.no_nonce || null;\n _params[\"data\"] = data;\n _params[\"url\"] = ctPublicFunctions._ajax_url;\n\n if(typeof (data) === 'string') {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"] = _params[\"data\"] + '&_ajax_nonce=' + ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"] = _params[\"data\"] + '&no_cache=' + Math.random()\n } else {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"]._ajax_nonce = ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n let _params = [];\n _params[\"route\"] = route;\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"data\"] = params.data || [];\n _params[\"method\"] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\nlet apbctLocalStorage = {\n get : function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n return json.hasOwnProperty(property) ? JSON.parse(json[property]) : json;\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set : function(key, value, is_json = true) {\n if (is_json){\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive : function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet : function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete : function (key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData : function () {\n let data = {}\n for(let i=0; i<localStorage.length; i++) {\n let key = localStorage.key(i);\n if (key.indexOf('ct_') !==-1 || key.indexOf('apbct_') !==-1){\n data[key.toString()] = apbctLocalStorage.get(key)\n }\n }\n return data\n },\n\n}\nvar ct_date = new Date(),\n\tctTimeMs = new Date().getTime(),\n\tctMouseEventTimerFlag = true, //Reading interval flag\n\tctMouseData = [],\n\tctMouseDataCounter = 0,\n\tctCheckedEmails = {};\n\nfunction apbct_attach_event_handler(elem, event, callback){\n\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\telse elem.attachEvent(event, callback);\n}\n\nfunction apbct_remove_event_handler(elem, event, callback){\n\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\telse elem.detachEvent(event, callback);\n}\n\n//Writing first key press timestamp\nvar ctFunctionFirstKey = function output(event){\n\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\tctKeyStopStopListening();\n};\n\n//Reading interval\nvar ctMouseReadInterval = setInterval(function(){\n\tctMouseEventTimerFlag = true;\n}, 150);\n\n//Writting interval\nvar ctMouseWriteDataInterval = setInterval(function(){\n\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n}, 1200);\n\n//Logging mouse position each 150 ms\nvar ctFunctionMouseMove = function output(event){\n\tctSetMouseMoved();\n\tif(ctMouseEventTimerFlag === true){\n\n\t\tctMouseData.push([\n\t\t\tMath.round(event.clientY),\n\t\t\tMath.round(event.clientX),\n\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t]);\n\n\t\tctMouseDataCounter++;\n\t\tctMouseEventTimerFlag = false;\n\t\tif(ctMouseDataCounter >= 50){\n\t\t\tctMouseStopData();\n\t\t}\n\t}\n};\n\n//Stop mouse observing function\nfunction ctMouseStopData(){\n\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\tclearInterval(ctMouseReadInterval);\n\tclearInterval(ctMouseWriteDataInterval);\n}\n\n//Stop key listening function\nfunction ctKeyStopStopListening(){\n\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\n}\n\nfunction checkEmail(e) {\n\tvar current_email = e.target.value;\n\tif (current_email && !(current_email in ctCheckedEmails)) {\n\t\t// Using REST API handler\n\t\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\t\tapbct_public_sendREST(\n\t\t\t\t'check_email_before_post',\n\t\t\t\t{\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {'email' : current_email},\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t\t// Using AJAX request and handler\n\t\t} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n\t\t\tapbct_public_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\temail : current_email,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction ctSetPixelImg(pixelUrl) {\n\tctSetCookie('apbct_pixel_url', pixelUrl);\n\tif( +ctPublic.pixel__enabled ){\n\t\tif( ! document.getElementById('apbct_pixel') ) {\n\t\t\tlet insertedImg = document.createElement('img');\n\t\t\tinsertedImg.setAttribute('alt', 'CleanTalk Pixel');\n\t\t\tinsertedImg.setAttribute('id', 'apbct_pixel');\n\t\t\tinsertedImg.setAttribute('style', 'display: none; left: 99999px;');\n\t\t\tinsertedImg.setAttribute('src', pixelUrl);\n\t\t\tapbct('body').append(insertedImg);\n\t\t}\n\t}\n}\n\nfunction ctGetPixelUrl() {\n\t// Check if pixel is already in localstorage and is not outdated\n\tlet local_storage_pixel_url = apbctLocalStorage.get('apbct_pixel_url');\n\tif ( local_storage_pixel_url !== false ) {\n\t\tif ( apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n\t\t\tapbctLocalStorage.delete('apbct_pixel_url')\n\t\t} else {\n\t\t\t//if so - load pixel from localstorage and draw it skipping AJAX\n\t\t\tctSetPixelImg(local_storage_pixel_url);\n\t\t\treturn;\n\t\t}\n\t}\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_get_pixel_url',\n\t\t\t{\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t\t// Using AJAX request and handler\n\t}else{\n\t\tapbct_public_sendAJAX(\n\t\t\t{\n\t\t\t\taction: 'apbct_get_pixel_url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction ctSetHasScrolled() {\n\tif( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n\t\tctSetCookie(\"ct_has_scrolled\", 'true');\n\t\tapbctLocalStorage.set('ct_has_scrolled', true);\n\t}\n}\n\nfunction ctSetMouseMoved() {\n\tif( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n\t\tctSetCookie(\"ct_mouse_moved\", 'true');\n\t\tapbctLocalStorage.set('ct_mouse_moved', true);\n\t}\n}\n\nfunction ctPreloadLocalStorage(){\n\tif (ctPublic.data__to_local_storage){\n\t\tlet data = Object.entries(ctPublic.data__to_local_storage)\n\t\tdata.forEach(([key, value]) => {\n\t\t\tapbctLocalStorage.set(key,value)\n\t\t});\n\t}\n}\n\napbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\napbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\napbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\napbct_attach_event_handler(window, \"scroll\", ctSetHasScrolled);\n\n// Ready function\nfunction apbct_ready(){\n\n\tctPreloadLocalStorage()\n\n\tlet cookiesType = apbctLocalStorage.get('ct_cookies_type');\n\tif ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n\t\tapbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n\t\tapbctLocalStorage.delete('ct_mouse_moved');\n\t\tapbctLocalStorage.delete('ct_has_scrolled');\n\t}\n\n\t// Collect scrolling info\n\tvar initCookies = [\n\t\t[\"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000)],\n\t\t[\"ct_fkp_timestamp\", \"0\"],\n\t\t[\"ct_pointer_data\", \"0\"],\n\t\t[\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t[\"ct_screen_info\", apbctGetScreenInfo()],\n\t\t[\"apbct_headless\", navigator.webdriver],\n\t];\n\n\tapbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n\tapbctLocalStorage.set('ct_fkp_timestamp', \"0\");\n\tapbctLocalStorage.set('ct_pointer_data', \"0\");\n\tapbctLocalStorage.set('ct_timezone', ct_date.getTimezoneOffset()/60*(-1) );\n\tapbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n\tapbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n\tif( ctPublic.data__cookies_type !== 'native' ) {\n\t\tinitCookies.push(['apbct_visible_fields', '0']);\n\t} else {\n\t\t// Delete all visible fields cookies on load the page\n\t\tvar cookiesArray = document.cookie.split(\";\");\n\t\tif( cookiesArray.length !== 0 ) {\n\t\t\tfor ( var i = 0; i < cookiesArray.length; i++ ) {\n\t\t\t\tvar currentCookie = cookiesArray[i].trim();\n\t\t\t\tvar cookieName = currentCookie.split(\"=\")[0];\n\t\t\t\tif( cookieName.indexOf(\"apbct_visible_fields_\") === 0 ) {\n\t\t\t\t\tctDeleteCookie(cookieName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif( +ctPublic.pixel__setting ){\n\t\tif( +ctPublic.pixel__enabled ){\n\t\t\tctGetPixelUrl()\n\t\t} else {\n\t\t\tinitCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n\t\t}\n\t}\n\n\tif ( +ctPublic.data__email_check_before_post) {\n\t\tinitCookies.push(['ct_checked_emails', '0']);\n\t\tapbct(\"input[type = 'email'], #email\").on('blur', checkEmail);\n\t}\n\n\tif (apbctLocalStorage.isSet('ct_checkjs')) {\n\t\tinitCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n\t} else {\n\t\tinitCookies.push(['ct_checkjs', 0]);\n\t}\n\n\tctSetCookie(initCookies);\n\n\tsetTimeout(function(){\n\n\t\tctNoCookieAttachHiddenFieldsToForms()\n\n\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\tvar form = document.forms[i];\n\n\t\t\t//Exclusion for forms\n\t\t\tif (\n\t\t\t\t+ctPublic.data__visible_fields_required === 0 ||\n\t\t\t\tform.method.toString().toLowerCase() === 'get' ||\n\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t(form.id && form.id === 'caspioform') || //Caspio Form\n\t\t\t\t(form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t(form.classList && form.classList.contains('give-form')) || // GiveWP\n\t\t\t\t(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password\n\t\t\t\t(form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n\t\t\t\t(form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n\t\t\t\t(form.id && form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\t(form.name && form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\tform.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n\t\t\t\t(form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) // The Events Calendar\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar hiddenInput = document.createElement( 'input' );\n\t\t\thiddenInput.setAttribute( 'type', 'hidden' );\n\t\t\thiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n\t\t\thiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n\t\t\tvar visibleFieldsToInput = {};\n\t\t\tvisibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n\t\t\thiddenInput.value = JSON.stringify(visibleFieldsToInput);\n\t\t\tform.append( hiddenInput );\n\n\t\t\tform.onsubmit_prev = form.onsubmit;\n\n\t\t\tform.ctFormIndex = i;\n\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\tif ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );\n\t\t\t\t}\n\n\t\t\t\t// Call previous submit action\n\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t}, 1000);\n\n\t// Listen clicks on encoded emails\n\tlet decodedEmailNodes = document.querySelectorAll(\"[data-original-string]\");\n\tif (decodedEmailNodes.length) {\n\t\tfor (let i = 0; i < decodedEmailNodes.length; ++i) {\n\t\t\tif (\n\t\t\t\tdecodedEmailNodes[i].parentElement.href ||\n\t\t\t\tdecodedEmailNodes[i].parentElement.parentElement.href\n\t\t\t) {\n\t\t\t\t// Skip listening click on hyperlinks\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdecodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n\t\t}\n\t}\n}\napbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\nfunction ctFillDecodedEmailHandler(event) {\n\tthis.removeEventListener('click', ctFillDecodedEmailHandler);\n\tapbctAjaxEmailDecode(event, this);\n}\n\nfunction apbctAjaxEmailDecode(event, baseElement){\n\tconst element = event.target;\n\tconst javascriptClientData = getJavascriptClientData();\n\tlet data = {\n\t\tevent_javascript_data: javascriptClientData,\n\t\tpost_url: document.location.href,\n\t\treferrer: document.referrer,\n\t};\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tevent.preventDefault();\n\t}\n\n\telement.setAttribute('title', ctPublicFunctions.text__wait_for_decoding);\n\telement.style.cursor = 'progress';\n\n\t// Adding a tooltip\n\tlet apbctTooltip = document.createElement('div');\n\tapbctTooltip.setAttribute('class', 'apbct-tooltip');\n\tlet apbctTooltipText = document.createElement('div');\n\tapbctTooltipText.setAttribute('class', 'apbct-tooltip--text');\n\tlet apbctTooltipArrow = document.createElement('div');\n\tapbctTooltipArrow.setAttribute('class', 'apbct-tooltip--arrow');\n\tapbct(element).append(apbctTooltip);\n\tapbct(apbctTooltip).append(apbctTooltipText);\n\tapbct(apbctTooltip).append(apbctTooltipArrow);\n\tctShowDecodeComment(element, ctPublicFunctions.text__wait_for_decoding);\n\n\tlet encodedEmail = event.target.dataset.originalString;\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tencodedEmail = baseElement.dataset.originalString;\n\t}\n\n\tdata.encodedEmail = encodedEmail;\n\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_decode_email',\n\t\t\t{\n\t\t\t\tdata: data,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\t\t\t\t\telement.style.cursor = 'default';\n\t\t\t\t\t\t\telement.getElementsByClassName('apbct-tooltip')[0].style.display='none';\n\t\t\t\t\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\t\t\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\t\t\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\t\t\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\t\t\t\t\tbaseElement.click();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t\tctProcessDecodedDataResult(result.data, event.target);\n\t\t\t\t\t\t\t}, 3000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tapbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t\t\t\t\t}, 4000);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\n\t// Using AJAX request and handler\n\t}else{\n\t\tdata.action = 'apbct_decode_email';\n\t\tapbct_public_sendAJAX(\n\t\t\tdata,\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\t\t\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\t\t\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\t\t\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\t\t\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\t\t\t\t\tbaseElement.click();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t\tctProcessDecodedDataResult(result.data, event.target);\n\t\t\t\t\t\t\t}, 3000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tapbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t\t\t\t\t}, 4000);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction getJavascriptClientData(common_cookies = []) {\n\tlet resultDataJson = {};\n\n\tresultDataJson.apbct_headless = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\tresultDataJson.apbct_pixel_url = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n\tresultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n\tresultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n\tresultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n\tresultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n\tresultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n\tresultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n\tresultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n\t// collecting data from localstorage\n\tconst ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\t// collecting data from cookies\n\tconst ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\tresultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ? ctMouseMovedLocalStorage : ctMouseMovedCookie;\n\tresultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ? ctHasScrolledLocalStorage : ctHasScrolledCookie;\n\tresultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ? ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n\n\tif (\n\t\ttypeof (common_cookies) === \"object\"\n\t\t&& common_cookies !== []\n\t){\n\t\tfor (let i = 0; i < common_cookies.length; ++i){\n\t\t\tif ( typeof (common_cookies[i][1]) === \"object\" ){\n\t\t\t\t//this is for handle SFW cookies\n\t\t\t\tresultDataJson[common_cookies[i][1][0]] = common_cookies[i][1][1]\n\t\t\t} else {\n\t\t\t\tresultDataJson[common_cookies[i][0]] = common_cookies[i][1]\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconsole.log('APBCT JS ERROR: Collecting data type mismatch')\n\t}\n\n\t// Parse JSON properties to prevent double JSON encoding\n\tresultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\treturn JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\nfunction removeDoubleJsonEncoding(object){\n\n\tif( typeof object === 'object'){\n\n\t\tfor (let objectKey in object) {\n\n\t\t\t// Recursion\n\t\t\tif( typeof object[objectKey] === 'object'){\n\t\t\t\tobject[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n\t\t\t}\n\n\t\t\t// Common case (out)\n\t\t\tif(\n\t\t\t\ttypeof object[objectKey] === 'string' &&\n\t\t\t\tobject[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n\t\t\t){\n\t\t\t\tlet parsedValue = JSON.parse(object[objectKey]);\n\t\t\t\tif( typeof parsedValue === 'object' ){\n\t\t\t\t\tobject[objectKey] = parsedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction ctProcessDecodedDataResult(response, targetElement) {\n\n\ttargetElement.setAttribute('title', '');\n\ttargetElement.removeAttribute('style');\n\n\tif( !! response.is_allowed) {\n\t\tctFillDecodedEmail(targetElement, response.decoded_email);\n\t}\n\n\tif( !! response.show_comment ){\n\t\tctShowDecodeComment(targetElement, response.comment);\n\t}\n}\n\nfunction ctFillDecodedEmail(target, email){\n\tapbct(target).html(\n\t\tapbct(target)\n\t\t\t.html()\n\t\t\t.replace(/.+?(<div class=[\"']apbct-tooltip[\"'].+?<\\/div>)/, email + \"$1\")\n\t);\n}\n\nfunction ctShowDecodeComment(target, comment){\n\n\tif( ! comment ){\n\t\treturn;\n\t}\n\n\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeIn(300);\n\tapbct(target.getElementsByClassName('apbct-tooltip--text')).html(comment);\n\tsetTimeout(function(){\n\t\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t}, 5000);\n}\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_invisible = '',\n\t\tinputs_invisible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter already added fields\n\t\tif( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){\n\t\t\treturn false;\n\t\t}\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\t// Unnecessary fields\n\t\tif(\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\telem.getAttribute('name') === null ||\n\t\t\telem.getAttribute('name') === 'ct_checkjs'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\t// Invisible fields\n\t\tif(\n\t\t\tgetComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" // type == hidden\n\t\t) {\n\t\t\tif( elem.classList.contains(\"wp-editor-area\") ) {\n\t\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_visible_count++;\n\t\t\t} else {\n\t\t\t\tinputs_invisible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_invisible_count++;\n\t\t\t}\n\t\t}\n\t\t// Visible fields\n\t\telse {\n\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\tinputs_visible_count++;\n\t\t}\n\n\t});\n\n\tinputs_invisible = inputs_invisible.trim();\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t\tinvisible_fields : inputs_invisible,\n\t\tinvisible_fields_count : inputs_invisible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection, form_id ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tif( ctPublic.data__cookies_type === 'native' ) {\n\t\tfor ( var i in collection ) {\n\t\t\tif ( i > 10 ) {\n\t\t\t\t// Do not generate more than 10 cookies\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar collectionIndex = form_id !== undefined ? form_id : i;\n\t\t\tctSetCookie(\"apbct_visible_fields_\" + collectionIndex, JSON.stringify( collection[i] ) );\n\t\t}\n\t} else {\n\t\tif (ctPublic.data__cookies_type === 'none'){\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection[0] ) );\n\t\t} else {\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\t\t}\n\n\t}\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\n\nfunction apbctGetScreenInfo() {\n\treturn JSON.stringify({\n\t\tfullWidth : document.documentElement.scrollWidth,\n\t\tfullHeight : Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t),\n\t\tvisibleWidth : document.documentElement.clientWidth,\n\t\tvisibleHeight : document.documentElement.clientHeight,\n\t});\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\ttry {\n\t\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e.toString());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tctParseBlockMessage(response);\n\t\t}\n\t});\n}\n\nfunction ctParseBlockMessage(response) {\n\n\tif (typeof response.apbct !== 'undefined') {\n\t\tresponse = response.apbct;\n\t\tif (response.blocked) {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\t// Show the result by modal\n\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\tcleantalkModal.open();\n\n\t\t\tif(+response.stop_script == 1)\n\t\t\t\twindow.stop();\n\t\t}\n\t}\n}\n\nfunction ctSetPixelUrlLocalstorage(ajax_pixel_url) {\n\t//set pixel to the storage\n\tctSetCookie('apbct_pixel_url', ajax_pixel_url)\n}\n\nfunction ctNoCookieConstructHiddenField(){\n\tlet field = ''\n\tlet no_cookie_data = apbctLocalStorage.getCleanTalkData()\n\tno_cookie_data = JSON.stringify(no_cookie_data)\n\tno_cookie_data = btoa(no_cookie_data)\n\tfield = document.createElement('input')\n\tfield.setAttribute('id','ct_no_cookie_hidden_field')\n\tfield.setAttribute('name','ct_no_cookie_hidden_field')\n\tfield.setAttribute('value', no_cookie_data)\n\tfield.setAttribute('type', 'hidden')\n\treturn field\n}\n\nfunction ctNoCookieGetForms(){\n\tlet forms = document.forms\n\tif (forms) {\n\t\treturn forms\n\t}\n\treturn false\n}\n\nfunction ctNoCookieAttachHiddenFieldsToForms(){\n\n\tif (ctPublic.data__cookies_type !== 'none'){\n\t\treturn\n\t}\n\n\tlet forms = ctNoCookieGetForms()\n\n\tif (forms){\n\t\tfor ( let i = 0; i < forms.length; i++ ){\n\t\t\t//ignore forms with get method @todo We need to think about this\n\t\t\tif (document.forms[i].getAttribute('method') === null ||\n\t\t\t\tdocument.forms[i].getAttribute('method').toLowerCase() === 'post'){\n\n\t\t\t\tlet elements = document.getElementsByName('ct_no_cookie_hidden_field')\n\t\t\t\t//clear previous hidden set\n\t\t\t\tif (elements){\n\t\t\t\t\tfor (let j = 0; j < elements.length; j++) {\n\t\t\t\t\t\telements[j].parentNode.removeChild(elements[j])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// add new set\n\t\t\t\tdocument.forms[i].append(ctNoCookieConstructHiddenField())\n\t\t\t}\n\t\t}\n\t}\n\n}\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( let key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\nlet buttons_to_handle = []\nlet gdpr_notice_for_button = 'Please, apply the GDPR agreement.'\n\ndocument.addEventListener('DOMContentLoaded', function(){\n\tbuttons_to_handle = []\n\tif(\n\t\ttypeof ctPublicGDPR === 'undefined' ||\n\t\t! ctPublicGDPR.gdpr_forms.length\n\t) {\n\t\treturn;\n\t}\n\n\tif ( typeof jQuery === 'undefined' ) {\n\t\treturn;\n\t}\n\ttry {\n\t\tctPublicGDPR.gdpr_forms.forEach(function(item, i){\n\n\t\t\tlet elem = jQuery('#'+item+', .'+item);\n\n\t\t\t// Filter forms\n\t\t\tif (!elem.is('form')){\n\t\t\t\t// Caldera\n\t\t\t\tif (elem.find('form')[0])\n\t\t\t\t\telem = elem.children('form').first();\n\t\t\t\t// Contact Form 7\n\t\t\t\telse if(\n\t\t\t\t\tjQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]')\n\t\t\t\t\t\t.attr('id')\n\t\t\t\t\t\t.indexOf('wpcf7-f'+item) !== -1\n\t\t\t\t) {\n\t\t\t\t\telem = jQuery('.wpcf7[role=form]').children('form');\n\t\t\t\t}\n\n\t\t\t\t// Formidable\n\t\t\t\telse if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)\n\t\t\t\t\telem = jQuery('.frm_forms').first().children('form');\n\t\t\t\t// WPForms\n\t\t\t\telse if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)\n\t\t\t\t\telem = jQuery('.wpforms-form');\n\t\t\t}\n\n\t\t\t//disable forms buttons\n\t\t\tlet button = false\n\t\t\tlet buttons_collection= elem.find('input[type|=\"submit\"]')\n\n\t\t\tif (!buttons_collection.length) {\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tbutton = buttons_collection[0]\n\t\t\t}\n\n\t\t\tif (button !== false){\n\t\t\t\tbutton.disabled = true\n\t\t\t\tlet old_notice = jQuery(button).prop('title') ? jQuery(button).prop('title') : ''\n\t\t\t\tbuttons_to_handle.push({index:i,button:button,old_notice:old_notice})\n\t\t\t\tjQuery(button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\n\t\t\t// Adding notice and checkbox\n\t\t\tif(elem.is('form') || elem.attr('role') === 'form'){\n\t\t\t\telem.append('<input id=\"apbct_gdpr_'+i+'\" type=\"checkbox\" required=\"required\" style=\" margin-right: 10px;\" onchange=\"apbct_gdpr_handle_buttons()\">')\n\t\t\t\t\t.append('<label style=\"display: inline;\" for=\"apbct_gdpr_'+i+'\">'+ctPublicGDPR.gdpr_text+'</label>');\n\t\t\t}\n\t\t});\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not add GDPR notice' + e)\n\t}\n});\n\nfunction apbct_gdpr_handle_buttons(){\n\n\ttry {\n\n\t\tif (buttons_to_handle === []){\n\t\t\treturn\n\t\t}\n\n\t\tbuttons_to_handle.forEach((button) => {\n\t\t\tlet selector = '[id=\"apbct_gdpr_' + button.index + '\"]'\n\t\t\tlet apbct_gdpr_item = jQuery(selector)\n\t\t\t//chek if apbct_gdpr checkbox is set\n\t\t\tif (jQuery(apbct_gdpr_item).prop(\"checked\")){\n\t\t\t\tbutton.button.disabled = false\n\t\t\t\tjQuery(button.button).prop('title', button.old_notice)\n\t\t\t} else {\n\t\t\t\tbutton.button.disabled = true\n\t\t\t\tjQuery(button.button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\t\t})\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not handle form buttons ' + e)\n\t}\n}\n/**\n * Handle external forms\n */\nfunction ct_protect_external() {\n for(var i = 0; i < document.forms.length; i++) {\n\n if (document.forms[i].cleantalk_hidden_action === undefined && document.forms[i].cleantalk_hidden_method === undefined) {\n\n // current form\n var currentForm = document.forms[i];\n\n if (currentForm.parentElement && currentForm.parentElement.classList.length > 0 && currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1){\n return\n }\n\n if(typeof(currentForm.action) == 'string') {\n\n // Ajax checking for the integrated forms\n if(isIntegratedForm(currentForm)) {\n\n apbctProcessExternalForm(currentForm, i, document);\n\n // Common flow - modify form's action\n }else if(currentForm.action.indexOf('http://') !== -1 || currentForm.action.indexOf('https://') !== -1) {\n\n var tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n var host = tmp[0].toLowerCase();\n\n if(host !== location.hostname.toLowerCase()){\n\n var ct_action = document.createElement(\"input\");\n ct_action.name = 'cleantalk_hidden_action';\n ct_action.value = currentForm.action;\n ct_action.type = 'hidden';\n currentForm.appendChild(ct_action);\n\n var ct_method = document.createElement(\"input\");\n ct_method.name = 'cleantalk_hidden_method';\n ct_method.value = currentForm.method;\n ct_method.type = 'hidden';\n\n currentForm.method = 'POST'\n\n currentForm.appendChild(ct_method);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n\n }\n\n // Trying to process external form into an iframe\n const frames = document.getElementsByTagName('iframe');\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) { continue; }\n\n const iframeForms = frames[j].contentDocument.forms;\n if ( iframeForms.length === 0 ) { return; }\n\n for ( let y = 0; y < iframeForms.length; y++ ) {\n let currentForm = iframeForms[y];\n apbctProcessExternalForm(currentForm, y, frames[j].contentDocument);\n }\n }\n }\n}\n\nfunction apbctProcessExternalForm(currentForm, iterator, documentObject) {\n\n const cleantalk_placeholder = document.createElement(\"i\");\n cleantalk_placeholder.className = 'cleantalk_placeholder';\n cleantalk_placeholder.style = 'display: none';\n\n currentForm.parentElement.insertBefore(cleantalk_placeholder, currentForm);\n\n // Deleting form to prevent submit event\n let prev = currentForm.previousSibling,\n form_html = currentForm.outerHTML,\n form_original = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement(\"div\");\n placeholder.innerHTML = form_html;\n prev.after(placeholder.firstElementChild);\n\n var force_action = document.createElement(\"input\");\n force_action.name = 'action';\n force_action.value = 'cleantalk_force_ajax_check';\n force_action.type = 'hidden';\n\n let reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(force_action);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = form_original;\n\n // mailerlite integration - disable click on submit button\n let mailerlite_detected_class = false\n if (reUseCurrentForm.classList !== undefined) {\n //list there all the mailerlite classes\n let mailerlite_classes = ['newsletterform', 'ml-block-form']\n mailerlite_classes.forEach(function(mailerlite_class) {\n if (reUseCurrentForm.classList.contains(mailerlite_class)){\n mailerlite_detected_class = mailerlite_class\n }\n });\n }\n if ( mailerlite_detected_class ) {\n let mailerliteSubmitButton = jQuery('form.' + mailerlite_detected_class).find('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.click(function (event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n });\n }\n } else {\n documentObject.forms[iterator].onsubmit = function ( event ){\n event.preventDefault();\n\n //mautic integration\n if (documentObject.forms[iterator].id.indexOf('mauticform') !== -1) {\n let checkbox = jQuery(documentObject.forms[iterator]).find('input[id*=\"checkbox_rgpd\"]')\n if (checkbox.length > 0){\n if (checkbox.prop(\"checked\") === true){\n let placeholder = jQuery('.cleantalk_placeholder')\n if (placeholder.length > 0) {\n placeholder[0].setAttribute('mautic_hidden_gdpr_id', checkbox.prop(\"id\"))\n }\n }\n }\n }\n\n const prev = jQuery(event.currentTarget).prev();\n const form_original = jQuery(event.currentTarget).clone();\n\n sendAjaxCheckingFormData(event.currentTarget);\n };\n }\n}\n\nfunction apbct_replace_inputs_values_from_other_form( form_source, form_target ){\n\n var\tinputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),\n inputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );\n\n inputs_source.each( function( index, elem_source ){\n\n var source = jQuery( elem_source );\n\n inputs_target.each( function( index2, elem_target ){\n\n var target = jQuery( elem_target );\n\n if( elem_source.outerHTML === elem_target.outerHTML ){\n\n target.val( source.val() );\n }\n });\n });\n\n}\nwindow.onload = function () {\n\n if( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n if ( typeof jQuery === 'undefined' ) {\n return;\n }\n\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n};\n\n/**\n * Checking the form integration\n */\nfunction isIntegratedForm(formObj) {\n var formAction = formObj.action;\n let formId = formObj.id;\n\n if(\n formAction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n ( formObj.firstChild.classList !== undefined && formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('webto.salesforce.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1 ||\n formAction.indexOf('mautic') !== -1 || formId.indexOf('mauticform_') !== -1\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Sending Ajax for checking form data\n */\nfunction sendAjaxCheckingFormData(form, prev, formOriginal) {\n // Get visible fields and set cookie\n var visible_fields = {};\n visible_fields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visible_fields );\n\n var data = {};\n var elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ){\n\n if( result.apbct === undefined || ! +result.apbct.blocked ) {\n\n let form_new = jQuery(form).detach();\n let prev = form.apbctPrev;\n let formOriginal = form.apbctFormOriginal;\n let mautic_integration = false;\n\n apbct_replace_inputs_values_from_other_form(form_new, formOriginal);\n\n //mautic forms integration\n if (formOriginal.id.indexOf('mautic') !== -1) {\n mautic_integration = true\n }\n let placeholders = document.getElementsByClassName('cleantalk_placeholder')\n if (placeholders) {\n for (let i = 0; i < placeholders.length; i++) {\n let mautic_hidden_gdpr_id = placeholders[i].getAttribute(\"mautic_hidden_gdpr_id\")\n if (typeof(mautic_hidden_gdpr_id) !== 'undefined') {\n let mautic_gdpr_radio = jQuery(formOriginal).find('#' + mautic_hidden_gdpr_id)\n if (typeof(mautic_gdpr_radio) !== 'undefined') {\n mautic_gdpr_radio.prop(\"checked\", true);\n }\n }\n }\n }\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n jQuery(formOriginal).find('input[name=\"apbct_visible_fields\"]').remove();\n jQuery(formOriginal).find('input[value=\"cleantalk_force_ajax_check\"]').remove();\n\n\n //Common click event\n var subm_button = jQuery(formOriginal).find('button[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n if (mautic_integration) {\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n }\n return;\n }\n\n subm_button = jQuery(formOriginal).find('input[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // ConvertKit direct integration\n subm_button = jQuery(formOriginal).find('button[data-element=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // Paypal integration\n subm_button = jQuery(formOriginal).find('input[type=\"image\"][name=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n }\n\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n }\n }\n );\n}\n\nfunction ct_check_internal(currForm){\n \n//Gathering data\n var ct_data = {},\n elems = currForm.elements;\n\n for (var key in elems) {\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\n continue;\n ct_data[elems[key].name] = currForm.elements[key].value;\n }\n ct_data['action'] = 'ct_check_internal';\n\n //AJAX Request\n apbct_public_sendAJAX(\n ct_data,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function (data) {\n if(data.success === true){\n currForm.submit();\n }else{\n alert(data.data);\n return false;\n }\n }\n }\n );\n}\n\ndocument.addEventListener('DOMContentLoaded',function(){\n let ct_currAction = '',\n ct_currForm = '';\n\n if( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n let ctPrevHandler;\n\tfor( let i=0; i<document.forms.length; i++ ){\n\t\tif ( typeof(document.forms[i].action) == 'string' ){\n ct_currForm = document.forms[i];\n\t\t\tct_currAction = ct_currForm.action;\n if (\n ct_currAction.indexOf('https?://') !== null && // The protocol is obligatory\n ct_currAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ct_check_internal__is_exclude_form(ct_currAction) // Exclude WordPress native scripts from processing\n ) {\n ctPrevHandler = ct_currForm.click;\n if ( typeof jQuery !== 'undefined' ) {\n jQuery(ct_currForm).off('**');\n jQuery(ct_currForm).off();\n jQuery(ct_currForm).on('submit', function(event){\n ct_check_internal(event.target);\n return false;\n });\n }\n }\n\t\t}\n\t}\n});\n\n/**\n * Check by action to exclude the form checking\n * @param action string\n * @return boolean\n */\nfunction ct_check_internal__is_exclude_form(action) {\n // An array contains forms action need to be excluded.\n let ct_internal_script_exclusions = [\n 'wp-login.php', // WordPress login page\n 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ct_internal_script_exclusions.some((item) => {\n return action.match(new RegExp(ctPublic.blog_home + '.*' + item)) !== null;\n });\n}"],"names":["ApbctCore","ajax_parameters","rest_parameters","#selector","elements","#eventCallback","#eventSelector","#event","constructor","selector","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","#deselect","#addElement","elemToAdd","push","#push","elem","#reduce","css","style","getRaw","let","style_name","DOM_style_name","replace","group","toUpperCase","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ApbctAjax","rest","ApbctRest","on","args","addEventListener","#onChecker","bind","event","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","propName","value","html","val","data","name","is","filter","#isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","#isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","apbct","params","ApbctXhr","#xhr","XMLHttpRequest","method","url","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","#methods_to_convert_data_to_URL","#body","#http_code","#status_text","parameters","key","console","log","#prepare","Object","keys","deleteDoubleJSONEncoding","convertData","open","setHeaders","onreadystatechange","onReadyStateChange","onload","onLoad","onprogress","onProgress","onerror","onError","ontimeout","onTimeout","send","setAttribute","cursor","#complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","#error","response","error","http_code","status_text","additional_msg","error_string","errorOutput","error_msg","header_name","setRequestHeader","convertDataToURL","convertDataToBody","params_appendix","URLSearchParams","toString","params_prefix","dataKey","FormData","JSON","stringify","object","objectKey","parsedValue","parse","super","default_route","ctPublicFunctions","_rest_url","route","X-WP-Nonce","_rest_nonce","ctSetCookie","cookies","expires","skip_alt","data__cookies_type","forEach","item","arr","apbctLocalStorage","set","encodeURIComponent","ctNoCookieAttachHiddenFieldsToForms","ctSecure","location","protocol","cookie","cookiePrefix","getJavascriptClientData","e","data__ajax_type","apbct_public_sendREST","apbct_public_sendAJAX","action","notJson","ctGetCookie","matches","RegExp","decodeURIComponent","undefined","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","_ajax_nonce","Math","random","no_cache","get","property","storageValue","localStorage","getItem","json","hasOwnProperty","is_json","objToSave","timestamp","floor","getTime","setItem","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","ct_date","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","apbct_attach_event_handler","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","clearInterval","checkEmail","current_email","email","result","now","ctSetPixelImg","pixelUrl","insertedImg","ctPublic","pixel__enabled","getElementById","ctGetPixelUrl","local_storage_pixel_url","ctSetHasScrolled","ctPreloadLocalStorage","data__to_local_storage","entries","apbct_ready","cookiesType","initCookies","getTimezoneOffset","apbctGetScreenInfo","navigator","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","forms","hiddenInput","visibleFieldsToInput","form","data__visible_fields_required","contains","id","apbct_collect_visible_fields","onsubmit_prev","onsubmit","ctFormIndex","visible_fields","apbct_visible_fields_set_cookie","Function","decodedEmailNodes","href","ctFillDecodedEmailHandler","apbctAjaxEmailDecode","baseElement","element","event_javascript_data","post_url","referrer","apbctTooltip","preventDefault","text__wait_for_decoding","apbctTooltipText","apbctTooltipArrow","ctShowDecodeComment","encodedEmail","dataset","originalString","baseElementContent","success","getElementsByClassName","innerHTML","decoded_email","click","ctProcessDecodedDataResult","res","common_cookies","resultDataJson","apbct_headless","apbct_pixel_url","ct_checked_emails","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","removeDoubleJsonEncoding","targetElement","is_allowed","ctFillDecodedEmail","show_comment","comment","inputs","inputs_visible","inputs_visible_count","inputs_invisible","inputs_invisible_count","inputs_with_duplicate_names","isNaN","getAttribute","visibility","visible_fields_count","invisible_fields","invisible_fields_count","visible_fields_collection","form_id","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","body","scrollHeight","offsetHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","ctParseBlockMessage","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajax_pixel_url","ctNoCookieConstructHiddenField","field","no_cookie_data","btoa","ctNoCookieGetForms","getElementsByName","j","parentNode","removeChild","jQuery","ajaxComplete","xhr","settings","responseText","loading","opened","opening","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","top","left","width","height","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","right","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","buttons_to_handle","gdpr_notice_for_button","apbct_gdpr_handle_buttons","index","apbct_gdpr_item","disabled","old_notice","info","ct_protect_external","cleantalk_hidden_action","cleantalk_hidden_method","ct_method","currentForm","isIntegratedForm","apbctProcessExternalForm","hostname","ct_action","type","appendChild","frames","getElementsByTagName","contentDocument","iframeForms","y","iterator","documentObject","cleantalk_placeholder","prev","insertBefore","previousSibling","form_html","outerHTML","form_original","placeholder","force_action","firstElementChild","reUseCurrentForm","mailerlite_detected_class","apbctPrev","apbctFormOriginal","mailerlite_class","mailerliteSubmitButton","find","sendAjaxCheckingFormData","currentTarget","checkbox","clone","apbct_replace_inputs_values_from_other_form","form_source","form_target","inputs_source","inputs_target","each","elem_source","source","index2","elem_target","formObj","formAction","formId","firstChild","formOriginal","elems","form_new","detach","mautic_integration","placeholders","mautic_hidden_gdpr_id","mautic_gdpr_radio","subm_button","ct_check_internal","currForm","ct_data","alert","submit","ct_check_internal__is_exclude_form","some","blog_home","ctPublicGDPR","gdpr_forms","first","buttons_collection","gdpr_text","settings__forms__check_external","ct_currForm","ct_currAction","settings__forms__check_internal","off"],"mappings":"MAAMA,UAEFC,gBAAkB,GAClBC,gBAAkB,GAElBC,UAAY,KACZC,SAAW,GAGXC,eACAC,eACAC,OAKAC,YAAYC,GACRC,KAAKC,OAAOF,CAAQ,CACxB,CAQAE,OAAOF,GAkBH,OAhBGA,aAAoBG,gBACnBF,KAAKP,UAAe,KACpBO,KAAKN,SAAc,GACnBM,KAAKN,SAAWS,MAAMC,UAAUC,MAAMC,KAAKP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G,IAAI,IAAI,EAC5B/H,OAAO4H,CAAW,EAAEG,IAAI,EACxB/H,OAAO4H,CAAW,EAAE9e,GAAG,SAAU,SAASK,GAEtC,OADA2d,kBAAkB3d,EAAMC,MAAM,EACvB,CAAA,CACX,CAAC,GAKrB,CAAC"}
1
+ {"version":3,"file":"apbct-public-bundle.min.js","sources":["apbct-public-bundle.js"],"sourcesContent":["class ApbctCore{\n\n ajax_parameters = {};\n rest_parameters = {};\n\n selector = null;\n elements = [];\n\n // Event properties\n eventCallback;\n eventSelector;\n event;\n\n /**\n * Default constructor\n */\n constructor(selector){\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param selector\n * @returns {*}\n */\n select(selector) {\n\n if(selector instanceof HTMLCollection){\n this.selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n }else if( typeof selector === 'object' ){\n this.selector = null;\n this.elements = [];\n this.elements[0] = selector;\n }else if( typeof selector === 'string' ){\n this.selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n }else{\n this.deselect();\n }\n\n return this;\n }\n\n addElement(elemToAdd){\n if( typeof elemToAdd === 'object' ){\n this.elements.push(elemToAdd);\n }else if( typeof elemToAdd === 'string' ){\n this.selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n }else{\n this.deselect();\n }\n }\n\n push(elem){\n this.elements.push(elem);\n }\n\n reduce(){\n this.elements = this.elements.slice(0,-1);\n }\n\n deselect(){\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param style\n * @param getRaw\n *\n * @returns {boolean|*}\n */\n css(style, getRaw){\n\n getRaw = getRaw | false;\n\n // Set style\n if(typeof style === \"object\"){\n\n const stringToCamelCase = str =>\n str.replace(/([-_][a-z])/g, group =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', '')\n );\n\n // Apply multiple styles\n for(let style_name in style){\n let DOM_style_name = stringToCamelCase(style_name);\n\n // Apply to multiple elements (currently selected)\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].style[DOM_style_name] = style[style_name];\n }\n }\n\n return this;\n }\n\n // Get style of first currently selected element\n if(typeof style === 'string'){\n\n let computedStyle = getComputedStyle(this.elements[0])[style];\n\n // Process\n if( typeof computedStyle !== 'undefined' && ! getRaw){\n computedStyle = computedStyle.replace(/(\\d)(em|pt|%|px){1,2}$/, '$1'); // Cut of units\n computedStyle = Number(computedStyle) == computedStyle ? Number(computedStyle) : computedStyle; // Cast to INT\n return computedStyle;\n }\n\n // Return unprocessed\n return computedStyle;\n }\n }\n\n hide(){\n this.prop('prev-display', this.css('display'));\n this.css({'display': 'none'});\n }\n\n show(){\n this.css({'display': this.prop('prev-display')});\n }\n\n addClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.add(className);\n }\n }\n\n removeClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.remove(className);\n }\n }\n\n toggleClass(className){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.toggle(className);\n }\n }\n\n /**\n * Wrapper for apbctAJAX class\n *\n * @param ajax_parameters\n * @returns {ApbctAjax}\n */\n ajax(ajax_parameters){\n this.ajax_parameters = ajax_parameters;\n return new ApbctAjax(ajax_parameters);\n }\n\n /**\n * Wrapper for apbctREST class\n *\n * @param rest_parameters\n * @returns {ApbctRest}\n */\n rest(rest_parameters){\n this.rest_parameters = rest_parameters;\n return new ApbctRest(rest_parameters);\n }\n\n /************** EVENTS **************/\n\n /**\n *\n * Why the mess with arguments?\n *\n * Because we need to support the following function signatures:\n * on('click', function(){ alert('some'); });\n * on('click', 'inner_selector', function(){ alert('some'); });\n *\n * @param args\n */\n on(...args){\n\n this.event = args[0];\n this.eventCallback = args[2] || args[1];\n this.eventSelector = typeof args[1] === \"string\" ? args[1] : null;\n\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].addEventListener(\n this.event,\n this.eventSelector !== null\n ? this.onChecker.bind(this)\n : this.eventCallback\n );\n }\n }\n\n /**\n * Check if a selector of an event matches current target\n *\n * @param event\n * @returns {*}\n */\n onChecker(event){\n if(event.target === document.querySelector(this.eventSelector)){\n event.stopPropagation();\n return this.eventCallback(event);\n }\n }\n\n ready(callback){\n document.addEventListener('DOMContentLoaded', callback);\n }\n\n change(callback){\n this.on('change', callback);\n }\n\n /************** ATTRIBUTES **************/\n\n /**\n * Get an attribute or property of an element\n *\n * @param attrName\n * @returns {*|*[]}\n */\n attr(attrName){\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n\n // Use property instead of attribute if possible\n if(typeof this.elements[i][attrName] !== undefined){\n outputValue.push(this.elements[i][attrName]);\n }else{\n outputValue.push(this.elements[i].getAttribute(attrName));\n }\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n\n prop(propName, value){\n\n // Setting values\n if(typeof value !== \"undefined\"){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i][propName] = value;\n }\n\n return this;\n\n // Getting values\n }else{\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n outputValue.push(this.elements[i][propName]);\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n }\n\n /**\n * Set or get inner HTML\n *\n * @param value\n * @returns {*|*[]}\n */\n html(value){\n return typeof value !== 'undefined'\n ? this.prop('innerHTML', value)\n : this.prop('innerHTML');\n }\n\n /**\n * Set or get value of input tags\n *\n * @param value\n * @returns {*|*[]|undefined}\n */\n val(value){\n return typeof value !== 'undefined'\n ? this.prop('value', value)\n : this.prop('value');\n }\n\n data(name, value){\n return typeof value !== 'undefined'\n ? this.prop('apbct-data', name, value)\n : this.prop('apbct-data');\n }\n\n /************** END OF ATTRIBUTES **************/\n\n /************** FILTERS **************/\n\n /**\n * Check if the current elements are corresponding to filter\n *\n * @param filter\n * @returns {boolean}\n */\n is(filter){\n\n let outputValue = false;\n\n for(let elem of this.elements){\n outputValue ||= this.isElem(elem, filter);\n }\n\n return outputValue;\n }\n\n isElem(elemToCheck, filter){\n\n let is = false;\n let isRegisteredTagName = function(name){\n let newlyCreatedElement = document.createElement(name).constructor;\n return ! Boolean( ~[HTMLElement, HTMLUnknownElement].indexOf(newlyCreatedElement) );\n };\n\n // Check for filter function\n if(typeof filter === 'function') {\n is ||= filter.call(this, elemToCheck);\n }\n\n // Check for filter function\n if(typeof filter === 'string') {\n\n // Filter is tag name\n if( filter.match(/^[a-z]/) && isRegisteredTagName(filter) ){\n is ||= elemToCheck.tagName.toLowerCase() === filter.toLowerCase();\n\n // Filter is property\n }else if( filter.match(/^[a-z]/) ){\n is ||= Boolean(elemToCheck[filter]);\n\n // Filter is CSS selector\n }else {\n is ||= this.selector !== null\n ? document.querySelector(this.selector + filter) !== null // If possible\n : this.isWithoutSelector(elemToCheck, filter); // Search through all elems with such selector\n }\n }\n\n return is;\n }\n\n isWithoutSelector(elemToCheck, filter){\n\n let elems = document.querySelectorAll(filter);\n let outputValue = false;\n\n for(let elem of elems){\n outputValue ||= elemToCheck === elem;\n }\n\n return outputValue;\n }\n\n filter(filter){\n\n this.selector = null;\n\n for( let i = this.elements.length - 1; i >= 0; i-- ){\n if( ! this.isElem(this.elements[i], filter) ){\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /************** NODES **************/\n\n parent(filter){\n\n this.select(this.elements[0].parentElement);\n\n if( typeof filter !== 'undefined' && ! this.is(filter) ){\n this.deselect();\n }\n\n return this;\n }\n\n parents(filter){\n\n this.select(this.elements[0]);\n\n for ( ; this.elements[ this.elements.length - 1].parentElement !== null ; ) {\n this.push(this.elements[ this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0,1); // Deleting initial element from the set\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n children(filter){\n\n this.select(this.elements[0].children);\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n siblings(filter){\n\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /************** DOM MANIPULATIONS **************/\n remove(){\n for(let elem of this.elements){\n elem.remove();\n }\n }\n\n after(content){\n for(let elem of this.elements){\n elem.after(content);\n }\n }\n\n append(content){\n for(let elem of this.elements){\n elem.append(content);\n }\n }\n\n /************** ANIMATION **************/\n fadeIn(time) {\n for(let elem of this.elements){\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n fadeOut(time) {\n for(let elem of this.elements){\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * Enter point to ApbctCore class\n *\n * @param params\n * @returns {*}\n */\nfunction apbct(params){\n return new ApbctCore()\n .select(params);\n}\nclass ApbctXhr{\n\n xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n body = null;\n http_code = 0;\n status_text = '';\n\n constructor(parameters){\n\n console.log('%cXHR%c started', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n\n // Set class properties\n for( let key in parameters ){\n if( typeof this[key] !== 'undefined' ){\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if( ! this.url ){\n console.log('%cXHR%c not URL provided', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;')\n return false;\n }\n\n // Configure the request\n this.xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.xhr.responseType = this.responseType;\n this.xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.xhr.onreadystatechange = function(){\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.xhr.onload = function(){\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.xhr.onprogress = function(event){\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.xhr.onerror = function(){\n this.onError();\n }.bind(this);\n\n this.xhr.ontimeout = function(){\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.xhr.send(this.body);\n }\n\n prepare(){\n\n // Disable button\n if(this.button){\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n complete(){\n\n this.http_code = this.xhr.status;\n this.status_text = this.xhr.statusText;\n\n // Disable button\n if(this.button){\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n onReadyStateChange(){\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function'){\n this.on_ready_state_change();\n }\n }\n\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function'){\n this.on_progress();\n }\n }\n\n onError(){\n\n console.log('error');\n\n this.complete();\n this.error(\n this.http_code,\n this.status_text\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback(this.status_text);\n }\n }\n\n onTimeout(){\n this.complete();\n this.error(\n 0,\n 'timeout'\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback('Timeout');\n }\n }\n\n onLoad(){\n\n this.complete();\n\n if (this.responseType === 'json' ){\n if(this.xhr.response === null){\n this.error(this.http_code, this.status_text, 'No response');\n return false;\n }else if( typeof this.xhr.response.error !== 'undefined') {\n this.error(this.http_code, this.status_text, this.xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.xhr.response, this.data);\n }\n }\n\n error(http_code, status_text, additional_msg){\n\n let error_string = '';\n\n if( status_text === 'timeout' ){\n error_string += 'Server response timeout'\n\n }else if( http_code === 200 ){\n\n if( status_text === 'parsererror' ){\n error_string += 'Unexpected response from server. See console for details.';\n }else {\n error_string += 'Unexpected error. Status: ' + status_text + '.';\n if( typeof additional_msg !== 'undefined' )\n error_string += ' Additional error info: ' + additional_msg;\n }\n\n }else if(http_code === 500){\n error_string += 'Internal server error.';\n\n }else {\n error_string += 'Unexpected response code:' + http_code;\n }\n\n this.errorOutput( error_string );\n }\n\n errorOutput(error_msg){\n console.log( '%c ctXHR error: %c' + error_msg, 'color: red;', 'color: grey;' );\n }\n\n setHeaders(){\n // Set headers if passed\n for( let header_name in this.headers ){\n if( typeof this.headers[header_name] !== 'undefined' ){\n this.xhr.setRequestHeader(header_name, this.headers[header_name]);\n }\n }\n }\n\n convertData()\n {\n // GET, HEAD request-type\n if( ~this.methods_to_convert_data_to_URL.indexOf( this.method ) ){\n return this.convertDataToURL();\n\n // POST request-type\n }else{\n return this.convertDataToBody()\n }\n }\n\n convertDataToURL(){\n let params_appendix = new URLSearchParams(this.data).toString();\n let params_prefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += params_prefix + params_appendix;\n\n return this.url;\n }\n\n /**\n *\n * @returns {null}\n */\n convertDataToBody()\n {\n this.body = new FormData();\n\n for (let dataKey in this.data) {\n this.body.append(\n dataKey,\n typeof this.data[dataKey] === 'object'\n ? JSON.stringify(this.data[dataKey])\n : this.data[dataKey]\n );\n }\n\n return this.body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\n deleteDoubleJSONEncoding(object){\n\n if( typeof object === 'object'){\n\n for (let objectKey in object) {\n\n // Recursion\n if( typeof object[objectKey] === 'object'){\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if(\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ){\n let parsedValue = JSON.parse(object[objectKey]);\n if( typeof parsedValue === 'object' ){\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n }\n}\nclass ApbctAjax extends ApbctXhr{\n\n constructor(...args) {\n super(args[0]);\n }\n}\nclass ApbctRest extends ApbctXhr{\n\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n constructor(...args) {\n args = args[0];\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n \"X-WP-Nonce\": ctPublicFunctions._rest_nonce\n };\n super(args);\n }\n}\n\nfunction ctSetCookie( cookies, value, expires ){\n\n if( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){\n var skip_alt = cookies === 'ct_pointer_data';\n cookies = [ [ cookies, value, expires ] ];\n }\n\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n cookies.forEach( function (item, i, arr\t) {\n apbctLocalStorage.set(item[0], encodeURIComponent(item[1]))\n });\n ctNoCookieAttachHiddenFieldsToForms()\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n cookies.forEach( function (item, i, arr\t) {\n var expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix + item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n });\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' && ! skip_alt ){\n\n if (typeof (getJavascriptClientData) === \"function\"){\n //reprocess already gained cookies data\n cookies = getJavascriptClientData(cookies);\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded')\n }\n\n try {\n JSON.parse(cookies)\n } catch (e){\n console.log('APBCT ERROR: JSON parse error:' + e)\n return\n }\n\n // Using REST API handler\n if( ctPublicFunctions.data__ajax_type === 'rest' ){\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: { cookies: cookies }\n }\n );\n\n // Using AJAX request and handler\n } else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n }\n );\n }\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n return;\n\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + \"=\\\"\\\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax\" + ctSecure;\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' ){\n // @ToDo implement this logic\n }\n}\n\nfunction apbct_public_sendAJAX(data, params, obj){\n\n // Default params\n let _params = [];\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"callback_context\"] = params.callback_context || null;\n _params[\"callback_params\"] = params.callback_params || null;\n _params[\"async\"] = params.async || true;\n _params[\"notJson\"] = params.notJson || null;\n _params[\"timeout\"] = params.timeout || 15000;\n _params[\"obj\"] = obj || null;\n _params[\"button\"] = params.button || null;\n _params[\"progressbar\"] = params.progressbar || null;\n _params[\"silent\"] = params.silent || null;\n _params[\"no_nonce\"] = params.no_nonce || null;\n _params[\"data\"] = data;\n _params[\"url\"] = ctPublicFunctions._ajax_url;\n\n if(typeof (data) === 'string') {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"] = _params[\"data\"] + '&_ajax_nonce=' + ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"] = _params[\"data\"] + '&no_cache=' + Math.random()\n } else {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"]._ajax_nonce = ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n let _params = [];\n _params[\"route\"] = route;\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"data\"] = params.data || [];\n _params[\"method\"] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\nlet apbctLocalStorage = {\n get : function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n return json.hasOwnProperty(property) ? JSON.parse(json[property]) : json;\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set : function(key, value, is_json = true) {\n if (is_json){\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive : function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet : function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete : function (key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData : function () {\n let data = {}\n for(let i=0; i<localStorage.length; i++) {\n let key = localStorage.key(i);\n if (key.indexOf('ct_') !==-1 || key.indexOf('apbct_') !==-1){\n data[key.toString()] = apbctLocalStorage.get(key)\n }\n }\n return data\n },\n\n}\nvar ct_date = new Date(),\n\tctTimeMs = new Date().getTime(),\n\tctMouseEventTimerFlag = true, //Reading interval flag\n\tctMouseData = [],\n\tctMouseDataCounter = 0,\n\tctCheckedEmails = {};\n\nfunction apbct_attach_event_handler(elem, event, callback){\n\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\telse elem.attachEvent(event, callback);\n}\n\nfunction apbct_remove_event_handler(elem, event, callback){\n\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\telse elem.detachEvent(event, callback);\n}\n\n//Writing first key press timestamp\nvar ctFunctionFirstKey = function output(event){\n\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\tctKeyStopStopListening();\n};\n\n//Reading interval\nvar ctMouseReadInterval = setInterval(function(){\n\tctMouseEventTimerFlag = true;\n}, 150);\n\n//Writting interval\nvar ctMouseWriteDataInterval = setInterval(function(){\n\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n}, 1200);\n\n//Logging mouse position each 150 ms\nvar ctFunctionMouseMove = function output(event){\n\tctSetMouseMoved();\n\tif(ctMouseEventTimerFlag === true){\n\n\t\tctMouseData.push([\n\t\t\tMath.round(event.clientY),\n\t\t\tMath.round(event.clientX),\n\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t]);\n\n\t\tctMouseDataCounter++;\n\t\tctMouseEventTimerFlag = false;\n\t\tif(ctMouseDataCounter >= 50){\n\t\t\tctMouseStopData();\n\t\t}\n\t}\n};\n\n//Stop mouse observing function\nfunction ctMouseStopData(){\n\tapbct_remove_event_handler(document, \"mousemove\", ctFunctionMouseMove);\n\tclearInterval(ctMouseReadInterval);\n\tclearInterval(ctMouseWriteDataInterval);\n}\n\n//Stop key listening function\nfunction ctKeyStopStopListening(){\n\tapbct_remove_event_handler(document, \"mousedown\", ctFunctionFirstKey);\n\tapbct_remove_event_handler(document, \"keydown\", ctFunctionFirstKey);\n}\n\nfunction checkEmail(e) {\n\tvar current_email = e.target.value;\n\tif (current_email && !(current_email in ctCheckedEmails)) {\n\t\t// Using REST API handler\n\t\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\t\tapbct_public_sendREST(\n\t\t\t\t'check_email_before_post',\n\t\t\t\t{\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {'email' : current_email},\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t\t// Using AJAX request and handler\n\t\t} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n\t\t\tapbct_public_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\temail : current_email,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction ctSetPixelImg(pixelUrl) {\n\tctSetCookie('apbct_pixel_url', pixelUrl);\n\tif( +ctPublic.pixel__enabled ){\n\t\tif( ! document.getElementById('apbct_pixel') ) {\n\t\t\tlet insertedImg = document.createElement('img');\n\t\t\tinsertedImg.setAttribute('alt', 'CleanTalk Pixel');\n\t\t\tinsertedImg.setAttribute('id', 'apbct_pixel');\n\t\t\tinsertedImg.setAttribute('style', 'display: none; left: 99999px;');\n\t\t\tinsertedImg.setAttribute('src', pixelUrl);\n\t\t\tapbct('body').append(insertedImg);\n\t\t}\n\t}\n}\n\nfunction ctGetPixelUrl() {\n\t// Check if pixel is already in localstorage and is not outdated\n\tlet local_storage_pixel_url = apbctLocalStorage.get('apbct_pixel_url');\n\tif ( local_storage_pixel_url !== false ) {\n\t\tif ( apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n\t\t\tapbctLocalStorage.delete('apbct_pixel_url')\n\t\t} else {\n\t\t\t//if so - load pixel from localstorage and draw it skipping AJAX\n\t\t\tctSetPixelImg(local_storage_pixel_url);\n\t\t\treturn;\n\t\t}\n\t}\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_get_pixel_url',\n\t\t\t{\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t\t// Using AJAX request and handler\n\t}else{\n\t\tapbct_public_sendAJAX(\n\t\t\t{\n\t\t\t\taction: 'apbct_get_pixel_url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction ctSetHasScrolled() {\n\tif( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n\t\tctSetCookie(\"ct_has_scrolled\", 'true');\n\t\tapbctLocalStorage.set('ct_has_scrolled', true);\n\t}\n}\n\nfunction ctSetMouseMoved() {\n\tif( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n\t\tctSetCookie(\"ct_mouse_moved\", 'true');\n\t\tapbctLocalStorage.set('ct_mouse_moved', true);\n\t}\n}\n\nfunction ctPreloadLocalStorage(){\n\tif (ctPublic.data__to_local_storage){\n\t\tlet data = Object.entries(ctPublic.data__to_local_storage)\n\t\tdata.forEach(([key, value]) => {\n\t\t\tapbctLocalStorage.set(key,value)\n\t\t});\n\t}\n}\n\napbct_attach_event_handler(document, \"mousemove\", ctFunctionMouseMove);\napbct_attach_event_handler(document, \"mousedown\", ctFunctionFirstKey);\napbct_attach_event_handler(document, \"keydown\", ctFunctionFirstKey);\napbct_attach_event_handler(document, \"scroll\", ctSetHasScrolled);\n\n// Ready function\nfunction apbct_ready(){\n\n\tctPreloadLocalStorage()\n\n\tlet cookiesType = apbctLocalStorage.get('ct_cookies_type');\n\tif ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n\t\tapbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n\t\tapbctLocalStorage.delete('ct_mouse_moved');\n\t\tapbctLocalStorage.delete('ct_has_scrolled');\n\t}\n\n\t// Collect scrolling info\n\tvar initCookies = [\n\t\t[\"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000)],\n\t\t[\"ct_fkp_timestamp\", \"0\"],\n\t\t[\"ct_pointer_data\", \"0\"],\n\t\t[\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t[\"ct_screen_info\", apbctGetScreenInfo()],\n\t\t[\"apbct_headless\", navigator.webdriver],\n\t];\n\n\tapbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n\tapbctLocalStorage.set('ct_fkp_timestamp', \"0\");\n\tapbctLocalStorage.set('ct_pointer_data', \"0\");\n\tapbctLocalStorage.set('ct_timezone', ct_date.getTimezoneOffset()/60*(-1) );\n\tapbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n\tapbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n\tif( ctPublic.data__cookies_type !== 'native' ) {\n\t\tinitCookies.push(['apbct_visible_fields', '0']);\n\t} else {\n\t\t// Delete all visible fields cookies on load the page\n\t\tvar cookiesArray = document.cookie.split(\";\");\n\t\tif( cookiesArray.length !== 0 ) {\n\t\t\tfor ( var i = 0; i < cookiesArray.length; i++ ) {\n\t\t\t\tvar currentCookie = cookiesArray[i].trim();\n\t\t\t\tvar cookieName = currentCookie.split(\"=\")[0];\n\t\t\t\tif( cookieName.indexOf(\"apbct_visible_fields_\") === 0 ) {\n\t\t\t\t\tctDeleteCookie(cookieName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif( +ctPublic.pixel__setting ){\n\t\tif( +ctPublic.pixel__enabled ){\n\t\t\tctGetPixelUrl()\n\t\t} else {\n\t\t\tinitCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n\t\t}\n\t}\n\n\tif ( +ctPublic.data__email_check_before_post) {\n\t\tinitCookies.push(['ct_checked_emails', '0']);\n\t\tapbct(\"input[type = 'email'], #email\").on('blur', checkEmail);\n\t}\n\n\tif (apbctLocalStorage.isSet('ct_checkjs')) {\n\t\tinitCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n\t} else {\n\t\tinitCookies.push(['ct_checkjs', 0]);\n\t}\n\n\tctSetCookie(initCookies);\n\n\tsetTimeout(function(){\n\n\t\tctNoCookieAttachHiddenFieldsToForms()\n\n\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\tvar form = document.forms[i];\n\n\t\t\t//Exclusion for forms\n\t\t\tif (\n\t\t\t\t+ctPublic.data__visible_fields_required === 0 ||\n\t\t\t\tform.method.toString().toLowerCase() === 'get' ||\n\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t(form.id && form.id === 'caspioform') || //Caspio Form\n\t\t\t\t(form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t(form.classList && form.classList.contains('give-form')) || // GiveWP\n\t\t\t\t(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password\n\t\t\t\t(form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n\t\t\t\t(form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n\t\t\t\t(form.id && form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\t(form.name && form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\tform.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n\t\t\t\t(form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) // The Events Calendar\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar hiddenInput = document.createElement( 'input' );\n\t\t\thiddenInput.setAttribute( 'type', 'hidden' );\n\t\t\thiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n\t\t\thiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n\t\t\tvar visibleFieldsToInput = {};\n\t\t\tvisibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n\t\t\thiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));\n\t\t\tform.append( hiddenInput );\n\n\t\t\tform.onsubmit_prev = form.onsubmit;\n\n\t\t\tform.ctFormIndex = i;\n\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\tif ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );\n\t\t\t\t}\n\n\t\t\t\t// Call previous submit action\n\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t}, 1000);\n\n\t// Listen clicks on encoded emails\n\tlet decodedEmailNodes = document.querySelectorAll(\"[data-original-string]\");\n\tif (decodedEmailNodes.length) {\n\t\tfor (let i = 0; i < decodedEmailNodes.length; ++i) {\n\t\t\tif (\n\t\t\t\tdecodedEmailNodes[i].parentElement.href ||\n\t\t\t\tdecodedEmailNodes[i].parentElement.parentElement.href\n\t\t\t) {\n\t\t\t\t// Skip listening click on hyperlinks\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdecodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n\t\t}\n\t}\n}\nif (document.readyState !== 'loading') {\n\tapbct_ready();\n} else {\n\tapbct_attach_event_handler(document, \"DOMContentLoaded\", apbct_ready);\n}\n\nfunction ctFillDecodedEmailHandler(event) {\n\tthis.removeEventListener('click', ctFillDecodedEmailHandler);\n\tapbctAjaxEmailDecode(event, this);\n}\n\nfunction apbctAjaxEmailDecode(event, baseElement){\n\tconst element = event.target;\n\tconst javascriptClientData = getJavascriptClientData();\n\tlet data = {\n\t\tevent_javascript_data: javascriptClientData,\n\t\tpost_url: document.location.href,\n\t\treferrer: document.referrer,\n\t};\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tevent.preventDefault();\n\t}\n\n\telement.setAttribute('title', ctPublicFunctions.text__wait_for_decoding);\n\telement.style.cursor = 'progress';\n\n\t// Adding a tooltip\n\tlet apbctTooltip = document.createElement('div');\n\tapbctTooltip.setAttribute('class', 'apbct-tooltip');\n\tlet apbctTooltipText = document.createElement('div');\n\tapbctTooltipText.setAttribute('class', 'apbct-tooltip--text');\n\tlet apbctTooltipArrow = document.createElement('div');\n\tapbctTooltipArrow.setAttribute('class', 'apbct-tooltip--arrow');\n\tapbct(element).append(apbctTooltip);\n\tapbct(apbctTooltip).append(apbctTooltipText);\n\tapbct(apbctTooltip).append(apbctTooltipArrow);\n\tctShowDecodeComment(element, ctPublicFunctions.text__wait_for_decoding);\n\n\tlet encodedEmail = event.target.dataset.originalString;\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tencodedEmail = baseElement.dataset.originalString;\n\t}\n\n\tdata.encodedEmail = encodedEmail;\n\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_decode_email',\n\t\t\t{\n\t\t\t\tdata: data,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function(result) {\n\t\t\t\t\tapbctEmailEncoderCallback(result, baseElement, element);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\n\t// Using AJAX request and handler\n\t}else{\n\t\tdata.action = 'apbct_decode_email';\n\t\tapbct_public_sendAJAX(\n\t\t\tdata,\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result) {\n\t\t\t\t\tapbctEmailEncoderCallback(result, baseElement, element);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction apbctEmailEncoderCallback(result, baseElement, element) {\n\tif (result.success) {\n\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\tbaseElement.click();\n\t\t} else {\n\t\t\tsetTimeout(function(){\n\t\t\t\tctProcessDecodedDataResult(result.data, element);\n\t\t\t}, 3000);\n\t\t}\n\t} else {\n\t\telement.removeAttribute('style');\n\t\tctShowDecodeComment(element, result.data.comment);\n\t}\n}\n\nfunction getJavascriptClientData(common_cookies = []) {\n\tlet resultDataJson = {};\n\n\tresultDataJson.apbct_headless = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\tresultDataJson.apbct_pixel_url = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n\tresultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n\tresultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n\tresultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n\tresultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n\tresultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n\tresultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n\tresultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n\t// collecting data from localstorage\n\tconst ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\t// collecting data from cookies\n\tconst ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\tresultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ? ctMouseMovedLocalStorage : ctMouseMovedCookie;\n\tresultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ? ctHasScrolledLocalStorage : ctHasScrolledCookie;\n\tresultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ? ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n\n\tif (\n\t\ttypeof (common_cookies) === \"object\"\n\t\t&& common_cookies !== []\n\t){\n\t\tfor (let i = 0; i < common_cookies.length; ++i){\n\t\t\tif ( typeof (common_cookies[i][1]) === \"object\" ){\n\t\t\t\t//this is for handle SFW cookies\n\t\t\t\tresultDataJson[common_cookies[i][1][0]] = common_cookies[i][1][1]\n\t\t\t} else {\n\t\t\t\tresultDataJson[common_cookies[i][0]] = common_cookies[i][1]\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconsole.log('APBCT JS ERROR: Collecting data type mismatch')\n\t}\n\n\t// Parse JSON properties to prevent double JSON encoding\n\tresultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\treturn JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\nfunction removeDoubleJsonEncoding(object){\n\n\tif( typeof object === 'object'){\n\n\t\tfor (let objectKey in object) {\n\n\t\t\t// Recursion\n\t\t\tif( typeof object[objectKey] === 'object'){\n\t\t\t\tobject[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n\t\t\t}\n\n\t\t\t// Common case (out)\n\t\t\tif(\n\t\t\t\ttypeof object[objectKey] === 'string' &&\n\t\t\t\tobject[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n\t\t\t){\n\t\t\t\tlet parsedValue = JSON.parse(object[objectKey]);\n\t\t\t\tif( typeof parsedValue === 'object' ){\n\t\t\t\t\tobject[objectKey] = parsedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction ctProcessDecodedDataResult(response, targetElement) {\n\n\ttargetElement.setAttribute('title', '');\n\ttargetElement.removeAttribute('style');\n\n\tif( !! response.is_allowed) {\n\t\tctFillDecodedEmail(targetElement, response.decoded_email);\n\t}\n\n\tif( !! response.show_comment ){\n\t\tctShowDecodeComment(targetElement, response.comment);\n\t}\n}\n\nfunction ctFillDecodedEmail(target, email){\n\tapbct(target).html(\n\t\tapbct(target)\n\t\t\t.html()\n\t\t\t.replace(/.+?(<div class=[\"']apbct-tooltip[\"'].+?<\\/div>)/, email + \"$1\")\n\t);\n}\n\nfunction ctShowDecodeComment(target, comment){\n\n\tif( ! comment ){\n\t\treturn;\n\t}\n\n\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeIn(300);\n\tapbct(target.getElementsByClassName('apbct-tooltip--text')).html(comment);\n\tsetTimeout(function(){\n\t\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t}, 5000);\n}\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_invisible = '',\n\t\tinputs_invisible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter already added fields\n\t\tif( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){\n\t\t\treturn false;\n\t\t}\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\t// Unnecessary fields\n\t\tif(\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\telem.getAttribute('name') === null ||\n\t\t\telem.getAttribute('name') === 'ct_checkjs'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\t// Invisible fields\n\t\tif(\n\t\t\tgetComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" // type == hidden\n\t\t) {\n\t\t\tif( elem.classList.contains(\"wp-editor-area\") ) {\n\t\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_visible_count++;\n\t\t\t} else {\n\t\t\t\tinputs_invisible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_invisible_count++;\n\t\t\t}\n\t\t}\n\t\t// Visible fields\n\t\telse {\n\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\tinputs_visible_count++;\n\t\t}\n\n\t});\n\n\tinputs_invisible = inputs_invisible.trim();\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t\tinvisible_fields : inputs_invisible,\n\t\tinvisible_fields_count : inputs_invisible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection, form_id ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tif( ctPublic.data__cookies_type === 'native' ) {\n\t\tfor ( var i in collection ) {\n\t\t\tif ( i > 10 ) {\n\t\t\t\t// Do not generate more than 10 cookies\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar collectionIndex = form_id !== undefined ? form_id : i;\n\t\t\tctSetCookie(\"apbct_visible_fields_\" + collectionIndex, JSON.stringify( collection[i] ) );\n\t\t}\n\t} else {\n\t\tif (ctPublic.data__cookies_type === 'none'){\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection[0] ) );\n\t\t} else {\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\t\t}\n\n\t}\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\n\nfunction apbctGetScreenInfo() {\n\treturn JSON.stringify({\n\t\tfullWidth : document.documentElement.scrollWidth,\n\t\tfullHeight : Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t),\n\t\tvisibleWidth : document.documentElement.clientWidth,\n\t\tvisibleHeight : document.documentElement.clientHeight,\n\t});\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\ttry {\n\t\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e.toString());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tctParseBlockMessage(response);\n\t\t}\n\t});\n}\n\nfunction ctParseBlockMessage(response) {\n\n\tif (typeof response.apbct !== 'undefined') {\n\t\tresponse = response.apbct;\n\t\tif (response.blocked) {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\t// Show the result by modal\n\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\tcleantalkModal.open();\n\n\t\t\tif(+response.stop_script == 1)\n\t\t\t\twindow.stop();\n\t\t}\n\t}\n}\n\nfunction ctSetPixelUrlLocalstorage(ajax_pixel_url) {\n\t//set pixel to the storage\n\tctSetCookie('apbct_pixel_url', ajax_pixel_url)\n}\n\nfunction ctNoCookieConstructHiddenField(){\n\tlet field = ''\n\tlet no_cookie_data = apbctLocalStorage.getCleanTalkData()\n\tno_cookie_data = JSON.stringify(no_cookie_data)\n\tno_cookie_data = btoa(no_cookie_data)\n\tfield = document.createElement('input')\n\tfield.setAttribute('id','ct_no_cookie_hidden_field')\n\tfield.setAttribute('name','ct_no_cookie_hidden_field')\n\tfield.setAttribute('value', no_cookie_data)\n\tfield.setAttribute('type', 'hidden')\n\treturn field\n}\n\nfunction ctNoCookieGetForms(){\n\tlet forms = document.forms\n\tif (forms) {\n\t\treturn forms\n\t}\n\treturn false\n}\n\nfunction ctNoCookieAttachHiddenFieldsToForms(){\n\n\tif (ctPublic.data__cookies_type !== 'none'){\n\t\treturn\n\t}\n\n\tlet forms = ctNoCookieGetForms()\n\n\tif (forms){\n\t\t//clear previous hidden set\n\t\tlet elements = document.getElementsByName('ct_no_cookie_hidden_field')\n\t\tif (elements){\n\t\t\tfor (let j = 0; j < elements.length; j++) {\n\t\t\t\telements[j].parentNode.removeChild(elements[j])\n\t\t\t}\n\t\t}\n\t\tfor ( let i = 0; i < forms.length; i++ ){\n\t\t\t//ignore forms with get method @todo We need to think about this\n\t\t\tif (document.forms[i].getAttribute('method') === null ||\n\t\t\t\tdocument.forms[i].getAttribute('method').toLowerCase() === 'post'){\n\t\t\t\t// add new set\n\t\t\t\tdocument.forms[i].append(ctNoCookieConstructHiddenField())\n\t\t\t}\n\t\t}\n\t}\n\n}\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( let key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\nlet buttons_to_handle = [];\n\ndocument.addEventListener('DOMContentLoaded', function(){\n\n\tif(\n\t\ttypeof ctPublicGDPR === 'undefined' ||\n\t\t! ctPublicGDPR.gdpr_forms.length\n\t) {\n\t\treturn;\n\t}\n\n\tlet gdpr_notice_for_button = ctPublicGDPR.gdpr_title;\n\n\tif ( typeof jQuery === 'undefined' ) {\n\t\treturn;\n\t}\n\ttry {\n\t\tctPublicGDPR.gdpr_forms.forEach(function(item, i){\n\n\t\t\tlet elem = jQuery('#'+item+', .'+item);\n\n\t\t\t// Filter forms\n\t\t\tif (!elem.is('form')){\n\t\t\t\t// Caldera\n\t\t\t\tif (elem.find('form')[0])\n\t\t\t\t\telem = elem.children('form').first();\n\t\t\t\t// Contact Form 7\n\t\t\t\telse if(\n\t\t\t\t\tjQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]')\n\t\t\t\t\t\t.attr('id')\n\t\t\t\t\t\t.indexOf('wpcf7-f'+item) !== -1\n\t\t\t\t) {\n\t\t\t\t\telem = jQuery('.wpcf7[role=form]').children('form');\n\t\t\t\t}\n\n\t\t\t\t// Formidable\n\t\t\t\telse if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)\n\t\t\t\t\telem = jQuery('.frm_forms').first().children('form');\n\t\t\t\t// WPForms\n\t\t\t\telse if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)\n\t\t\t\t\telem = jQuery('.wpforms-form');\n\t\t\t}\n\n\t\t\t//disable forms buttons\n\t\t\tlet button = false\n\t\t\tlet buttons_collection= elem.find('input[type|=\"submit\"],button[type|=\"submit\"]')\n\n\t\t\tif (!buttons_collection.length) {\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tbutton = buttons_collection[0]\n\t\t\t}\n\n\t\t\tif (button !== false){\n\t\t\t\tbutton.disabled = true\n\t\t\t\tlet old_notice = jQuery(button).prop('title') ? jQuery(button).prop('title') : ''\n\t\t\t\tbuttons_to_handle.push({index:i,button:button,old_notice:old_notice})\n\t\t\t\tjQuery(button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\n\t\t\t// Adding notice and checkbox\n\t\t\tif(elem.is('form') || elem.attr('role') === 'form'){\n\t\t\t\telem.append('<input id=\"apbct_gdpr_'+i+'\" type=\"checkbox\" required=\"required\" style=\" margin-right: 10px;\" onchange=\"apbct_gdpr_handle_buttons()\">')\n\t\t\t\t\t.append('<label style=\"display: inline;\" for=\"apbct_gdpr_'+i+'\">'+ctPublicGDPR.gdpr_text+'</label>');\n\t\t\t}\n\t\t});\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not add GDPR notice' + e)\n\t}\n});\n\nfunction apbct_gdpr_handle_buttons(){\n\n\ttry {\n\n\t\tif (buttons_to_handle === []){\n\t\t\treturn\n\t\t}\n\n\t\tbuttons_to_handle.forEach((button) => {\n\t\t\tlet selector = '[id=\"apbct_gdpr_' + button.index + '\"]'\n\t\t\tlet apbct_gdpr_item = jQuery(selector)\n\t\t\t//chek if apbct_gdpr checkbox is set\n\t\t\tif (jQuery(apbct_gdpr_item).prop(\"checked\")){\n\t\t\t\tbutton.button.disabled = false\n\t\t\t\tjQuery(button.button).prop('title', button.old_notice)\n\t\t\t} else {\n\t\t\t\tbutton.button.disabled = true\n\t\t\t\tjQuery(button.button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\t\t})\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not handle form buttons ' + e)\n\t}\n}\n/**\n * Handle external forms\n */\nfunction ct_protect_external() {\n for(var i = 0; i < document.forms.length; i++) {\n\n if (document.forms[i].cleantalk_hidden_action === undefined && document.forms[i].cleantalk_hidden_method === undefined) {\n\n // current form\n var currentForm = document.forms[i];\n\n if (currentForm.parentElement && currentForm.parentElement.classList.length > 0 && currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1){\n return\n }\n\n if(typeof(currentForm.action) == 'string') {\n\n // Ajax checking for the integrated forms\n if(isIntegratedForm(currentForm)) {\n\n apbctProcessExternalForm(currentForm, i, document);\n\n // Common flow - modify form's action\n }else if(currentForm.action.indexOf('http://') !== -1 || currentForm.action.indexOf('https://') !== -1) {\n\n var tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n var host = tmp[0].toLowerCase();\n\n if(host !== location.hostname.toLowerCase()){\n\n var ct_action = document.createElement(\"input\");\n ct_action.name = 'cleantalk_hidden_action';\n ct_action.value = currentForm.action;\n ct_action.type = 'hidden';\n currentForm.appendChild(ct_action);\n\n var ct_method = document.createElement(\"input\");\n ct_method.name = 'cleantalk_hidden_method';\n ct_method.value = currentForm.method;\n ct_method.type = 'hidden';\n\n currentForm.method = 'POST'\n\n currentForm.appendChild(ct_method);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n\n }\n\n // Trying to process external form into an iframe\n const frames = document.getElementsByTagName('iframe');\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) { continue; }\n\n const iframeForms = frames[j].contentDocument.forms;\n if ( iframeForms.length === 0 ) { return; }\n\n for ( let y = 0; y < iframeForms.length; y++ ) {\n let currentForm = iframeForms[y];\n apbctProcessExternalForm(currentForm, y, frames[j].contentDocument);\n }\n }\n }\n}\n\nfunction apbctProcessExternalForm(currentForm, iterator, documentObject) {\n\n const cleantalk_placeholder = document.createElement(\"i\");\n cleantalk_placeholder.className = 'cleantalk_placeholder';\n cleantalk_placeholder.style = 'display: none';\n\n currentForm.parentElement.insertBefore(cleantalk_placeholder, currentForm);\n\n // Deleting form to prevent submit event\n let prev = currentForm.previousSibling,\n form_html = currentForm.outerHTML,\n form_original = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement(\"div\");\n placeholder.innerHTML = form_html;\n prev.after(placeholder.firstElementChild);\n\n var force_action = document.createElement(\"input\");\n force_action.name = 'action';\n force_action.value = 'cleantalk_force_ajax_check';\n force_action.type = 'hidden';\n\n let reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(force_action);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = form_original;\n\n // mailerlite integration - disable click on submit button\n let mailerlite_detected_class = false\n if (reUseCurrentForm.classList !== undefined) {\n //list there all the mailerlite classes\n let mailerlite_classes = ['newsletterform', 'ml-block-form']\n mailerlite_classes.forEach(function(mailerlite_class) {\n if (reUseCurrentForm.classList.contains(mailerlite_class)){\n mailerlite_detected_class = mailerlite_class\n }\n });\n }\n if ( mailerlite_detected_class ) {\n let mailerliteSubmitButton = jQuery('form.' + mailerlite_detected_class).find('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.click(function (event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n });\n }\n } else {\n documentObject.forms[iterator].onsubmit = function ( event ){\n event.preventDefault();\n\n //mautic integration\n if (documentObject.forms[iterator].id.indexOf('mauticform') !== -1) {\n let checkbox = jQuery(documentObject.forms[iterator]).find('input[id*=\"checkbox_rgpd\"]')\n if (checkbox.length > 0){\n if (checkbox.prop(\"checked\") === true){\n let placeholder = jQuery('.cleantalk_placeholder')\n if (placeholder.length > 0) {\n placeholder[0].setAttribute('mautic_hidden_gdpr_id', checkbox.prop(\"id\"))\n }\n }\n }\n }\n\n const prev = jQuery(event.currentTarget).prev();\n const form_original = jQuery(event.currentTarget).clone();\n\n sendAjaxCheckingFormData(event.currentTarget);\n };\n }\n}\n\nfunction apbct_replace_inputs_values_from_other_form( form_source, form_target ){\n\n var\tinputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),\n inputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );\n\n inputs_source.each( function( index, elem_source ){\n\n var source = jQuery( elem_source );\n\n inputs_target.each( function( index2, elem_target ){\n\n var target = jQuery( elem_target );\n\n if( elem_source.outerHTML === elem_target.outerHTML ){\n\n target.val( source.val() );\n }\n });\n });\n\n}\nwindow.onload = function () {\n\n if( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n if ( typeof jQuery === 'undefined' ) {\n return;\n }\n\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n};\n\n/**\n * Checking the form integration\n */\nfunction isIntegratedForm(formObj) {\n var formAction = formObj.action;\n let formId = formObj.id;\n\n if(\n formAction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n ( formObj.firstChild.classList !== undefined && formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('webto.salesforce.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1 ||\n formAction.indexOf('mautic') !== -1 || formId.indexOf('mauticform_') !== -1\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Sending Ajax for checking form data\n */\nfunction sendAjaxCheckingFormData(form, prev, formOriginal) {\n // Get visible fields and set cookie\n var visible_fields = {};\n visible_fields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visible_fields );\n\n var data = {};\n var elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ){\n\n if( result.apbct === undefined || ! +result.apbct.blocked ) {\n\n let form_new = jQuery(form).detach();\n let prev = form.apbctPrev;\n let formOriginal = form.apbctFormOriginal;\n let mautic_integration = false;\n\n apbct_replace_inputs_values_from_other_form(form_new, formOriginal);\n\n //mautic forms integration\n if (formOriginal.id.indexOf('mautic') !== -1) {\n mautic_integration = true\n }\n let placeholders = document.getElementsByClassName('cleantalk_placeholder')\n if (placeholders) {\n for (let i = 0; i < placeholders.length; i++) {\n let mautic_hidden_gdpr_id = placeholders[i].getAttribute(\"mautic_hidden_gdpr_id\")\n if (typeof(mautic_hidden_gdpr_id) !== 'undefined') {\n let mautic_gdpr_radio = jQuery(formOriginal).find('#' + mautic_hidden_gdpr_id)\n if (typeof(mautic_gdpr_radio) !== 'undefined') {\n mautic_gdpr_radio.prop(\"checked\", true);\n }\n }\n }\n }\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n jQuery(formOriginal).find('input[name=\"apbct_visible_fields\"]').remove();\n jQuery(formOriginal).find('input[value=\"cleantalk_force_ajax_check\"]').remove();\n\n\n //Common click event\n var subm_button = jQuery(formOriginal).find('button[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n if (mautic_integration) {\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n }\n return;\n }\n\n subm_button = jQuery(formOriginal).find('input[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // ConvertKit direct integration\n subm_button = jQuery(formOriginal).find('button[data-element=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // Paypal integration\n subm_button = jQuery(formOriginal).find('input[type=\"image\"][name=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n }\n\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n }\n }\n );\n}\n\nfunction ct_check_internal(currForm){\n \n//Gathering data\n var ct_data = {},\n elems = currForm.elements;\n\n for (var key in elems) {\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\n continue;\n ct_data[elems[key].name] = currForm.elements[key].value;\n }\n ct_data['action'] = 'ct_check_internal';\n\n //AJAX Request\n apbct_public_sendAJAX(\n ct_data,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function (data) {\n if(data.success === true){\n currForm.submit();\n }else{\n alert(data.data);\n return false;\n }\n }\n }\n );\n}\n\ndocument.addEventListener('DOMContentLoaded',function(){\n let ct_currAction = '',\n ct_currForm = '';\n\n if( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n let ctPrevHandler;\n\tfor( let i=0; i<document.forms.length; i++ ){\n\t\tif ( typeof(document.forms[i].action) == 'string' ){\n ct_currForm = document.forms[i];\n\t\t\tct_currAction = ct_currForm.action;\n if (\n ct_currAction.indexOf('https?://') !== null && // The protocol is obligatory\n ct_currAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ct_check_internal__is_exclude_form(ct_currAction) // Exclude WordPress native scripts from processing\n ) {\n ctPrevHandler = ct_currForm.click;\n if ( typeof jQuery !== 'undefined' ) {\n jQuery(ct_currForm).off('**');\n jQuery(ct_currForm).off();\n jQuery(ct_currForm).on('submit', function(event){\n ct_check_internal(event.target);\n return false;\n });\n }\n }\n\t\t}\n\t}\n});\n\n/**\n * Check by action to exclude the form checking\n * @param action string\n * @return boolean\n */\nfunction ct_check_internal__is_exclude_form(action) {\n // An array contains forms action need to be excluded.\n let ct_internal_script_exclusions = [\n 'wp-login.php', // WordPress login page\n 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ct_internal_script_exclusions.some((item) => {\n return action.match(new RegExp(ctPublic.blog_home + '.*' + item)) !== null;\n });\n}"],"names":["ApbctCore","ajax_parameters","rest_parameters","selector","elements","eventCallback","eventSelector","event","constructor","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","deselect","addElement","elemToAdd","push","elem","reduce","css","style","getRaw","let","style_name","DOM_style_name","replace","group","toUpperCase","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ApbctAjax","rest","ApbctRest","on","args","addEventListener","onChecker","bind","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","propName","value","html","val","data","name","is","filter","isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","apbct","params","ApbctXhr","xhr","XMLHttpRequest","method","url","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","methods_to_convert_data_to_URL","body","http_code","status_text","parameters","key","console","log","prepare","Object","keys","deleteDoubleJSONEncoding","convertData","open","setHeaders","onreadystatechange","onReadyStateChange","onload","onLoad","onprogress","onProgress","onerror","onError","ontimeout","onTimeout","send","setAttribute","cursor","complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","error","response","additional_msg","error_string","errorOutput","error_msg","header_name","setRequestHeader","convertDataToURL","convertDataToBody","params_appendix","URLSearchParams","toString","params_prefix","dataKey","FormData","JSON","stringify","object","objectKey","parsedValue","parse","super","default_route","ctPublicFunctions","_rest_url","route","X-WP-Nonce","_rest_nonce","ctSetCookie","cookies","expires","skip_alt","data__cookies_type","forEach","item","arr","apbctLocalStorage","set","encodeURIComponent","ctNoCookieAttachHiddenFieldsToForms","ctSecure","location","protocol","cookie","cookiePrefix","getJavascriptClientData","e","data__ajax_type","apbct_public_sendREST","apbct_public_sendAJAX","action","notJson","ctGetCookie","matches","RegExp","decodeURIComponent","undefined","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","_ajax_nonce","Math","random","no_cache","get","property","storageValue","localStorage","getItem","json","hasOwnProperty","is_json","objToSave","timestamp","floor","getTime","setItem","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","ct_date","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","apbct_attach_event_handler","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","clearInterval","checkEmail","current_email","email","result","now","ctSetPixelImg","pixelUrl","insertedImg","ctPublic","pixel__enabled","getElementById","ctGetPixelUrl","local_storage_pixel_url","ctSetHasScrolled","ctPreloadLocalStorage","data__to_local_storage","entries","apbct_ready","cookiesType","initCookies","getTimezoneOffset","apbctGetScreenInfo","navigator","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","forms","hiddenInput","visibleFieldsToInput","form","data__visible_fields_required","contains","id","apbct_collect_visible_fields","btoa","onsubmit_prev","onsubmit","ctFormIndex","visible_fields","apbct_visible_fields_set_cookie","Function","decodedEmailNodes","href","ctFillDecodedEmailHandler","apbctAjaxEmailDecode","baseElement","element","event_javascript_data","post_url","referrer","apbctTooltip","preventDefault","text__wait_for_decoding","apbctTooltipText","apbctTooltipArrow","ctShowDecodeComment","encodedEmail","dataset","originalString","apbctEmailEncoderCallback","res","baseElementContent","success","innerHTML","decoded_email","click","ctProcessDecodedDataResult","comment","common_cookies","resultDataJson","apbct_headless","apbct_pixel_url","ct_checked_emails","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","removeDoubleJsonEncoding","targetElement","is_allowed","ctFillDecodedEmail","show_comment","getElementsByClassName","inputs","inputs_visible","inputs_visible_count","inputs_invisible","inputs_invisible_count","inputs_with_duplicate_names","isNaN","getAttribute","visibility","visible_fields_count","invisible_fields","invisible_fields_count","visible_fields_collection","form_id","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","scrollHeight","offsetHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","ctParseBlockMessage","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajax_pixel_url","ctNoCookieConstructHiddenField","field","no_cookie_data","ctNoCookieGetForms","getElementsByName","j","parentNode","removeChild","readyState","jQuery","ajaxComplete","settings","responseText","loading","opened","opening","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","top","left","width","height","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","right","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","buttons_to_handle","apbct_gdpr_handle_buttons","index","apbct_gdpr_item","disabled","old_notice","gdpr_notice_for_button","info","ct_protect_external","cleantalk_hidden_action","cleantalk_hidden_method","ct_method","currentForm","isIntegratedForm","apbctProcessExternalForm","hostname","ct_action","type","appendChild","frames","getElementsByTagName","contentDocument","iframeForms","y","iterator","documentObject","cleantalk_placeholder","prev","insertBefore","previousSibling","form_html","outerHTML","form_original","placeholder","force_action","firstElementChild","reUseCurrentForm","mailerlite_detected_class","apbctPrev","apbctFormOriginal","mailerlite_class","mailerliteSubmitButton","find","sendAjaxCheckingFormData","currentTarget","checkbox","clone","apbct_replace_inputs_values_from_other_form","form_source","form_target","inputs_source","inputs_target","each","elem_source","source","index2","elem_target","formObj","formAction","formId","firstChild","formOriginal","elems","form_new","detach","mautic_integration","placeholders","mautic_hidden_gdpr_id","mautic_gdpr_radio","subm_button","ct_check_internal","currForm","ct_data","alert","submit","ct_check_internal__is_exclude_form","some","blog_home","ctPublicGDPR","gdpr_forms","gdpr_title","first","buttons_collection","gdpr_text","settings__forms__check_external","ct_currForm","ct_currAction","settings__forms__check_internal","off"],"mappings":"MAAMA,UAEFC,gBAAkB,GAClBC,gBAAkB,GAElBC,SAAW,KACXC,SAAW,GAGXC,cACAC,cACAC,MAKAC,YAAYL,GACRM,KAAKC,OAAOP,CAAQ,CACxB,CAQAO,OAAOP,GAkBH,OAhBGA,aAAoBQ,gBACnBF,KAAKN,SAAc,KACnBM,KAAKL,SAAc,GACnBK,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKZ,CAAQ,GACzB,UAApB,OAAOA,GACbM,KAAKN,SAAc,KACnBM,KAAKL,SAAc,GACnBK,KAAKL,SAAS,GAAKD,GACO,UAApB,OAAOA,GACbM,KAAKN,SAAWA,EAChBM,KAA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MAAM,GACrC3C,EAAK2E,OAAO,yBAAyBhE,EAAE,4GAA4G,EACjJgE,OAAO,mDAAmDhE,EAAE,KAAKyf,aAAaK,UAAU,UAAU,EAEtG,CAAC,CAGF,CAFE,MAAOhV,GACR3E,QAAQ+U,KAAK,+CAAiDpQ,CAAC,CAChE,CA3DA,CA4DD,CAAC,EAkMDvG,OAAOuC,OAAS,WAEN,CAAC0I,SAASuQ,iCAIO,aAAlB,OAAO3H,QAIZ3T,WAAW,WACP0W,oBAAoB,CACxB,EAAG,IAAI,CACX,EAoKApc,SAASwC,iBAAiB,mBAAmB,WACzC7B,IACIsgB,EADAC,EAAgB,GAGpB,GAAM,CAACzQ,SAAS0Q,gCAKnB,IAAKxgB,IAAIM,EAAE,EAAGA,EAAEjB,SAAS+R,MAAM7Q,OAAQD,CAAC,GACE,UAApC,OAAOjB,SAAS+R,MAAM9Q,GAAS,QAIiB,QAFpDigB,GADSD,EAAcjhB,SAAS+R,MAAM9Q,IACVkL,QAED/H,QAAQ,WAAW,GACwB,OAAzD8c,EAAcpd,MAAM2M,SAASgQ,UAAY,SAAU,GACjDF,mCAAmCW,CAAa,IAElCD,EAAY3M,MACL,aAAlB,OAAO+E,SACRA,OAAO4H,CAAW,EAAEG,IAAI,IAAI,EAC5B/H,OAAO4H,CAAW,EAAEG,IAAI,EACxB/H,OAAO4H,CAAW,EAAE3e,GAAG,SAAU,SAAS/C,GAEtC,OADA2gB,kBAAkB3gB,EAAMoD,MAAM,EACvB,CAAA,CACX,CAAC,GAKrB,CAAC"}
js/cleantalk-comments-editscreen.min.js CHANGED
@@ -1,2 +1,2 @@
1
- function ct_is_email(e){return e.search(/.*@.*\..*/)}function ct_is_ip(e){return e.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)}function ct_send_feedback_request(t,c,n){var e={action:"ct_feedback_comment",security:ctCommentsScreen.ct_ajax_nonce,comment_id:t,comment_status:c};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){ct_feedback_message_output(t,c,e,n)},error:function(e,t,c){console.log(e),console.log(t),console.log(c)},timeout:5e3})}function ct_feedback_message_output(e,t,c,n){1==c&&("approve"!=t||n||jQuery("tr#comment-"+e).html("").show().append("<td colspan='5'></td>").children("td").css("background","rgba(110,240,110,0.7)").append("<div class='spam-undo-inside'>"+ctCommentsScreen.ct_feedback_msg+"</div>"),"spam"==t&&(jQuery("tr").is("#undo-"+e)?(jQuery("tr#undo-"+e).css("background","rgba(240,110,110,0.7)"),jQuery("tr#undo-"+e+" div.spam-undo-inside").append(" "+ctCommentsScreen.ct_feedback_msg)):jQuery("tr#comment-"+e).html("").show().css("background","rgba(240,110,110,0.7)").append("<td colspan='5'></td>").children("td").append("<div class='spam-undo-inside'>"+ctCommentsScreen.ct_feedback_msg+"</div>")))}jQuery(document).ready(function(){var t;parseInt(ctCommentsScreen.ct_show_check_links)&&jQuery(".column-author a, .comment-author a").each(function(){var e=jQuery(this).html();-1==ct_is_email(e)&&-1==ct_is_ip(e)||jQuery(this).after('&nbsp;<a href="https://cleantalk.org/blacklists/'+e+'" target="_blank" title="https://cleantalk.org/blacklists/'+e+'" class="ct_link_new_tab"><img src="'+ctCommentsScreen.ct_img_src_new_tab+'"></a>')}),jQuery("span.approve").on("click",function(){var e=(e=jQuery(this).children("a").attr("href")).match(/^comment\.php\?.*c=(\d*).*/);t=e[1],ct_send_feedback_request(undo_comment_id=t,"approve",0)}),jQuery("span.unapprove").on("click",function(){var e=(e=jQuery(this).children("a").attr("href")).match(/^comment\.php\?.*c=(\d*).*/);t=e[1],ct_send_feedback_request(undo_comment_id=t,"spam",0)}),jQuery("span.spam").on("click",function(){var e=(e=jQuery(this).children("a").attr("href")).match(/^comment\.php\?.*c=(\d*).*/);t=e[1],ct_send_feedback_request(undo_comment_id=t,"spam",0),setTimeout(function(){jQuery("tr#undo-"+t+" span.unspam a").click(function(){var e=(e=jQuery(this).attr("href")).match(/^comment\.php\?.*&c=(\d*).*/);ct_send_feedback_request(t=e[1],"approve",1)})},202)}),jQuery("span.unspam").on("click",function(){var e=(e=jQuery(this).children("a").attr("href")).match(/^comment\.php\?.*c=(\d*).*/);ct_send_feedback_request(t=e[1],"approve",0)}),jQuery("span.untrash a").on("click",function(){var e=(e=jQuery(this).attr("href")).match(/^comment\.php\?.*c=(\d*).*/);t=e[1],feedback_result=ct_send_feedback_request(t,"approve",0)})});
2
  //# sourceMappingURL=cleantalk-comments-editscreen.min.js.map
1
+ function ct_is_email(e){return e.search(/.*@.*\..*/)}function ct_is_ip(e){return e.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)}function ct_send_feedback_request(t,c,n){var e={action:"ct_feedback_comment",security:ctCommentsScreen.ct_ajax_nonce,comment_id:t,comment_status:c};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){ct_feedback_message_output(t,c,e,n)},error:function(e,t,c){console.log(e),console.log(t),console.log(c)},timeout:5e3})}function ct_feedback_message_output(e,t,c,n){1==c&&("approve"!=t||n||jQuery("tr#comment-"+e).html("").show().append("<td colspan='5'></td>").children("td").css("background","rgba(110,240,110,0.7)").append("<div class='spam-undo-inside'>"+ctCommentsScreen.ct_feedback_msg+"</div>"),"spam"==t)&&(jQuery("tr").is("#undo-"+e)?(jQuery("tr#undo-"+e).css("background","rgba(240,110,110,0.7)"),jQuery("tr#undo-"+e+" div.spam-undo-inside").append(" "+ctCommentsScreen.ct_feedback_msg)):jQuery("tr#comment-"+e).html("").show().css("background","rgba(240,110,110,0.7)").append("<td colspan='5'></td>").children("td").append("<div class='spam-undo-inside'>"+ctCommentsScreen.ct_feedback_msg+"</div>"))}jQuery(document).ready(function(){var t;parseInt(ctCommentsScreen.ct_show_check_links)&&jQuery(".column-author a, .comment-author a").each(function(){var e=jQuery(this).html();-1==ct_is_email(e)&&-1==ct_is_ip(e)||jQuery(this).after('&nbsp;<a href="https://cleantalk.org/blacklists/'+e+'" target="_blank" title="https://cleantalk.org/blacklists/'+e+'" class="ct_link_new_tab"><img src="'+ctCommentsScreen.ct_img_src_new_tab+'"></a>')}),jQuery("span.approve").on("click",function(){var e=(e=jQuery(this).children("a").attr("href")).match(/^comment\.php\?.*c=(\d*).*/);t=e[1],ct_send_feedback_request(undo_comment_id=t,"approve",0)}),jQuery("span.unapprove").on("click",function(){var e=(e=jQuery(this).children("a").attr("href")).match(/^comment\.php\?.*c=(\d*).*/);t=e[1],ct_send_feedback_request(undo_comment_id=t,"spam",0)}),jQuery("span.spam").on("click",function(){var e=(e=jQuery(this).children("a").attr("href")).match(/^comment\.php\?.*c=(\d*).*/);t=e[1],ct_send_feedback_request(undo_comment_id=t,"spam",0),setTimeout(function(){jQuery("tr#undo-"+t+" span.unspam a").click(function(){var e=(e=jQuery(this).attr("href")).match(/^comment\.php\?.*&c=(\d*).*/);ct_send_feedback_request(t=e[1],"approve",1)})},202)}),jQuery("span.unspam").on("click",function(){var e=(e=jQuery(this).children("a").attr("href")).match(/^comment\.php\?.*c=(\d*).*/);ct_send_feedback_request(t=e[1],"approve",0)}),jQuery("span.untrash a").on("click",function(){var e=(e=jQuery(this).attr("href")).match(/^comment\.php\?.*c=(\d*).*/);t=e[1],feedback_result=ct_send_feedback_request(t,"approve",0)})});
2
  //# sourceMappingURL=cleantalk-comments-editscreen.min.js.map
js/cleantalk-comments-editscreen.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cleantalk-comments-editscreen.min.js","sources":["cleantalk-comments-editscreen.js"],"sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\n\t/* Shows link to blacklists near every email and IP address */\n\tif(parseInt(ctCommentsScreen.ct_show_check_links))\n\t\tjQuery('.column-author a, .comment-author a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif(ct_is_email(ct_curr_str) != -1 || ct_is_ip(ct_curr_str) != -1){\n\t\t\t\tjQuery(this).after('&nbsp;<a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctCommentsScreen.ct_img_src_new_tab+'\"></a>');\n\t\t\t}\n\t\t});\n\t\t\n\t/* Feedback for comments */\n\tvar ct_comment_id;\n\t\n\t// For approved\n\tjQuery('span.approve').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\n\t});\n\t\n\t// For unapprove\n\tjQuery('span.unapprove').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\t\t\n\t});\n\t\n\t// For spammed\n\tjQuery('span.spam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\n\t\t\n\t\tsetTimeout(function(){\n\t\t\tjQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){\n\t\t\t\tvar result = jQuery(this).attr('href');\n\t\t\t\tresult = result.match(/^comment\\.php\\?.*&c=(\\d*).*/);\n\t\t\t\tct_comment_id = result[1];\n\t\t\t\tct_send_feedback_request(ct_comment_id, 'approve', 1);\n\t\t\t});\n\t\t}, 202);\n\t\t\n\t});\n\t\n\t// For unspammed\n\tjQuery('span.unspam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\n\t});\n\t\n\t// For untrashed\n\tjQuery('span.untrash a').on('click', function(){\n\t\tvar result = jQuery(this).attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tfeedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\n\t});\t\n});\n\n// Send feedback to backend\nfunction ct_send_feedback_request(ct_comment_id, ct_comment_status, ct_undo){\n\t\n\tvar data = {\n\t\t'action': 'ct_feedback_comment',\n\t\t'security': ctCommentsScreen.ct_ajax_nonce,\n\t\t'comment_id': ct_comment_id,\n\t\t'comment_status': ct_comment_status\n\t};\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tconsole.log(jqXHR);\n\t\t\tconsole.log(textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t},\n timeout: 5000\n\t});\n}\n\n// Outputs CT message about feedback\nfunction ct_feedback_message_output(ct_comment_id, ct_comment_status, ct_result, ct_undo){\n\tif(ct_result == 1){\n\t\tif(ct_comment_status == 'approve' && !ct_undo){\n\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\n\t\t\t\t\t.css('background', 'rgba(110,240,110,0.7)')\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\n\t\t}\n\t\tif(ct_comment_status == 'spam'){\n\t\t\tif(jQuery('tr').is('#undo-'+ct_comment_id)){\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id)\n\t\t\t\t\t.css('background', 'rgba(240,110,110,0.7)');\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id+' div.spam-undo-inside')\n\t\t\t\t\t.append(\" \"+ctCommentsScreen.ct_feedback_msg);\n\t\t\t}else{\n\t\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.css('background', 'rgba(240,110,110,0.7)')\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\n\t\t\t}\n\t\t}\n\t}\n\tif(ct_result == 0){\n\t\t// Error occurred\n\t}if(ct_result == 'no_hash'){\n\t\t// No hash for this comment\n\t}\n}\n"],"names":["ct_is_email","str","search","ct_is_ip","ct_send_feedback_request","ct_comment_id","ct_comment_status","ct_undo","data","action","security","ctCommentsScreen","ct_ajax_nonce","comment_id","comment_status","jQuery","ajax","type","url","ajaxurl","success","msg","ct_feedback_message_output","error","jqXHR","textStatus","errorThrown","console","log","timeout","ct_result","html","show","append","children","css","ct_feedback_msg","is","document","ready","parseInt","ct_show_check_links","each","ct_curr_str","this","after","ct_img_src_new_tab","on","result","attr","match","undo_comment_id","setTimeout","click","feedback_result"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,WAAW,CAC9B,CACA,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,sCAAsC,CACzD,CAuEA,SAASE,yBAAyBC,EAAeC,EAAmBC,GAEnE,IAAIC,EAAO,CACVC,OAAU,sBACVC,SAAYC,iBAAiBC,cAC7BC,WAAcR,EACdS,eAAkBR,CACnB,EAEAS,OAAOC,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLX,KAAMA,EACNY,QAAS,SAASC,GACjBC,2BAA2BjB,EAAeC,EAAmBe,EAAKd,CAAO,CAC1E,EACMgB,MAAO,SAASC,EAAOC,EAAYC,GACxC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comments-editscreen.min.js","sources":["cleantalk-comments-editscreen.js"],"sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\n\t/* Shows link to blacklists near every email and IP address */\n\tif(parseInt(ctCommentsScreen.ct_show_check_links))\n\t\tjQuery('.column-author a, .comment-author a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif(ct_is_email(ct_curr_str) != -1 || ct_is_ip(ct_curr_str) != -1){\n\t\t\t\tjQuery(this).after('&nbsp;<a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctCommentsScreen.ct_img_src_new_tab+'\"></a>');\n\t\t\t}\n\t\t});\n\t\t\n\t/* Feedback for comments */\n\tvar ct_comment_id;\n\t\n\t// For approved\n\tjQuery('span.approve').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\n\t});\n\t\n\t// For unapprove\n\tjQuery('span.unapprove').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\t\t\n\t});\n\t\n\t// For spammed\n\tjQuery('span.spam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\n\t\t\n\t\tsetTimeout(function(){\n\t\t\tjQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){\n\t\t\t\tvar result = jQuery(this).attr('href');\n\t\t\t\tresult = result.match(/^comment\\.php\\?.*&c=(\\d*).*/);\n\t\t\t\tct_comment_id = result[1];\n\t\t\t\tct_send_feedback_request(ct_comment_id, 'approve', 1);\n\t\t\t});\n\t\t}, 202);\n\t\t\n\t});\n\t\n\t// For unspammed\n\tjQuery('span.unspam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\n\t});\n\t\n\t// For untrashed\n\tjQuery('span.untrash a').on('click', function(){\n\t\tvar result = jQuery(this).attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tfeedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\n\t});\t\n});\n\n// Send feedback to backend\nfunction ct_send_feedback_request(ct_comment_id, ct_comment_status, ct_undo){\n\t\n\tvar data = {\n\t\t'action': 'ct_feedback_comment',\n\t\t'security': ctCommentsScreen.ct_ajax_nonce,\n\t\t'comment_id': ct_comment_id,\n\t\t'comment_status': ct_comment_status\n\t};\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tconsole.log(jqXHR);\n\t\t\tconsole.log(textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t},\n timeout: 5000\n\t});\n}\n\n// Outputs CT message about feedback\nfunction ct_feedback_message_output(ct_comment_id, ct_comment_status, ct_result, ct_undo){\n\tif(ct_result == 1){\n\t\tif(ct_comment_status == 'approve' && !ct_undo){\n\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\n\t\t\t\t\t.css('background', 'rgba(110,240,110,0.7)')\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\n\t\t}\n\t\tif(ct_comment_status == 'spam'){\n\t\t\tif(jQuery('tr').is('#undo-'+ct_comment_id)){\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id)\n\t\t\t\t\t.css('background', 'rgba(240,110,110,0.7)');\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id+' div.spam-undo-inside')\n\t\t\t\t\t.append(\" \"+ctCommentsScreen.ct_feedback_msg);\n\t\t\t}else{\n\t\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.css('background', 'rgba(240,110,110,0.7)')\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\n\t\t\t}\n\t\t}\n\t}\n\tif(ct_result == 0){\n\t\t// Error occurred\n\t}if(ct_result == 'no_hash'){\n\t\t// No hash for this comment\n\t}\n}\n"],"names":["ct_is_email","str","search","ct_is_ip","ct_send_feedback_request","ct_comment_id","ct_comment_status","ct_undo","data","action","security","ctCommentsScreen","ct_ajax_nonce","comment_id","comment_status","jQuery","ajax","type","url","ajaxurl","success","msg","ct_feedback_message_output","error","jqXHR","textStatus","errorThrown","console","log","timeout","ct_result","html","show","append","children","css","ct_feedback_msg","is","document","ready","parseInt","ct_show_check_links","each","ct_curr_str","this","after","ct_img_src_new_tab","on","result","attr","match","undo_comment_id","setTimeout","click","feedback_result"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,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,IAAI,EAAEV,SAAS,GAAG,EAAEe,KAAK,MAAM,GACnCC,MAAM,4BAA4B,EAElD9C,yBADAC,EAAgB2C,EAAO,GACiB,UAAW,CAAC,CACrD,CAAC,EAGDjC,OAAO,gBAAgB,EAAEgC,GAAG,QAAS,WACpC,IACAC,GAASA,EADIjC,OAAO6B,IAAI,EAAEK,KAAK,MAAM,GACrBC,MAAM,4BAA4B,EAClD7C,EAAgB2C,EAAO,GACvBM,gBAAkBlD,yBAAyBC,EAAe,UAAW,CAAC,CACvE,CAAC,CACF,CAAC"}
lib/Cleantalk/Antispam/Cleantalk.php CHANGED
@@ -185,41 +185,23 @@ class Cleantalk
185
  $request->method_name = $method;
186
  $request->message = is_array($request->message) ? json_encode($request->message) : $request->message;
187
 
188
- // Wiping cleantalk's headers but, not for send_feedback
189
- if ( $request->method_name !== 'send_feedback' ) {
190
- $ct_tmp = apache_request_headers();
191
-
192
- if ( isset($ct_tmp['Cookie']) ) {
193
- $cookie_name = 'Cookie';
194
- } elseif ( isset($ct_tmp['cookie']) ) {
195
- $cookie_name = 'cookie';
196
- } else {
197
- $cookie_name = 'COOKIE';
198
- }
199
 
200
- if ( $ct_tmp ) {
201
- if ( isset($ct_tmp[$cookie_name]) ) {
202
- $ct_tmp[$cookie_name] = preg_replace(array(
203
- '/\s?ct_checkjs=[a-z0-9]*[^;]*;?/',
204
- '/\s?ct_timezone=.{0,1}\d{1,2}[^;]*;?/',
205
- '/\s?ct_pointer_data=.*5D[^;]*;?/',
206
- '/\s?apbct_timestamp=\d*[^;]*;?/',
207
- '/\s?apbct_site_landing_ts=\d*[^;]*;?/',
208
- '/\s?apbct_cookies_test=%7B.*%7D[^;]*;?/',
209
- '/\s?apbct_prev_referer=http.*?[^;]*;?/',
210
- '/\s?ct_ps_timestamp=.*?[^;]*;?/',
211
- '/\s?ct_fkp_timestamp=\d*?[^;]*;?/',
212
- '/\s?wordpress_ct_sfw_pass_key=\d*?[^;]*;?/',
213
- '/\s?apbct_page_hits=\d*?[^;]*;?/',
214
- '/\s?apbct_visible_fields_count=\d*?[^;]*;?/',
215
- '/\s?apbct_visible_fields=%7B.*%7D[^;]*;?/',
216
- '/\s?apbct_visible_fields_\d=%7B.*%7D[^;]*;?/',
217
- ), '', $ct_tmp[$cookie_name]);
218
- }
219
- $request->all_headers = json_encode($ct_tmp);
220
- }
221
  }
222
 
 
 
223
  return $request;
224
  }
225
 
185
  $request->method_name = $method;
186
  $request->message = is_array($request->message) ? json_encode($request->message) : $request->message;
187
 
188
+ // Wiping session cookies from request
189
+ $ct_tmp = apache_request_headers();
 
 
 
 
 
 
 
 
 
190
 
191
+ if (isset($ct_tmp['Cookie'])) {
192
+ $cookie_name = 'Cookie';
193
+ } elseif (isset($ct_tmp['cookie'])) {
194
+ $cookie_name = 'cookie';
195
+ } else {
196
+ $cookie_name = 'COOKIE';
197
+ }
198
+
199
+ if (isset($ct_tmp[$cookie_name])) {
200
+ unset($ct_tmp[$cookie_name]);
 
 
 
 
 
 
 
 
 
 
 
201
  }
202
 
203
+ $request->all_headers = !empty($ct_tmp) ? json_encode($ct_tmp) : '';
204
+
205
  return $request;
206
  }
207
 
lib/Cleantalk/Antispam/EmailEncoder.php CHANGED
@@ -23,7 +23,18 @@ class EmailEncoder
23
  * Keep arrays of exclusion signs in the array
24
  * @var array
25
  */
26
- private $encoding_exclusions_signs;
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  /**
29
  * @var string
@@ -40,6 +51,12 @@ class EmailEncoder
40
  */
41
  private $response;
42
 
 
 
 
 
 
 
43
  /**
44
  * @inheritDoc
45
  */
@@ -57,13 +74,6 @@ class EmailEncoder
57
  return;
58
  }
59
 
60
- //list of encoding exclusions signs
61
- $this->encoding_exclusions_signs = array(
62
- //divi contact forms additional emails
63
- array('_unique_id', 'et_pb_contact_form'),
64
- array('placeholder') //keep safe placeholders to prevent field breach
65
- );
66
-
67
  $this->secret_key = md5($apbct->api_key);
68
 
69
  $this->encryption_is_available = function_exists('openssl_encrypt') && function_exists('openssl_decrypt');
@@ -105,16 +115,24 @@ class EmailEncoder
105
  return $content;
106
  }
107
 
108
- if ( $this->contentHasExclusions($content) ) {
109
  return $content;
110
  }
111
 
 
 
 
112
  return preg_replace_callback('/(mailto\:\b[_A-Za-z0-9-\.]+@[_A-Za-z0-9-\.]+\.[A-Za-z]{2,})|(\b[_A-Za-z0-9-\.]+@[_A-Za-z0-9-\.]+(\.[A-Za-z]{2,}))/', function ($matches) {
113
 
114
  if ( isset($matches[3]) && in_array(strtolower($matches[3]), ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp']) ) {
115
  return $matches[0];
116
  }
117
 
 
 
 
 
 
118
  if ( $this->isMailto($matches[0]) ) {
119
  return $this->encodeMailtoLink($matches[0]);
120
  }
@@ -296,10 +314,10 @@ class EmailEncoder
296
  * @param $content - content to check
297
  * @return bool - true if exclusions found, else - false
298
  */
299
- private function contentHasExclusions($content)
300
  {
301
- if ( is_array($this->encoding_exclusions_signs) ) {
302
- foreach ( array_values($this->encoding_exclusions_signs) as $_signs_array => $signs ) {
303
  //process each of subarrays of signs
304
  $signs_found_count = 0;
305
  if ( isset($signs) && is_array($signs) ) {
@@ -340,4 +358,23 @@ class EmailEncoder
340
 
341
  return false;
342
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  }
23
  * Keep arrays of exclusion signs in the array
24
  * @var array
25
  */
26
+ private $content_exclusions_signs = array(
27
+ //divi contact forms additional emails
28
+ array('_unique_id', 'et_pb_contact_form'),
29
+ );
30
+
31
+ /**
32
+ * Attribute names to skip content encoding contains them. Keep arrays of tag=>[attributes].
33
+ * @var array[]
34
+ */
35
+ private $attribute_exclusions_signs = array(
36
+ 'input' => array('placeholder', 'value'),
37
+ );
38
 
39
  /**
40
  * @var string
51
  */
52
  private $response;
53
 
54
+ /**
55
+ * Temporary content to use in regexp callback
56
+ * @var string
57
+ */
58
+ private $temp_content;
59
+
60
  /**
61
  * @inheritDoc
62
  */
74
  return;
75
  }
76
 
 
 
 
 
 
 
 
77
  $this->secret_key = md5($apbct->api_key);
78
 
79
  $this->encryption_is_available = function_exists('openssl_encrypt') && function_exists('openssl_decrypt');
115
  return $content;
116
  }
117
 
118
+ if ( $this->hasContentExclusions($content) ) {
119
  return $content;
120
  }
121
 
122
+ //will use this in regexp callback
123
+ $this->temp_content = $content;
124
+
125
  return preg_replace_callback('/(mailto\:\b[_A-Za-z0-9-\.]+@[_A-Za-z0-9-\.]+\.[A-Za-z]{2,})|(\b[_A-Za-z0-9-\.]+@[_A-Za-z0-9-\.]+(\.[A-Za-z]{2,}))/', function ($matches) {
126
 
127
  if ( isset($matches[3]) && in_array(strtolower($matches[3]), ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp']) ) {
128
  return $matches[0];
129
  }
130
 
131
+ //chek if email is placed in excluded attributes and return unchanged if so
132
+ if ( $this->hasAttributeExclusions($matches[0]) ) {
133
+ return $matches[0];
134
+ }
135
+
136
  if ( $this->isMailto($matches[0]) ) {
137
  return $this->encodeMailtoLink($matches[0]);
138
  }
314
  * @param $content - content to check
315
  * @return bool - true if exclusions found, else - false
316
  */
317
+ private function hasContentExclusions($content)
318
  {
319
+ if ( is_array($this->content_exclusions_signs) ) {
320
+ foreach ( array_values($this->content_exclusions_signs) as $_signs_array => $signs ) {
321
  //process each of subarrays of signs
322
  $signs_found_count = 0;
323
  if ( isset($signs) && is_array($signs) ) {
358
 
359
  return false;
360
  }
361
+
362
+ /**
363
+ * Check if email is placed in the tag that has attributes of exclusions.
364
+ * @param $email_match - email
365
+ * @return bool
366
+ */
367
+ private function hasAttributeExclusions($email_match)
368
+ {
369
+ foreach ( $this->attribute_exclusions_signs as $tag => $array_of_attributes ) {
370
+ foreach ( $array_of_attributes as $attribute ) {
371
+ $pattern = '/<' . $tag . '.*' . $attribute . '="' . $email_match . '"/';
372
+ preg_match($pattern, $this->temp_content, $attr_match);
373
+ if ( !empty($attr_match) ) {
374
+ return true;
375
+ }
376
+ }
377
+ }
378
+ return false;
379
+ }
380
  }
lib/Cleantalk/Antispam/Integrations/WpForo.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Cleantalk\Antispam\Integrations;
4
+
5
+ class WpForo extends IntegrationBase
6
+ {
7
+ public function getDataForChecking($argument)
8
+ {
9
+ if (function_exists('apbct_wp_get_current_user')) {
10
+ $user = apbct_wp_get_current_user();
11
+
12
+ if (!empty($user->data->user_email)) {
13
+ /**
14
+ * Filter for POST
15
+ */
16
+ $input_array = apply_filters('apbct__filter_post', $_POST);
17
+
18
+ return ct_get_fields_any($input_array, $user->data->user_email);
19
+ }
20
+ }
21
+
22
+ return array();
23
+ }
24
+
25
+ public function doBlock($message)
26
+ {
27
+ wp_die($message);
28
+ }
29
+ }
lib/Cleantalk/ApbctWP/Variables/Cookie.php CHANGED
@@ -73,7 +73,7 @@ class Cookie extends \Cleantalk\Variables\Cookie
73
  ) {
74
  global $apbct;
75
  //select handling way to set cookie data in dependence of cookie type in the settings
76
- if ($apbct->data['cookies_type'] === 'none' && ! is_admin()) {
77
  return NoCookie::set($name, $value, $no_cookie_to_db);
78
  } elseif ($apbct->data['cookies_type'] === 'alternative') {
79
  AltSessions::set($name, $value);
73
  ) {
74
  global $apbct;
75
  //select handling way to set cookie data in dependence of cookie type in the settings
76
+ if ( $apbct->data['cookies_type'] === 'none' ) {
77
  return NoCookie::set($name, $value, $no_cookie_to_db);
78
  } elseif ($apbct->data['cookies_type'] === 'alternative') {
79
  AltSessions::set($name, $value);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, anti-spam, comments, firewall
4
  Requires at least: 4.7
5
  Tested up to: 6.1
6
  Requires PHP: 5.6
7
- Stable tag: 5.187
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -451,6 +451,30 @@ Yes, it is. Please read this article,
451
 
452
  == Changelog ==
453
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
454
  = 5.187 Oct 20 2022 =
455
  #### New integrations added 🔥, CleanTalk status on the sites list implemented 💣, parameters without cookies improved 🎈 and some minor issues fixed 💪🏼
456
  * New. Integration. Site Reviews Integration.
4
  Requires at least: 4.7
5
  Tested up to: 6.1
6
  Requires PHP: 5.6
7
+ Stable tag: 5.188
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
451
 
452
  == Changelog ==
453
 
454
+ = 5.188 Nov 2 2022 =
455
+ #### Lot of improvements of the EmailEncoder 🔥, wpForo topics and posts protection 💣, a honeypot for Gravity forms, parameters without cookies improved 🎈 and some minor issues fixed 💪🏼
456
+ * New. wpForo - add topic and post under protection
457
+ * New. GravityForms - added honeypot
458
+ * New. Readme. Compatibility tested up to WP 6.1
459
+ * New. EmailEncoder. Exclude content from encoding by tag attributes (at least placeholders and values).
460
+ * Mod. Cloud. Remove all_cookies header before send requests to the cloud.
461
+ * Fix. NoCookie mod. Data collection improvements.
462
+ * Fix. bbPress registration now redirect back to the form on bad submissions.
463
+ * Fix. EmailEncoder. Minor improvements.
464
+ * Fix. EmailEncoder. Decoding process logic fixed.
465
+ * Fix. EmailEncoder. Do not show the comment for the allowed requests.
466
+ * Fix. EmailEncoder. Comment about decoding process fixed.
467
+ * Fix. Common. GDPR checkbox fixed.
468
+ * Fix. WPMS. Custom column on sites list page fixed.
469
+ * Fix. Common. Deleting visible fields hidden input after its processed.
470
+ * Fix. Readme. Requires WP 4.7+.
471
+ * Fix. Integration. Skip some Smart Quiz Builder requests.
472
+ * Fix. Common. Visible fields hidden input value is on base64 now.
473
+ * Fix. JS. ApbctJsLib updated.
474
+ * Fix. Comments. Calling hook 'comment_post' priority fixed.
475
+ * Fix. Mautic integration fixes.
476
+ * Fix. Honeypot flag fixes.
477
+
478
  = 5.187 Oct 20 2022 =
479
  #### New integrations added 🔥, CleanTalk status on the sites list implemented 💣, parameters without cookies improved 🎈 and some minor issues fixed 💪🏼
480
  * New. Integration. Site Reviews Integration.