HubSpot – Free Marketing Plugin for WordPress - Version 1.0.0

Version Description

(2014.06.12) = - Bug fixes - Fixed sort by visits in the contacts list

Download this release

Release Info

Developer AndyGCook
Plugin Icon 128x128 HubSpot – Free Marketing Plugin for WordPress
Version 1.0.0
Comparing to
See all releases

Code changes from version 0.10.0 to 1.0.0

Files changed (51) hide show
  1. admin/inc/class-leadin-list-table.php +202 -89
  2. admin/inc/class-stats-dashboard.php +282 -0
  3. admin/inc/sources/Snowplow/RefererParser/Config/ConfigFileReaderTrait.php +54 -0
  4. admin/inc/sources/Snowplow/RefererParser/Config/ConfigReaderInterface.php +15 -0
  5. admin/inc/sources/Snowplow/RefererParser/Config/JsonConfigReader.php +57 -0
  6. admin/inc/sources/Snowplow/RefererParser/Exception/InvalidArgumentException.php +9 -0
  7. admin/inc/sources/Snowplow/RefererParser/Medium.php +16 -0
  8. admin/inc/sources/Snowplow/RefererParser/Parser.php +121 -0
  9. admin/inc/sources/Snowplow/RefererParser/Referer.php +78 -0
  10. admin/inc/sources/referers.json +3890 -0
  11. admin/leadin-admin.php +445 -23
  12. assets/css/build/leadin-admin.css +5 -3
  13. assets/css/build/leadin-subscribe.css +1 -1
  14. assets/css/select2.css +601 -0
  15. assets/js/admin/leadin-admin.js +0 -12
  16. assets/js/admin/leadin-contacts-admin.js +0 -72
  17. assets/js/build/leadin-admin.js +3798 -9
  18. assets/js/build/leadin-admin.min.js +7 -1
  19. assets/js/{admin/jquery.lazyload.min.js → build/leadin-lazyload.js} +13 -0
  20. assets/js/build/leadin-lazyload.min.js +1 -0
  21. assets/js/build/leadin-subscribe.js +27 -7
  22. assets/js/build/leadin-subscribe.min.js +1 -1
  23. assets/js/build/leadin-tracking.js +27 -3
  24. assets/js/build/leadin-tracking.min.js +1 -1
  25. assets/js/subscribe/leadin-subscribe.js +0 -151
  26. assets/js/subscribe/vex.dialog.js +0 -149
  27. assets/js/subscribe/vex.js +0 -189
  28. assets/js/tracking/jquery.cookie.js +0 -113
  29. assets/js/tracking/leadin.js +0 -501
  30. assets/sass/admin/_contact_detail_page.sass +0 -125
  31. assets/sass/admin/_contacts_list_page.sass +0 -12
  32. assets/sass/admin/_grid.sass +0 -26
  33. assets/sass/admin/_metabox.sass +0 -16
  34. assets/sass/admin/_powerups_page.sass +0 -27
  35. assets/sass/admin/_settings_page.sass +0 -175
  36. assets/sass/admin/_tables.sass +0 -94
  37. assets/sass/admin/_variables.sass +0 -60
  38. assets/sass/leadin-admin.sass +0 -86
  39. assets/sass/leadin-lead-notifcation.sass +0 -63
  40. assets/sass/leadin-subscribe.sass +0 -1
  41. assets/sass/subscribe/_keyframes.sass +0 -141
  42. assets/sass/subscribe/_mixins.sass +0 -31
  43. assets/sass/subscribe/_vex-theme-bottom-right-corner.sass +0 -118
  44. assets/sass/subscribe/_vex-theme-default.sass +0 -133
  45. assets/sass/subscribe/_vex-theme-top.sass +0 -144
  46. assets/sass/subscribe/_vex.sass +0 -135
  47. images/select2-spinner.gif +0 -0
  48. images/select2.png +0 -0
  49. images/select2x2.png +0 -0
  50. inc/class-emailer-new.php +0 -160
  51. inc/class-emailer.php +76 -424
admin/inc/class-leadin-list-table.php CHANGED
@@ -18,6 +18,12 @@ class LI_List_Table extends WP_List_Table {
18
  * Variables
19
  */
20
  public $data = array();
 
 
 
 
 
 
21
 
22
  /**
23
  * Class constructor
@@ -223,16 +229,25 @@ class LI_List_Table extends WP_List_Table {
223
  */
224
  function get_leads ()
225
  {
 
 
 
 
 
 
 
226
  global $wpdb;
227
 
228
  $mysql_search_filter = '';
229
 
 
230
  if ( isset($_GET['s']) )
231
  {
232
  $search_query = $_GET['s'];
233
  $mysql_search_filter = $wpdb->prepare(" AND ( l.lead_email LIKE '%%%s%%' OR l.lead_source LIKE '%%%s%%' ) ", like_escape($search_query), like_escape($search_query));
234
  }
235
 
 
236
  if ( isset($_GET['contact_type']) )
237
  {
238
  $mysql_contact_type_filter = $wpdb->prepare("AND l.lead_status = %s ", $_GET['contact_type']);
@@ -242,57 +257,111 @@ class LI_List_Table extends WP_List_Table {
242
  $mysql_contact_type_filter = " AND ( l.lead_status = 'lead' OR l.lead_status = 'comment' OR l.lead_status = 'subscribe') ";
243
  }
244
 
245
- $q = $wpdb->prepare("
246
- SELECT
247
- l.lead_id AS lead_id,
248
- LOWER(DATE_FORMAT(l.lead_date, %s)) AS lead_date, l.lead_ip, l.lead_source, l.lead_email, l.lead_status, l.hashkey,
249
- COUNT(DISTINCT s.form_id) AS lead_form_submissions,
250
- COUNT(DISTINCT p.pageview_id) AS lead_pageviews,
251
- LOWER(DATE_FORMAT(MAX(p.pageview_date), %s)) AS last_visit
252
- FROM
253
- li_leads l
254
- LEFT JOIN li_submissions s ON l.hashkey = s.lead_hashkey
255
- LEFT JOIN li_pageviews p ON l.hashkey = p.lead_hashkey
256
- WHERE l.lead_email != '' AND l.lead_deleted = 0 ", '%Y/%m/%d %l:%i%p', '%Y/%m/%d %l:%i%p');
 
 
 
 
 
 
 
 
 
257
 
258
- $q .= $mysql_contact_type_filter;
259
- $q .= ( $mysql_search_filter ? $mysql_search_filter : "" );
260
- $q .= " GROUP BY l.lead_email";
 
 
 
 
 
 
261
 
262
- $leads = $wpdb->get_results($q);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
 
264
  $all_leads = array();
265
 
266
  $contact_count = 0;
267
 
268
- foreach ( $leads as $lead )
269
  {
270
- $lead_status = 'Lead';
271
-
272
- if ( $lead->lead_status == 'subscribe' )
273
- $lead_status = 'Subscriber';
274
- else if ( $lead->lead_status == 'comment' )
275
- $lead_status = 'Commenter';
276
-
277
- $url = leadin_strip_params_from_url($lead->lead_source);
278
-
279
- $lead_array = array(
280
- 'ID' => $lead->lead_id,
281
- 'hashkey' => $lead->hashkey,
282
- 'email' => sprintf('<a href="?page=%s&action=%s&lead=%s">' . "<img class='pull-left leadin-contact-avatar leadin-dynamic-avatar_" . substr($lead->lead_id, -1) . "' src='https://app.getsignals.com/avatar/image/?emails=" . $lead->lead_email . "' width='35' height='35'/> " . '</a>', $_REQUEST['page'], 'view', $lead->lead_id) . sprintf('<a href="?page=%s&action=%s&lead=%s"><b>' . $lead->lead_email . '</b></a>', $_REQUEST['page'], 'view', $lead->lead_id),
283
- 'status' => $lead_status,
284
- 'visits' => ( !$lead->lead_visits ? 1 : $lead->lead_visits ),
285
- 'submissions' => $lead->lead_form_submissions,
286
- 'pageviews' => $lead->lead_pageviews,
287
- 'date' => $lead->lead_date,
288
- 'last_visit' => $lead->last_visit,
289
- 'source' => ( $lead->lead_source ? "<a title='Visit page' href='" . $lead->lead_source . "' target='_blank'>" . leadin_strip_params_from_url($lead->lead_source) . "</a>" : 'Direct' )
290
- );
291
-
292
- array_push($all_leads, $lead_array);
293
- $contact_count++;
 
 
 
 
 
 
 
 
 
 
 
294
  }
295
 
 
 
296
  return $all_leads;
297
  }
298
 
@@ -326,8 +395,24 @@ class LI_List_Table extends WP_List_Table {
326
  */
327
  function get_view ()
328
  {
329
- $current = ( !empty($_GET['contact_type']) ? html_entity_decode($_GET['contact_type']) : 'all' );
330
- return $current;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
  }
332
 
333
  /**
@@ -338,77 +423,114 @@ class LI_List_Table extends WP_List_Table {
338
  function get_views ()
339
  {
340
  $views = array();
341
- $totals = $this->get_contact_type_totals();
342
 
343
  $current = ( !empty($_GET['contact_type']) ? html_entity_decode($_GET['contact_type']) : 'all' );
344
- $all_params = array( 'contact_type', 's', 'paged', '_wpnonce', '_wpreferrer', '_wp_http_referer', 'action', 'action2');
345
  $all_url = remove_query_arg($all_params);
346
 
347
  // All link
348
  $class = ( $current == 'all' ? ' class="current"' :'' );
349
- $views['all'] = "<a href='{$all_url }' {$class} >" . ( $totals->total_leads + $totals->total_comments + $totals->total_subscribes ) . " total</a>";
350
 
351
  // Leads link
352
  $leads_url = add_query_arg('contact_type','lead', $all_url);
353
  $class = ( $current == 'lead' ? ' class="current"' :'' );
354
- $views['contacts'] = "<a href='{$leads_url}' {$class} >" . leadin_single_plural_label($totals->total_leads, 'lead', 'leads') . "</a>";
355
 
356
  // Commenters link
357
 
358
  $comments_url = add_query_arg('contact_type','comment', $all_url);
359
  $class = ( $current == 'comment' ? ' class="current"' :'' );
360
- $views['commenters'] = "<a href='{$comments_url}' {$class} >" . leadin_single_plural_label($totals->total_comments, 'commenter', 'commenters') . "</a>";
361
 
362
  // Commenters link
363
  $subscribers_url = add_query_arg('contact_type','subscribe', $all_url);
364
  $class = ( $current == 'subscribe' ? ' class="current"' :'' );
365
- $views['subscribe'] = "<a href='{$subscribers_url}' {$class} >" . leadin_single_plural_label($totals->total_subscribes, 'subscriber', 'subscribers') . "</a>";
366
 
367
  return $views;
368
  }
369
 
370
  /**
371
- * Prints contacts menu above contacts table
372
  */
373
  function views ()
374
  {
375
- $views = $this->get_views();
376
- $views = apply_filters( 'views_' . $this->screen->id, $views );
377
 
378
- $current_view = $this->get_view();
379
 
380
- if ( $current_view == 'lead' )
381
- $view_label = 'Leads';
382
- else if ( $current_view == 'comment' )
383
- $view_label = 'Commenters';
384
- else if ( $current_view == 'subscribe' )
385
- $view_label = 'Subscribers';
 
 
 
 
 
 
 
 
 
386
  else
387
- $view_label = 'Contacts';
 
 
 
388
 
389
- if ( empty( $views ) )
390
  return;
391
 
392
- echo "<div class='top_table_controls'>\n";
 
 
 
 
 
 
 
393
 
394
- echo "<ul class='table_segment_picker'>\n";
395
- foreach ( $views as $class => $view )
396
- {
397
- $views[ $class ] = "\t<li class='$class'>$view";
398
- }
399
- echo implode( "</li>\n", $views ) . "</li>\n";
400
- echo "</ul>";
401
-
402
- echo "<span class='table_search'>\n";
403
- echo "<label class='screen-reader-text' for='post-search-input'>Search Contacts:</label>";
404
- echo "<input type='search' id='leadin-contact-search-input' name='s' value='" . print_submission_val('s') . "'/>";
405
- if ( isset ($_GET['contact_type']) ) {
406
- echo "<input type='hidden' name='contact_type' value='" . print_submission_val('contact_type') . "'/>";
407
- }
408
- echo "<input type='submit' name='' id='leadin-search-submit' class='button' value='Search " . $view_label . "'>";
409
- echo "</span>";
410
 
411
- echo "</div>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  }
413
 
414
  /**
@@ -430,20 +552,11 @@ class LI_List_Table extends WP_List_Table {
430
  $order = ( !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'desc' );
431
 
432
  usort($this->data, array($this, 'usort_reorder'));
433
-
434
  $current_page = $this->get_pagenum();
435
  $total_items = count($this->data);
436
  $this->data = array_slice($this->data, (($current_page-1)*$per_page), $per_page);
437
 
438
- foreach ( $this->data as &$contact )
439
- {
440
- $q = $wpdb->prepare("SELECT COUNT(DISTINCT pageview_id) AS num_pageviews, MAX(pageview_source) AS pageview_source FROM li_pageviews WHERE lead_hashkey = %s AND pageview_session_start = 1 AND pageview_deleted = 0", $contact['hashkey']);
441
- $pageviews = $wpdb->get_row($q);
442
-
443
- $contact['visits'] = $pageviews->num_pageviews;
444
- $contact['source'] = ( $pageviews->pageview_source ? "<a title='Visit page' href='" . $pageviews->pageview_source . "' target='_blank'>" . leadin_strip_params_from_url($pageviews->pageview_source) . "</a>" : 'Direct' );
445
- }
446
-
447
  $this->items = $this->data;
448
 
449
  $this->set_pagination_args( array(
18
  * Variables
19
  */
20
  public $data = array();
21
+ private $current_view;
22
+ public $view_label;
23
+ private $view_count;
24
+ private $views;
25
+ private $totals;
26
+ private $total_filtered;
27
 
28
  /**
29
  * Class constructor
229
  */
230
  function get_leads ()
231
  {
232
+ /***
233
+ == FILTER ARGS ==
234
+ - &visited = visited a specific page url
235
+ - &num_pageviews = visited at least # pages
236
+ - &submitted = submitted a form on specific page url
237
+ */
238
+
239
  global $wpdb;
240
 
241
  $mysql_search_filter = '';
242
 
243
+ // search filter
244
  if ( isset($_GET['s']) )
245
  {
246
  $search_query = $_GET['s'];
247
  $mysql_search_filter = $wpdb->prepare(" AND ( l.lead_email LIKE '%%%s%%' OR l.lead_source LIKE '%%%s%%' ) ", like_escape($search_query), like_escape($search_query));
248
  }
249
 
250
+ // contact type filter
251
  if ( isset($_GET['contact_type']) )
252
  {
253
  $mysql_contact_type_filter = $wpdb->prepare("AND l.lead_status = %s ", $_GET['contact_type']);
257
  $mysql_contact_type_filter = " AND ( l.lead_status = 'lead' OR l.lead_status = 'comment' OR l.lead_status = 'subscribe') ";
258
  }
259
 
260
+ // filter for visiting a specific page
261
+ if ( isset($_GET['filter_action']) && $_GET['filter_action'] == 'visited' )
262
+ {
263
+ $q = $wpdb->prepare("SELECT lead_hashkey FROM li_pageviews WHERE pageview_title LIKE '%%%s%%' GROUP BY lead_hashkey", htmlspecialchars(urldecode($_GET['filter_content'])));
264
+ $filtered_contacts = $wpdb->get_results($q);
265
+
266
+ if ( count($filtered_contacts) )
267
+ {
268
+ $filtered_hashkeys = '';
269
+ for ( $i = 0; $i < count($filtered_contacts); $i++ )
270
+ $filtered_hashkeys .= "'" . $filtered_contacts[$i]->lead_hashkey . "'" . ( $i != (count($filtered_contacts) - 1) ? ', ' : '' );
271
+
272
+ $mysql_search_filter = " AND l.hashkey IN ( " . $filtered_hashkeys . " ) ";
273
+ }
274
+ }
275
+
276
+ // filter for a form submitted on a specific page
277
+ if ( isset($_GET['filter_action']) && $_GET['filter_action'] == 'submitted' )
278
+ {
279
+ $q = $wpdb->prepare("SELECT lead_hashkey FROM li_submissions WHERE form_page_title LIKE '%%%s%%' GROUP BY lead_hashkey", htmlspecialchars(urldecode($_GET['filter_content'])));
280
+ $filtered_contacts = $wpdb->get_results($q);
281
 
282
+ if ( count($filtered_contacts) )
283
+ {
284
+ $filtered_hashkeys = '';
285
+ for ( $i = 0; $i < count($filtered_contacts); $i++ )
286
+ $filtered_hashkeys .= "'" . $filtered_contacts[$i]->lead_hashkey . "'" . ( $i != (count($filtered_contacts) - 1) ? ', ' : '' );
287
+
288
+ $mysql_search_filter = " AND l.hashkey IN ( " . $filtered_hashkeys . " ) ";
289
+ }
290
+ }
291
 
292
+ if ( ( isset($_GET['filter_action']) && $mysql_search_filter ) || !isset($_GET['filter_action']) )
293
+ {
294
+ $q = $wpdb->prepare("
295
+ SELECT
296
+ l.lead_id AS lead_id,
297
+ LOWER(DATE_FORMAT(l.lead_date, %s)) AS lead_date, l.lead_ip, l.lead_source, l.lead_email, l.lead_status, l.hashkey,
298
+ COUNT(DISTINCT s.form_id) AS lead_form_submissions,
299
+ COUNT(DISTINCT p.pageview_id) AS lead_pageviews,
300
+ LOWER(DATE_FORMAT(MAX(p.pageview_date), %s)) AS last_visit,
301
+ ( SELECT COUNT(DISTINCT pageview_id) FROM li_pageviews WHERE lead_hashkey = l.hashkey AND pageview_session_start = 1 AND pageview_deleted = 0 ) AS visits,
302
+ ( SELECT MAX(pageview_source) AS pageview_source FROM li_pageviews WHERE lead_hashkey = l.hashkey AND pageview_session_start = 1 AND pageview_deleted = 0 ) AS pageview_source
303
+ FROM
304
+ li_leads l
305
+ LEFT JOIN li_submissions s ON l.hashkey = s.lead_hashkey
306
+ LEFT JOIN li_pageviews p ON l.hashkey = p.lead_hashkey
307
+ WHERE l.lead_email != '' AND l.lead_deleted = 0 ", '%Y/%m/%d %l:%i%p', '%Y/%m/%d %l:%i%p');
308
+
309
+ $q .= $mysql_contact_type_filter;
310
+ $q .= ( $mysql_search_filter ? $mysql_search_filter : "" );
311
+ $q .= " GROUP BY l.lead_email";
312
+
313
+ $leads = $wpdb->get_results($q);
314
+ }
315
+ else
316
+ {
317
+ $leads = array();
318
+ }
319
 
320
  $all_leads = array();
321
 
322
  $contact_count = 0;
323
 
324
+ if ( count($leads) )
325
  {
326
+ foreach ( $leads as $key => $lead )
327
+ {
328
+ $lead_status = 'Lead';
329
+
330
+ if ( $lead->lead_status == 'subscribe' )
331
+ $lead_status = 'Subscriber';
332
+ else if ( $lead->lead_status == 'comment' )
333
+ $lead_status = 'Commenter';
334
+
335
+ // filter for number of page views and skipping lead if it doesn't meet the minimum
336
+ if ( isset($_GET['filter_action']) && $_GET['filter_action'] == 'num_pageviews' )
337
+ {
338
+ if ( $lead->lead_pageviews < $_GET['filter_content'] )
339
+ continue;
340
+ }
341
+
342
+ $url = leadin_strip_params_from_url($lead->lead_source);
343
+
344
+ $lead_array = array(
345
+ 'ID' => $lead->lead_id,
346
+ 'hashkey' => $lead->hashkey,
347
+ 'email' => sprintf('<a href="?page=%s&action=%s&lead=%s">' . "<img class='pull-left leadin-contact-avatar leadin-dynamic-avatar_" . substr($lead->lead_id, -1) . "' src='https://app.getsignals.com/avatar/image/?emails=" . $lead->lead_email . "' width='35' height='35'/> " . '</a>', $_REQUEST['page'], 'view', $lead->lead_id) . sprintf('<a href="?page=%s&action=%s&lead=%s"><b>' . $lead->lead_email . '</b></a>', $_REQUEST['page'], 'view', $lead->lead_id),
348
+ 'status' => $lead_status,
349
+ 'visits' => ( !isset($lead->visits) ? 1 : $lead->visits ),
350
+ 'submissions' => $lead->lead_form_submissions,
351
+ 'pageviews' => $lead->lead_pageviews,
352
+ 'date' => $lead->lead_date,
353
+ 'source' => ( $lead->pageview_source ? "<a title='Visit page' href='" . $lead->pageview_source . "' target='_blank'>" . leadin_strip_params_from_url($lead->pageview_source) . "</a>" : 'Direct' ),
354
+ 'last_visit' => $lead->last_visit,
355
+ 'source' => ( $lead->lead_source ? "<a title='Visit page' href='" . $lead->lead_source . "' target='_blank'>" . leadin_strip_params_from_url($lead->lead_source) . "</a>" : 'Direct' )
356
+ );
357
+
358
+ array_push($all_leads, $lead_array);
359
+ $contact_count++;
360
+ }
361
  }
362
 
363
+ $this->total_filtered = count($all_leads);
364
+
365
  return $all_leads;
366
  }
367
 
395
  */
396
  function get_view ()
397
  {
398
+ $current_contact_type = ( !empty($_GET['contact_type']) ? html_entity_decode($_GET['contact_type']) : 'contacts' );
399
+ return $current_contact_type;
400
+ }
401
+
402
+ /**
403
+ * Gets the current action filter based off $_GET['contact_type']
404
+ *
405
+ * @return string
406
+ */
407
+ function get_filters ()
408
+ {
409
+ $current_filters = array();
410
+
411
+ $current_filters['contact_type'] = ( !empty($_GET['contact_type']) ? html_entity_decode($_GET['contact_type']) : 'all' );
412
+ $current_filters['action'] = ( !empty($_GET['filter_action']) ? html_entity_decode($_GET['filter_action']) : 'all' );
413
+ $current_filters['content'] = ( !empty($_GET['filter_content']) ? html_entity_decode($_GET['filter_content']) : 'all' );
414
+
415
+ return $current_filters;
416
  }
417
 
418
  /**
423
  function get_views ()
424
  {
425
  $views = array();
426
+ $this->totals = $this->get_contact_type_totals();
427
 
428
  $current = ( !empty($_GET['contact_type']) ? html_entity_decode($_GET['contact_type']) : 'all' );
429
+ $all_params = array( 'contact_type', 's', 'paged', '_wpnonce', '_wpreferrer', '_wp_http_referer', 'action', 'action2', 'filter_action', 'filter_content');
430
  $all_url = remove_query_arg($all_params);
431
 
432
  // All link
433
  $class = ( $current == 'all' ? ' class="current"' :'' );
434
+ $views['all'] = "<a href='{$all_url }' {$class} >" . ( $this->totals->total_leads + $this->totals->total_comments + $this->totals->total_subscribes ) . " total contacts</a>";
435
 
436
  // Leads link
437
  $leads_url = add_query_arg('contact_type','lead', $all_url);
438
  $class = ( $current == 'lead' ? ' class="current"' :'' );
439
+ $views['contacts'] = "<a href='{$leads_url}' {$class} >" . leadin_single_plural_label($this->totals->total_leads, 'lead', 'leads') . "</a>";
440
 
441
  // Commenters link
442
 
443
  $comments_url = add_query_arg('contact_type','comment', $all_url);
444
  $class = ( $current == 'comment' ? ' class="current"' :'' );
445
+ $views['commenters'] = "<a href='{$comments_url}' {$class} >" . leadin_single_plural_label($this->totals->total_comments, 'commenter', 'commenters') . "</a>";
446
 
447
  // Commenters link
448
  $subscribers_url = add_query_arg('contact_type','subscribe', $all_url);
449
  $class = ( $current == 'subscribe' ? ' class="current"' :'' );
450
+ $views['subscribe'] = "<a href='{$subscribers_url}' {$class} >" . leadin_single_plural_label($this->totals->total_subscribes, 'subscriber', 'subscribers') . "</a>";
451
 
452
  return $views;
453
  }
454
 
455
  /**
456
+ * Prints contacts menu next to contacts table
457
  */
458
  function views ()
459
  {
460
+ $this->views = $this->get_views();
461
+ $this->views = apply_filters( 'views_' . $this->screen->id, $this->views );
462
 
463
+ $this->current_view = $this->get_view();
464
 
465
+ if ( $this->current_view == 'lead' )
466
+ {
467
+ $this->view_label = 'Leads';
468
+ $this->view_count = $this->totals->total_leads;
469
+ }
470
+ else if ( $this->current_view == 'comment' )
471
+ {
472
+ $this->view_label = 'Commenters';
473
+ $this->view_count = $this->totals->total_comments;
474
+ }
475
+ else if ( $this->current_view == 'subscribe' )
476
+ {
477
+ $this->view_label = 'Subscribers';
478
+ $this->view_count = $this->totals->total_subscribes;
479
+ }
480
  else
481
+ {
482
+ $this->view_label = 'Contacts';
483
+ $this->view_count = $this->totals->total_leads + $this->totals->total_comments + $this->totals->total_subscribes;
484
+ }
485
 
486
+ if ( empty( $this->views ) )
487
  return;
488
 
489
+ echo "<ul class='leadin-contacts__type-picker'>\n";
490
+ foreach ( $this->views as $class => $view )
491
+ {
492
+ $this->views[ $class ] = "\t<li class='$class'>$view";
493
+ }
494
+ echo implode( "</li>\n", $this->views ) . "</li>\n";
495
+ echo "</ul>";
496
+ }
497
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
498
 
499
+ /**
500
+ * Prints contacts filter above contacts table
501
+ */
502
+ function filters ()
503
+ {
504
+ global $wpdb;
505
+
506
+ $filters = $this->get_filters();
507
+
508
+ ?>
509
+ <form id="leadin-contacts-filter" class="leadin-contacts__filter" method="GET">
510
+
511
+ <h3 class="leadin-contacts__filter-text">
512
+ Viewing <span class="leadin-contacts__filter-count"> <?php echo ( $this->total_filtered != $this->view_count ? $this->total_filtered . '/' : '' ) . strtolower(leadin_single_plural_label($this->view_count, rtrim($this->view_label, 's'), $this->view_label)); ?></span> who
513
+ <select class="select2" name="filter_action" id="filter_action" style="width:200px">
514
+ <option value="visited" <?php echo ( $filters['action']=='visited' ? 'selected' : '' ) ?> >Viewed</option>
515
+ <option value="submitted" <?php echo ( $filters['action']=='submitted' ? 'selected' : '' ) ?> >Submitted a form on</option>
516
+ </select>
517
+
518
+ <input type="hidden" name="filter_content" class="bigdrop" id="filter_content" style="width:300px" value="<?php echo ( isset($_GET['filter_content']) ? stripslashes($_GET['filter_content']) : '' ); ?>"/>
519
+ <input type="submit" name="" id="leadin-contacts-filter-button" class="button action" value="Apply">
520
+
521
+ <?php if ( isset($_GET['filter_action']) || isset($_GET['filter_content']) ) : ?>
522
+ <a href="<?php echo get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_contacts' . ( isset($_GET['contact_type']) ? '&contact_type=' . $_GET['contact_type'] : '' ); ?>" id="clear-filter">clear filter</a>
523
+ <?php endif; ?>
524
+ </h3>
525
+
526
+ <?php if ( isset($_GET['contact_type']) ) : ?>
527
+ <input type="hidden" name="contact_type" value="<?php echo $_GET['contact_type']; ?>"/>
528
+ <?php endif; ?>
529
+
530
+ <input type="hidden" name="page" value="leadin_contacts"/>
531
+
532
+ </form>
533
+ <?php
534
  }
535
 
536
  /**
552
  $order = ( !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'desc' );
553
 
554
  usort($this->data, array($this, 'usort_reorder'));
555
+
556
  $current_page = $this->get_pagenum();
557
  $total_items = count($this->data);
558
  $this->data = array_slice($this->data, (($current_page-1)*$per_page), $per_page);
559
 
 
 
 
 
 
 
 
 
 
560
  $this->items = $this->data;
561
 
562
  $this->set_pagination_args( array(
admin/inc/class-stats-dashboard.php ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ //=============================================
4
+ // Include Needed Files
5
+ //=============================================
6
+
7
+ include_once(LEADIN_PLUGIN_DIR . '/admin/inc/sources/Snowplow/RefererParser/Parser.php');
8
+ include_once(LEADIN_PLUGIN_DIR . '/admin/inc/sources/Snowplow/RefererParser/Referer.php');
9
+ include_once(LEADIN_PLUGIN_DIR . '/admin/inc/sources/Snowplow/RefererParser/Medium.php');
10
+
11
+ //=============================================
12
+ // WPStatsDashboard Class
13
+ //=============================================
14
+ class LI_StatsDashboard {
15
+
16
+ /**
17
+ * Variables
18
+ */
19
+ var $total_contacts = 0;
20
+ var $total_new_contacts = 0;
21
+ var $best_day_ever = 0;
22
+ var $avg_contacts_last_90_days = 0;
23
+ var $total_contacts_last_30_days = 0;
24
+ var $total_contacts_last_90_days = 0;
25
+ var $total_returning_contacts = 0;
26
+ var $max_source = 0;
27
+
28
+ /**
29
+ * Arrays
30
+ */
31
+ var $returning_contacts;
32
+ var $new_contacts;
33
+
34
+ /**
35
+ * Sources counts
36
+ */
37
+ var $organic_count = 0;
38
+ var $referral_count = 0;
39
+ var $social_count = 0;
40
+ var $email_count = 0;
41
+ var $paid_count = 0;
42
+ var $direct_count = 0;
43
+
44
+ var $x_axis_labels = '';
45
+ var $column_colors = '';
46
+ var $column_data = '';
47
+ var $average_data = '';
48
+ var $weekend_column_data = '';
49
+
50
+ var $parser;
51
+
52
+ function __construct ()
53
+ {
54
+ $this->parser = new Parser();
55
+ $this->get_data_last_30_days_graph();
56
+ $this->get_sources();
57
+
58
+ $this->returning_contacts = $this->get_returning_contacts();
59
+ $this->total_returning_contacts = count($this->returning_contacts);
60
+
61
+ $this->new_contacts = $this->get_new_contacts();
62
+ $this->total_new_contacts = count($this->new_contacts);
63
+ }
64
+
65
+ function get_data_last_30_days_graph ()
66
+ {
67
+ global $wpdb;
68
+ $q = "SELECT DATE(lead_date) as lead_date, COUNT(DISTINCT hashkey) contacts FROM li_leads WHERE lead_email != '' GROUP BY DATE(lead_date)";
69
+ $contacts = $wpdb->get_results($q);
70
+
71
+ for ( $i = count($contacts); $i >= 0; $i-- )
72
+ {
73
+ $this->total_contacts += ( $contacts[$i]->contacts ? $contacts[$i]->contacts : 0);
74
+ $this->best_day_ever = ( $contacts[$i]->contacts && $contacts[$i]->contacts > $this->best_day_ever ? $contacts[$i]->contacts : $this->best_day_ever);
75
+ }
76
+
77
+ for ( $i = 90; $i >= 0; $i-- )
78
+ {
79
+ $array_key = leadin_search_object_by_value($contacts, date('Y-m-d', strtotime('-'. $i .' days')), 'lead_date');
80
+ $this->total_contacts_last_90_days += ( $array_key ? $contacts[$array_key]->contacts : 0);
81
+ }
82
+
83
+ $this->avg_contacts_last_90_days = floor($this->total_contacts_last_90_days/90);
84
+
85
+ for ( $i = 31; $i >= 0; $i-- )
86
+ {
87
+ $array_key = leadin_search_object_by_value($contacts, date('Y-m-d', strtotime('-'. $i .' days')), 'lead_date');
88
+
89
+ $this->total_contacts_last_30_days += ( $array_key ? $contacts[$array_key]->contacts : 0);
90
+
91
+ // x axis labels
92
+ $this->x_axis_labels .= "'" . strtoupper(date('M j', strtotime('-'. $i .' days'))) . "'". ( $i != 0 ? "," : "" );
93
+
94
+ // colors for chart columns
95
+ $this->column_colors .= ( $array_key && $contacts[$array_key]->contacts > $this->avg_contacts_last_90_days ? "'#9de596'" : "'#d8d8d8'" ) . ( $i != 0 ? "," : "");
96
+
97
+ // column data points
98
+ $this->column_data .= "{ name: '" . strtoupper(date('M j', strtotime('-'. $i .' days'))) . "', y: " . ( $array_key ? $contacts[$array_key]->contacts : '0' ) . " }" . ( $i != 0 ? ", " : "" );
99
+
100
+ // weekend background column points
101
+ if ( leadin_is_weekend(date('M j', strtotime('-'. $i .' days'))) )
102
+ $this->weekend_column_data .= "{ name: '" . strtoupper(date('M j', strtotime('-'. $i .' days'))) . "', color: 'rgba(0,0,0,.05)', y: " . ( $array_key ? $contacts[$array_key]->contacts : '0' ) . " }" . ( $i != 0 ? ", " : "" );
103
+ else
104
+ $this->weekend_column_data .= "{ name: '" . strtoupper(date('M j', strtotime('-'. $i .' days'))) . "', color: 'rgba(0,0,0,0)', y: " . ( $array_key ? $contacts[$array_key]->contacts : '0' ) . " }" . ( $i != 0 ? ", " : "" );
105
+
106
+ // average line
107
+ if ( $this->avg_contacts_last_90_days )
108
+ {
109
+ $this->average_data .= $this->avg_contacts_last_90_days . ( $i != 0 ? "," : "");
110
+ }
111
+ }
112
+ }
113
+
114
+ function get_returning_contacts ()
115
+ {
116
+ global $wpdb;
117
+
118
+ $q = "
119
+ SELECT
120
+ DISTINCT lead_hashkey lh,
121
+ lead_id,
122
+ lead_email,
123
+ ( SELECT COUNT(*) FROM li_pageviews WHERE lead_hashkey = lh ) as pageviews,
124
+ ( SELECT MAX(pageview_source) AS pageview_source FROM li_pageviews WHERE lead_hashkey = lh AND pageview_session_start = 1 AND pageview_deleted = 0 ) AS lead_source
125
+ FROM
126
+ li_leads, li_pageviews
127
+ WHERE
128
+ pageview_date >= CURRENT_DATE() AND
129
+ li_leads.hashkey = li_pageviews.lead_hashkey AND
130
+ pageview_deleted = 0 AND lead_email != '' AND lead_deleted = 0";
131
+
132
+ return $wpdb->get_results($q);
133
+ }
134
+
135
+ function get_new_contacts ()
136
+ {
137
+ global $wpdb;
138
+
139
+ $q = "
140
+ SELECT DISTINCT lead_hashkey lh,
141
+ lead_id,
142
+ lead_email,
143
+ ( SELECT COUNT(*) FROM li_pageviews WHERE lead_hashkey = lh ) as pageviews,
144
+ ( SELECT MAX(pageview_source) AS pageview_source FROM li_pageviews WHERE lead_hashkey = lh AND pageview_session_start = 1 AND pageview_deleted = 0 ) AS lead_source
145
+ FROM
146
+ li_leads, li_pageviews
147
+ WHERE
148
+ lead_date >= CURRENT_DATE() AND
149
+ li_leads.hashkey = li_pageviews.lead_hashkey AND
150
+ pageview_deleted = 0 AND lead_email != '' AND lead_deleted = 0";
151
+
152
+ return $wpdb->get_results($q);
153
+ }
154
+
155
+ function get_sources ()
156
+ {
157
+ global $wpdb;
158
+
159
+ $q = "SELECT hashkey lh,
160
+ ( SELECT MAX(pageview_source) AS pageview_source FROM li_pageviews WHERE lead_hashkey = lh AND pageview_session_start = 1 AND pageview_deleted = 0 ) AS lead_source
161
+ FROM
162
+ li_leads
163
+ WHERE
164
+ lead_date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE() AND lead_email != ''";
165
+
166
+ $contacts = $wpdb->get_results($q);
167
+
168
+ foreach ( $contacts as $contact )
169
+ {
170
+ $source = $this->check_lead_source($contact->lead_source);
171
+
172
+ switch ( $source )
173
+ {
174
+ case 'search' :
175
+ $this->organic_count++;
176
+ break;
177
+
178
+ case 'social' :
179
+ $this->social_count++;
180
+ break;
181
+
182
+ case 'email' :
183
+ $this->email_count++;
184
+ break;
185
+
186
+ case 'referral' :
187
+ $this->referral_count++;
188
+ break;
189
+
190
+ case 'paid' :
191
+ $this->paid_count++;
192
+ break;
193
+
194
+ case 'direct' :
195
+ $this->direct_count++;
196
+ break;
197
+ }
198
+ }
199
+
200
+ $this->max_source = max(array($this->organic_count, $this->referral_count, $this->social_count, $this->email_count, $this->paid_count, $this->direct_count));
201
+ }
202
+
203
+ function check_lead_source ( $source )
204
+ {
205
+ if ( $source )
206
+ {
207
+ if ( strstr(urldecode($source), 'utm_medium=cpc') || strstr(urldecode($source), 'utm_medium=ppc') )
208
+ return 'paid';
209
+
210
+ if ( strstr($source, 'utm_') )
211
+ {
212
+ $url = $source;
213
+ $url_parts = parse_url($url);
214
+ parse_str($url_parts['query'], $path_parts);
215
+
216
+ if ( isset($path_parts['adurl']) )
217
+ return 'paid';
218
+
219
+ if ( isset($path_parts['utm_medium']) )
220
+ {
221
+ if ( $path_parts['utm_medium'] == 'cpc' || $path_parts['utm_medium'] == 'ppc' )
222
+ return 'paid';
223
+
224
+ if ( $path_parts['utm_medium'] == 'social' )
225
+ return 'social';
226
+
227
+ if ( $path_parts['utm_medium'] == 'email' )
228
+ return 'email';
229
+ }
230
+
231
+ if ( isset($path_parts['utm_source']) )
232
+ {
233
+ if ( strstr($path_parts['utm_source'], 'email') )
234
+ return 'email';
235
+ }
236
+ }
237
+
238
+ $referer = $this->parser->parse(
239
+ $source
240
+ );
241
+
242
+ if ( $referer->isKnown() )
243
+ return $referer->getMedium();
244
+ else
245
+ return 'referral';
246
+ }
247
+ else
248
+ return 'direct';
249
+ }
250
+
251
+ function print_readable_source ( $source )
252
+ {
253
+ switch ( $source )
254
+ {
255
+ case 'search' :
256
+ return 'Organic Search';
257
+ break;
258
+
259
+ case 'social' :
260
+ return 'Social Media';
261
+ break;
262
+
263
+ case 'email' :
264
+ return 'Email Marketing';
265
+ break;
266
+
267
+ case 'referral' :
268
+ return 'Referral';
269
+ break;
270
+
271
+ case 'paid' :
272
+ return 'Paid';
273
+ break;
274
+
275
+ case 'direct' :
276
+ return 'Direct';
277
+ break;
278
+ }
279
+ }
280
+ }
281
+
282
+ ?>
admin/inc/sources/Snowplow/RefererParser/Config/ConfigFileReaderTrait.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ abstract class ConfigFileReaderTrait
4
+ {
5
+ /** @var string */
6
+ private $fileName;
7
+
8
+ /** @var array */
9
+ private $referers = array();
10
+
11
+ public function __construct ()
12
+ {
13
+
14
+ }
15
+
16
+ private function init($fileName)
17
+ {
18
+ if (!file_exists($fileName)) {
19
+ throw InvalidArgumentException::fileNotExists($fileName);
20
+ }
21
+
22
+ $this->fileName = $fileName;
23
+ }
24
+
25
+ abstract protected function parse($content);
26
+
27
+ private function read()
28
+ {
29
+ if ($this->referers) {
30
+ return;
31
+ }
32
+
33
+ $hash = $this->parse(file_get_contents($this->fileName));
34
+
35
+ foreach ($hash as $medium => $referers) {
36
+ foreach ($referers as $source => $referer) {
37
+ foreach ($referer['domains'] as $domain) {
38
+ $this->referers[$domain] = array(
39
+ 'source' => $source,
40
+ 'medium' => $medium,
41
+ 'parameters' => isset($referer['parameters']) ? $referer['parameters'] : array(),
42
+ );
43
+ }
44
+ }
45
+ }
46
+ }
47
+
48
+ public function lookup($lookupString)
49
+ {
50
+ $this->read();
51
+
52
+ return isset($this->referers[$lookupString]) ? $this->referers[$lookupString] : null;
53
+ }
54
+ }
admin/inc/sources/Snowplow/RefererParser/Config/ConfigReaderInterface.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include('ConfigFileReaderTrait.php');
4
+
5
+ abstract class ConfigReaderInterface extends ConfigFileReaderTrait
6
+ {
7
+ /**
8
+ * @param string $lookupString
9
+ * @return array
10
+ */
11
+ public function lookup($lookupString)
12
+ {
13
+
14
+ }
15
+ }
admin/inc/sources/Snowplow/RefererParser/Config/JsonConfigReader.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class JsonConfigReader extends ConfigReaderInterface
4
+ {
5
+ /** @var string */
6
+ private $fileName;
7
+
8
+ /** @var array */
9
+ private $referers = array();
10
+
11
+ public function __construct ( $fileName )
12
+ {
13
+ $this->fileName = $fileName;
14
+ }
15
+
16
+ private function init($fileName)
17
+ {
18
+ if (!file_exists($fileName)) {
19
+ throw InvalidArgumentException::fileNotExists($fileName);
20
+ }
21
+
22
+ $this->fileName = $fileName;
23
+ }
24
+
25
+ private function read()
26
+ {
27
+ if ($this->referers) {
28
+ return;
29
+ }
30
+
31
+ $hash = $this->parse(file_get_contents($this->fileName));
32
+
33
+ foreach ($hash as $medium => $referers) {
34
+ foreach ($referers as $source => $referer) {
35
+ foreach ($referer['domains'] as $domain) {
36
+ $this->referers[$domain] = array(
37
+ 'source' => $source,
38
+ 'medium' => $medium,
39
+ 'parameters' => isset($referer['parameters']) ? $referer['parameters'] : array(),
40
+ );
41
+ }
42
+ }
43
+ }
44
+ }
45
+
46
+ public function lookup($lookupString)
47
+ {
48
+ $this->read();
49
+
50
+ return isset($this->referers[$lookupString]) ? $this->referers[$lookupString] : null;
51
+ }
52
+
53
+ protected function parse($content)
54
+ {
55
+ return json_decode($content, true);
56
+ }
57
+ }
admin/inc/sources/Snowplow/RefererParser/Exception/InvalidArgumentException.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class InvalidArgumentException extends BaseInvalidArgumentException
4
+ {
5
+ public static function fileNotExists($fileName)
6
+ {
7
+ return new static(sprintf('File "%s" does not exist', $fileName));
8
+ }
9
+ }
admin/inc/sources/Snowplow/RefererParser/Medium.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ final class Medium
4
+ {
5
+ const SEARCH = 'search';
6
+
7
+ const SOCIAL = 'social';
8
+
9
+ const UNKNOWN = 'unknown';
10
+
11
+ const INTERNAL = 'internal';
12
+
13
+ const EMAIL = 'email';
14
+
15
+ const INVALID = 'invalid';
16
+ }
admin/inc/sources/Snowplow/RefererParser/Parser.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include_once('Config/ConfigReaderInterface.php');
4
+ include_once('Config/JsonConfigReader.php');
5
+
6
+ class Parser
7
+ {
8
+ /** @var ConfigReaderInterface */
9
+ private $configReader;
10
+
11
+ /**
12
+ * @var string[]
13
+ */
14
+ private $internalHosts = array();
15
+
16
+ public function __construct(ConfigReaderInterface $configReader = null, array $internalHosts = array() )
17
+ {
18
+ $this->configReader = $configReader ? $configReader : self::createDefaultConfigReader();
19
+ $this->internalHosts = $internalHosts;
20
+ }
21
+
22
+ /**
23
+ * Parse referer URL
24
+ *
25
+ * @param string $refererUrl
26
+ * @param string $pageUrl
27
+ * @return Referer
28
+ */
29
+ public function parse($refererUrl, $pageUrl = null)
30
+ {
31
+ $refererParts = $this->parseUrl($refererUrl);
32
+ if (!$refererParts) {
33
+ return Referer::createInvalid();
34
+ }
35
+
36
+ $pageUrlParts = $this->parseUrl($pageUrl);
37
+
38
+ //print_r($refererParts);
39
+
40
+ if ($pageUrlParts
41
+ && $pageUrlParts['host'] === $refererParts['host']
42
+ || in_array($refererParts['host'], $this->internalHosts)) {
43
+ return Referer::createInternal();
44
+ }
45
+
46
+ $referer = $this->lookup($refererParts['host'], $refererParts['path']);
47
+
48
+ if (!$referer) {
49
+ return Referer::createUnknown();
50
+ }
51
+
52
+ $searchTerm = null;
53
+
54
+ if (is_array($referer['parameters'])) {
55
+ parse_str($refererParts['query'], $queryParts);
56
+
57
+ //foreach ($queryParts as $key => $parameter) {
58
+ $searchTerm = isset($queryParts['q']) ? $queryParts['q'] : $searchTerm;
59
+ //}
60
+ }
61
+
62
+ return Referer::createKnown($referer['medium'], $referer['source'], $searchTerm);
63
+ }
64
+
65
+ private static function parseUrl($url)
66
+ {
67
+ if ($url === null) {
68
+ return null;
69
+ }
70
+
71
+ $parts = parse_url($url);
72
+ if (!isset($parts['scheme']) || !in_array(strtolower($parts['scheme']), array('http', 'https'))) {
73
+ return null;
74
+ }
75
+
76
+ return array_merge(array('query' => null, 'path' => '/'), $parts);
77
+ }
78
+
79
+ private function lookup($host, $path)
80
+ {
81
+ $referer = $this->lookupPath($host, $path);
82
+
83
+ if ($referer) {
84
+ return $referer;
85
+ }
86
+
87
+ return $this->lookupHost($host);
88
+ }
89
+
90
+ private function lookupPath($host, $path)
91
+ {
92
+ $referer = $this->lookupHost($host, $path);
93
+
94
+ if ($referer) {
95
+ return $referer;
96
+ }
97
+
98
+ $path = substr($path, 0, strrpos($path, '/'));
99
+
100
+ if (!$path) {
101
+ return null;
102
+ }
103
+
104
+ return $this->lookupPath($host, $path);
105
+ }
106
+
107
+ private function lookupHost($host, $path = null)
108
+ {
109
+ do {
110
+ $referer = $this->configReader->lookup($host . $path);
111
+ $host = substr($host, strpos($host, '.') + 1);
112
+ } while (!$referer && substr_count($host, '.') > 0);
113
+
114
+ return $referer;
115
+ }
116
+
117
+ private static function createDefaultConfigReader()
118
+ {
119
+ return new JsonConfigReader(LEADIN_PLUGIN_DIR . '/admin/inc/sources/referers.json');
120
+ }
121
+ }
admin/inc/sources/Snowplow/RefererParser/Referer.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Referer
4
+ {
5
+ /** @var string */
6
+ private $medium;
7
+
8
+ /** @var string */
9
+ private $source;
10
+
11
+ /** @var string|null */
12
+ private $searchTerm;
13
+
14
+ private function __construct()
15
+ {}
16
+
17
+ public static function createKnown($medium, $source, $searchTerm = null)
18
+ {
19
+ $referer = new self();
20
+ $referer->medium = $medium;
21
+ $referer->source = $source;
22
+ $referer->searchTerm = $searchTerm;
23
+
24
+ return $referer;
25
+ }
26
+
27
+ public static function createUnknown()
28
+ {
29
+ $referer = new self();
30
+ $referer->medium = Medium::UNKNOWN;
31
+
32
+ return $referer;
33
+ }
34
+
35
+ public static function createInternal()
36
+ {
37
+ $referer = new self();
38
+ $referer->medium = Medium::INTERNAL;
39
+
40
+ return $referer;
41
+ }
42
+
43
+ public static function createInvalid()
44
+ {
45
+ $referer = new self();
46
+ $referer->medium = Medium::INVALID;
47
+
48
+ return $referer;
49
+ }
50
+
51
+ /** @return boolean */
52
+ public function isValid()
53
+ {
54
+ return $this->medium !== Medium::INVALID;
55
+ }
56
+
57
+ /** @return boolean */
58
+ public function isKnown()
59
+ {
60
+ return !in_array($this->medium, array(Medium::UNKNOWN, Medium::INTERNAL, Medium::INVALID), true);
61
+ }
62
+
63
+ /** @return string */
64
+ public function getMedium()
65
+ {
66
+ return $this->medium;
67
+ }
68
+
69
+ public function getSource()
70
+ {
71
+ return $this->source;
72
+ }
73
+
74
+ public function getSearchTerm()
75
+ {
76
+ return $this->searchTerm;
77
+ }
78
+ }
admin/inc/sources/referers.json ADDED
@@ -0,0 +1,3890 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "unknown": {
3
+ "Google": {
4
+ "domains": [
5
+ "support.google.com",
6
+ "developers.google.com",
7
+ "maps.google.com",
8
+ "accounts.google.com",
9
+ "drive.google.com",
10
+ "sites.google.com",
11
+ "groups.google.com",
12
+ "groups.google.co.uk",
13
+ "news.google.co.uk"
14
+ ]
15
+ },
16
+ "Yahoo!": {
17
+ "domains": [
18
+ "finance.yahoo.com",
19
+ "news.yahoo.com",
20
+ "eurosport.yahoo.com",
21
+ "sports.yahoo.com",
22
+ "astrology.yahoo.com",
23
+ "travel.yahoo.com",
24
+ "answers.yahoo.com",
25
+ "screen.yahoo.com",
26
+ "weather.yahoo.com",
27
+ "messenger.yahoo.com",
28
+ "games.yahoo.com",
29
+ "shopping.yahoo.net",
30
+ "movies.yahoo.com",
31
+ "cars.yahoo.com",
32
+ "lifestyle.yahoo.com",
33
+ "omg.yahoo.com",
34
+ "match.yahoo.net"
35
+ ]
36
+ }
37
+ },
38
+ "search": {
39
+ "TalkTalk": {
40
+ "domains": [
41
+ "www.talktalk.co.uk"
42
+ ],
43
+ "parameters": [
44
+ "query"
45
+ ]
46
+ },
47
+ "1.cz": {
48
+ "domains": [
49
+ "1.cz"
50
+ ],
51
+ "parameters": [
52
+ "q"
53
+ ]
54
+ },
55
+ "Softonic": {
56
+ "domains": [
57
+ "search.softonic.com"
58
+ ],
59
+ "parameters": [
60
+ "q"
61
+ ]
62
+ },
63
+ "GAIS": {
64
+ "domains": [
65
+ "gais.cs.ccu.edu.tw"
66
+ ],
67
+ "parameters": [
68
+ "q"
69
+ ]
70
+ },
71
+ "Freecause": {
72
+ "domains": [
73
+ "search.freecause.com"
74
+ ],
75
+ "parameters": [
76
+ "p"
77
+ ]
78
+ },
79
+ "RPMFind": {
80
+ "domains": [
81
+ "rpmfind.net",
82
+ "fr2.rpmfind.net"
83
+ ],
84
+ "parameters": [
85
+ "rpmfind.net",
86
+ "fr2.rpmfind.net"
87
+ ]
88
+ },
89
+ "Comcast": {
90
+ "domains": [
91
+ "serach.comcast.net"
92
+ ],
93
+ "parameters": [
94
+ "q"
95
+ ]
96
+ },
97
+ "Voila": {
98
+ "domains": [
99
+ "search.ke.voila.fr",
100
+ "www.lemoteur.fr"
101
+ ],
102
+ "parameters": [
103
+ "rdata"
104
+ ]
105
+ },
106
+ "Nifty": {
107
+ "domains": [
108
+ "search.nifty.com"
109
+ ],
110
+ "parameters": [
111
+ "q"
112
+ ]
113
+ },
114
+ "Atlas": {
115
+ "domains": [
116
+ "searchatlas.centrum.cz"
117
+ ],
118
+ "parameters": [
119
+ "q"
120
+ ]
121
+ },
122
+ "Lo.st": {
123
+ "domains": [
124
+ "lo.st"
125
+ ],
126
+ "parameters": [
127
+ "x_query"
128
+ ]
129
+ },
130
+ "DasTelefonbuch": {
131
+ "domains": [
132
+ "www1.dastelefonbuch.de"
133
+ ],
134
+ "parameters": [
135
+ "kw"
136
+ ]
137
+ },
138
+ "Fireball": {
139
+ "domains": [
140
+ "www.fireball.de"
141
+ ],
142
+ "parameters": [
143
+ "q"
144
+ ]
145
+ },
146
+ "1und1": {
147
+ "domains": [
148
+ "search.1und1.de"
149
+ ],
150
+ "parameters": [
151
+ "su"
152
+ ]
153
+ },
154
+ "Virgilio": {
155
+ "domains": [
156
+ "ricerca.virgilio.it",
157
+ "ricercaimmagini.virgilio.it",
158
+ "ricercavideo.virgilio.it",
159
+ "ricercanews.virgilio.it",
160
+ "mobile.virgilio.it"
161
+ ],
162
+ "parameters": [
163
+ "qs"
164
+ ]
165
+ },
166
+ "Web.nl": {
167
+ "domains": [
168
+ "www.web.nl"
169
+ ],
170
+ "parameters": [
171
+ "zoekwoord"
172
+ ]
173
+ },
174
+ "Plazoo": {
175
+ "domains": [
176
+ "www.plazoo.com"
177
+ ],
178
+ "parameters": [
179
+ "q"
180
+ ]
181
+ },
182
+ "Goyellow.de": {
183
+ "domains": [
184
+ "www.goyellow.de"
185
+ ],
186
+ "parameters": [
187
+ "MDN"
188
+ ]
189
+ },
190
+ "AOL": {
191
+ "domains": [
192
+ "search.aol.com",
193
+ "search.aol.it",
194
+ "aolsearch.aol.com",
195
+ "aolsearch.com",
196
+ "www.aolrecherche.aol.fr",
197
+ "www.aolrecherches.aol.fr",
198
+ "www.aolimages.aol.fr",
199
+ "aim.search.aol.com",
200
+ "www.recherche.aol.fr",
201
+ "find.web.aol.com",
202
+ "recherche.aol.ca",
203
+ "aolsearch.aol.co.uk",
204
+ "search.aol.co.uk",
205
+ "aolrecherche.aol.fr",
206
+ "sucheaol.aol.de",
207
+ "suche.aol.de",
208
+ "suche.aolsvc.de",
209
+ "aolbusqueda.aol.com.mx",
210
+ "alicesuche.aol.de",
211
+ "alicesuchet.aol.de",
212
+ "suchet2.aol.de",
213
+ "search.hp.my.aol.com.au",
214
+ "search.hp.my.aol.de",
215
+ "search.hp.my.aol.it",
216
+ "search-intl.netscape.com"
217
+ ],
218
+ "parameters": [
219
+ "q",
220
+ "query"
221
+ ]
222
+ },
223
+ "Acoon": {
224
+ "domains": [
225
+ "www.acoon.de"
226
+ ],
227
+ "parameters": [
228
+ "begriff"
229
+ ]
230
+ },
231
+ "Free": {
232
+ "domains": [
233
+ "search.free.fr",
234
+ "search1-2.free.fr",
235
+ "search1-1.free.fr"
236
+ ],
237
+ "parameters": [
238
+ "q"
239
+ ]
240
+ },
241
+ "Apollo Latvia": {
242
+ "domains": [
243
+ "apollo.lv/portal/search/"
244
+ ],
245
+ "parameters": [
246
+ "q"
247
+ ]
248
+ },
249
+ "HighBeam": {
250
+ "domains": [
251
+ "www.highbeam.com"
252
+ ],
253
+ "parameters": [
254
+ "q"
255
+ ]
256
+ },
257
+ "I-play": {
258
+ "domains": [
259
+ "start.iplay.com"
260
+ ],
261
+ "parameters": [
262
+ "q"
263
+ ]
264
+ },
265
+ "FriendFeed": {
266
+ "domains": [
267
+ "friendfeed.com"
268
+ ],
269
+ "parameters": [
270
+ "q"
271
+ ]
272
+ },
273
+ "Yasni": {
274
+ "domains": [
275
+ "www.yasni.de",
276
+ "www.yasni.com",
277
+ "www.yasni.co.uk",
278
+ "www.yasni.ch",
279
+ "www.yasni.at"
280
+ ],
281
+ "parameters": [
282
+ "query"
283
+ ]
284
+ },
285
+ "Gigablast": {
286
+ "domains": [
287
+ "www.gigablast.com",
288
+ "dir.gigablast.com"
289
+ ],
290
+ "parameters": [
291
+ "q"
292
+ ]
293
+ },
294
+ "arama": {
295
+ "domains": [
296
+ "arama.com"
297
+ ],
298
+ "parameters": [
299
+ "q"
300
+ ]
301
+ },
302
+ "Fixsuche": {
303
+ "domains": [
304
+ "www.fixsuche.de"
305
+ ],
306
+ "parameters": [
307
+ "q"
308
+ ]
309
+ },
310
+ "Apontador": {
311
+ "domains": [
312
+ "apontador.com.br",
313
+ "www.apontador.com.br"
314
+ ],
315
+ "parameters": [
316
+ "q"
317
+ ]
318
+ },
319
+ "Search.com": {
320
+ "domains": [
321
+ "www.search.com"
322
+ ],
323
+ "parameters": [
324
+ "q"
325
+ ]
326
+ },
327
+ "Monstercrawler": {
328
+ "domains": [
329
+ "www.monstercrawler.com"
330
+ ],
331
+ "parameters": [
332
+ "qry"
333
+ ]
334
+ },
335
+ "Google Images": {
336
+ "domains": [
337
+ "google.ac/imgres",
338
+ "google.ad/imgres",
339
+ "google.ae/imgres",
340
+ "google.am/imgres",
341
+ "google.as/imgres",
342
+ "google.at/imgres",
343
+ "google.az/imgres",
344
+ "google.ba/imgres",
345
+ "google.be/imgres",
346
+ "google.bf/imgres",
347
+ "google.bg/imgres",
348
+ "google.bi/imgres",
349
+ "google.bj/imgres",
350
+ "google.bs/imgres",
351
+ "google.by/imgres",
352
+ "google.ca/imgres",
353
+ "google.cat/imgres",
354
+ "google.cc/imgres",
355
+ "google.cd/imgres",
356
+ "google.cf/imgres",
357
+ "google.cg/imgres",
358
+ "google.ch/imgres",
359
+ "google.ci/imgres",
360
+ "google.cl/imgres",
361
+ "google.cm/imgres",
362
+ "google.cn/imgres",
363
+ "google.co.bw/imgres",
364
+ "google.co.ck/imgres",
365
+ "google.co.cr/imgres",
366
+ "google.co.id/imgres",
367
+ "google.co.il/imgres",
368
+ "google.co.in/imgres",
369
+ "google.co.jp/imgres",
370
+ "google.co.ke/imgres",
371
+ "google.co.kr/imgres",
372
+ "google.co.ls/imgres",
373
+ "google.co.ma/imgres",
374
+ "google.co.mz/imgres",
375
+ "google.co.nz/imgres",
376
+ "google.co.th/imgres",
377
+ "google.co.tz/imgres",
378
+ "google.co.ug/imgres",
379
+ "google.co.uk/imgres",
380
+ "google.co.uz/imgres",
381
+ "google.co.ve/imgres",
382
+ "google.co.vi/imgres",
383
+ "google.co.za/imgres",
384
+ "google.co.zm/imgres",
385
+ "google.co.zw/imgres",
386
+ "google.com/imgres",
387
+ "google.com.af/imgres",
388
+ "google.com.ag/imgres",
389
+ "google.com.ai/imgres",
390
+ "google.com.ar/imgres",
391
+ "google.com.au/imgres",
392
+ "google.com.bd/imgres",
393
+ "google.com.bh/imgres",
394
+ "google.com.bn/imgres",
395
+ "google.com.bo/imgres",
396
+ "google.com.br/imgres",
397
+ "google.com.by/imgres",
398
+ "google.com.bz/imgres",
399
+ "google.com.co/imgres",
400
+ "google.com.cu/imgres",
401
+ "google.com.cy/imgres",
402
+ "google.com.do/imgres",
403
+ "google.com.ec/imgres",
404
+ "google.com.eg/imgres",
405
+ "google.com.et/imgres",
406
+ "google.com.fj/imgres",
407
+ "google.com.gh/imgres",
408
+ "google.com.gi/imgres",
409
+ "google.com.gt/imgres",
410
+ "google.com.hk/imgres",
411
+ "google.com.jm/imgres",
412
+ "google.com.kh/imgres",
413
+ "google.com.kh/imgres",
414
+ "google.com.kw/imgres",
415
+ "google.com.lb/imgres",
416
+ "google.com.lc/imgres",
417
+ "google.com.ly/imgres",
418
+ "google.com.mt/imgres",
419
+ "google.com.mx/imgres",
420
+ "google.com.my/imgres",
421
+ "google.com.na/imgres",
422
+ "google.com.nf/imgres",
423
+ "google.com.ng/imgres",
424
+ "google.com.ni/imgres",
425
+ "google.com.np/imgres",
426
+ "google.com.om/imgres",
427
+ "google.com.pa/imgres",
428
+ "google.com.pe/imgres",
429
+ "google.com.ph/imgres",
430
+ "google.com.pk/imgres",
431
+ "google.com.pr/imgres",
432
+ "google.com.py/imgres",
433
+ "google.com.qa/imgres",
434
+ "google.com.sa/imgres",
435
+ "google.com.sb/imgres",
436
+ "google.com.sg/imgres",
437
+ "google.com.sl/imgres",
438
+ "google.com.sv/imgres",
439
+ "google.com.tj/imgres",
440
+ "google.com.tn/imgres",
441
+ "google.com.tr/imgres",
442
+ "google.com.tw/imgres",
443
+ "google.com.ua/imgres",
444
+ "google.com.uy/imgres",
445
+ "google.com.vc/imgres",
446
+ "google.com.vn/imgres",
447
+ "google.cv/imgres",
448
+ "google.cz/imgres",
449
+ "google.de/imgres",
450
+ "google.dj/imgres",
451
+ "google.dk/imgres",
452
+ "google.dm/imgres",
453
+ "google.dz/imgres",
454
+ "google.ee/imgres",
455
+ "google.es/imgres",
456
+ "google.fi/imgres",
457
+ "google.fm/imgres",
458
+ "google.fr/imgres",
459
+ "google.ga/imgres",
460
+ "google.gd/imgres",
461
+ "google.ge/imgres",
462
+ "google.gf/imgres",
463
+ "google.gg/imgres",
464
+ "google.gl/imgres",
465
+ "google.gm/imgres",
466
+ "google.gp/imgres",
467
+ "google.gr/imgres",
468
+ "google.gy/imgres",
469
+ "google.hn/imgres",
470
+ "google.hr/imgres",
471
+ "google.ht/imgres",
472
+ "google.hu/imgres",
473
+ "google.ie/imgres",
474
+ "google.im/imgres",
475
+ "google.io/imgres",
476
+ "google.iq/imgres",
477
+ "google.is/imgres",
478
+ "google.it/imgres",
479
+ "google.it.ao/imgres",
480
+ "google.je/imgres",
481
+ "google.jo/imgres",
482
+ "google.kg/imgres",
483
+ "google.ki/imgres",
484
+ "google.kz/imgres",
485
+ "google.la/imgres",
486
+ "google.li/imgres",
487
+ "google.lk/imgres",
488
+ "google.lt/imgres",
489
+ "google.lu/imgres",
490
+ "google.lv/imgres",
491
+ "google.md/imgres",
492
+ "google.me/imgres",
493
+ "google.mg/imgres",
494
+ "google.mk/imgres",
495
+ "google.ml/imgres",
496
+ "google.mn/imgres",
497
+ "google.ms/imgres",
498
+ "google.mu/imgres",
499
+ "google.mv/imgres",
500
+ "google.mw/imgres",
501
+ "google.ne/imgres",
502
+ "google.nl/imgres",
503
+ "google.no/imgres",
504
+ "google.nr/imgres",
505
+ "google.nu/imgres",
506
+ "google.pl/imgres",
507
+ "google.pn/imgres",
508
+ "google.ps/imgres",
509
+ "google.pt/imgres",
510
+ "google.ro/imgres",
511
+ "google.rs/imgres",
512
+ "google.ru/imgres",
513
+ "google.rw/imgres",
514
+ "google.sc/imgres",
515
+ "google.se/imgres",
516
+ "google.sh/imgres",
517
+ "google.si/imgres",
518
+ "google.sk/imgres",
519
+ "google.sm/imgres",
520
+ "google.sn/imgres",
521
+ "google.so/imgres",
522
+ "google.st/imgres",
523
+ "google.td/imgres",
524
+ "google.tg/imgres",
525
+ "google.tk/imgres",
526
+ "google.tl/imgres",
527
+ "google.tm/imgres",
528
+ "google.to/imgres",
529
+ "google.tt/imgres",
530
+ "google.us/imgres",
531
+ "google.vg/imgres",
532
+ "google.vu/imgres",
533
+ "images.google.ws",
534
+ "images.google.ac",
535
+ "images.google.ad",
536
+ "images.google.ae",
537
+ "images.google.am",
538
+ "images.google.as",
539
+ "images.google.at",
540
+ "images.google.az",
541
+ "images.google.ba",
542
+ "images.google.be",
543
+ "images.google.bf",
544
+ "images.google.bg",
545
+ "images.google.bi",
546
+ "images.google.bj",
547
+ "images.google.bs",
548
+ "images.google.by",
549
+ "images.google.ca",
550
+ "images.google.cat",
551
+ "images.google.cc",
552
+ "images.google.cd",
553
+ "images.google.cf",
554
+ "images.google.cg",
555
+ "images.google.ch",
556
+ "images.google.ci",
557
+ "images.google.cl",
558
+ "images.google.cm",
559
+ "images.google.cn",
560
+ "images.google.co.bw",
561
+ "images.google.co.ck",
562
+ "images.google.co.cr",
563
+ "images.google.co.id",
564
+ "images.google.co.il",
565
+ "images.google.co.in",
566
+ "images.google.co.jp",
567
+ "images.google.co.ke",
568
+ "images.google.co.kr",
569
+ "images.google.co.ls",
570
+ "images.google.co.ma",
571
+ "images.google.co.mz",
572
+ "images.google.co.nz",
573
+ "images.google.co.th",
574
+ "images.google.co.tz",
575
+ "images.google.co.ug",
576
+ "images.google.co.uk",
577
+ "images.google.co.uz",
578
+ "images.google.co.ve",
579
+ "images.google.co.vi",
580
+ "images.google.co.za",
581
+ "images.google.co.zm",
582
+ "images.google.co.zw",
583
+ "images.google.com",
584
+ "images.google.com.af",
585
+ "images.google.com.ag",
586
+ "images.google.com.ai",
587
+ "images.google.com.ar",
588
+ "images.google.com.au",
589
+ "images.google.com.bd",
590
+ "images.google.com.bh",
591
+ "images.google.com.bn",
592
+ "images.google.com.bo",
593
+ "images.google.com.br",
594
+ "images.google.com.by",
595
+ "images.google.com.bz",
596
+ "images.google.com.co",
597
+ "images.google.com.cu",
598
+ "images.google.com.cy",
599
+ "images.google.com.do",
600
+ "images.google.com.ec",
601
+ "images.google.com.eg",
602
+ "images.google.com.et",
603
+ "images.google.com.fj",
604
+ "images.google.com.gh",
605
+ "images.google.com.gi",
606
+ "images.google.com.gt",
607
+ "images.google.com.hk",
608
+ "images.google.com.jm",
609
+ "images.google.com.kh",
610
+ "images.google.com.kh",
611
+ "images.google.com.kw",
612
+ "images.google.com.lb",
613
+ "images.google.com.lc",
614
+ "images.google.com.ly",
615
+ "images.google.com.mt",
616
+ "images.google.com.mx",
617
+ "images.google.com.my",
618
+ "images.google.com.na",
619
+ "images.google.com.nf",
620
+ "images.google.com.ng",
621
+ "images.google.com.ni",
622
+ "images.google.com.np",
623
+ "images.google.com.om",
624
+ "images.google.com.pa",
625
+ "images.google.com.pe",
626
+ "images.google.com.ph",
627
+ "images.google.com.pk",
628
+ "images.google.com.pr",
629
+ "images.google.com.py",
630
+ "images.google.com.qa",
631
+ "images.google.com.sa",
632
+ "images.google.com.sb",
633
+ "images.google.com.sg",
634
+ "images.google.com.sl",
635
+ "images.google.com.sv",
636
+ "images.google.com.tj",
637
+ "images.google.com.tn",
638
+ "images.google.com.tr",
639
+ "images.google.com.tw",
640
+ "images.google.com.ua",
641
+ "images.google.com.uy",
642
+ "images.google.com.vc",
643
+ "images.google.com.vn",
644
+ "images.google.cv",
645
+ "images.google.cz",
646
+ "images.google.de",
647
+ "images.google.dj",
648
+ "images.google.dk",
649
+ "images.google.dm",
650
+ "images.google.dz",
651
+ "images.google.ee",
652
+ "images.google.es",
653
+ "images.google.fi",
654
+ "images.google.fm",
655
+ "images.google.fr",
656
+ "images.google.ga",
657
+ "images.google.gd",
658
+ "images.google.ge",
659
+ "images.google.gf",
660
+ "images.google.gg",
661
+ "images.google.gl",
662
+ "images.google.gm",
663
+ "images.google.gp",
664
+ "images.google.gr",
665
+ "images.google.gy",
666
+ "images.google.hn",
667
+ "images.google.hr",
668
+ "images.google.ht",
669
+ "images.google.hu",
670
+ "images.google.ie",
671
+ "images.google.im",
672
+ "images.google.io",
673
+ "images.google.iq",
674
+ "images.google.is",
675
+ "images.google.it",
676
+ "images.google.it.ao",
677
+ "images.google.je",
678
+ "images.google.jo",
679
+ "images.google.kg",
680
+ "images.google.ki",
681
+ "images.google.kz",
682
+ "images.google.la",
683
+ "images.google.li",
684
+ "images.google.lk",
685
+ "images.google.lt",
686
+ "images.google.lu",
687
+ "images.google.lv",
688
+ "images.google.md",
689
+ "images.google.me",
690
+ "images.google.mg",
691
+ "images.google.mk",
692
+ "images.google.ml",
693
+ "images.google.mn",
694
+ "images.google.ms",
695
+ "images.google.mu",
696
+ "images.google.mv",
697
+ "images.google.mw",
698
+ "images.google.ne",
699
+ "images.google.nl",
700
+ "images.google.no",
701
+ "images.google.nr",
702
+ "images.google.nu",
703
+ "images.google.pl",
704
+ "images.google.pn",
705
+ "images.google.ps",
706
+ "images.google.pt",
707
+ "images.google.ro",
708
+ "images.google.rs",
709
+ "images.google.ru",
710
+ "images.google.rw",
711
+ "images.google.sc",
712
+ "images.google.se",
713
+ "images.google.sh",
714
+ "images.google.si",
715
+ "images.google.sk",
716
+ "images.google.sm",
717
+ "images.google.sn",
718
+ "images.google.so",
719
+ "images.google.st",
720
+ "images.google.td",
721
+ "images.google.tg",
722
+ "images.google.tk",
723
+ "images.google.tl",
724
+ "images.google.tm",
725
+ "images.google.to",
726
+ "images.google.tt",
727
+ "images.google.us",
728
+ "images.google.vg",
729
+ "images.google.vu",
730
+ "images.google.ws"
731
+ ],
732
+ "parameters": [
733
+ "q"
734
+ ]
735
+ },
736
+ "ABCs\u00f8k": {
737
+ "domains": [
738
+ "abcsolk.no",
739
+ "verden.abcsok.no"
740
+ ],
741
+ "parameters": [
742
+ "q"
743
+ ]
744
+ },
745
+ "Google Product Search": {
746
+ "domains": [
747
+ "google.ac/products",
748
+ "google.ad/products",
749
+ "google.ae/products",
750
+ "google.am/products",
751
+ "google.as/products",
752
+ "google.at/products",
753
+ "google.az/products",
754
+ "google.ba/products",
755
+ "google.be/products",
756
+ "google.bf/products",
757
+ "google.bg/products",
758
+ "google.bi/products",
759
+ "google.bj/products",
760
+ "google.bs/products",
761
+ "google.by/products",
762
+ "google.ca/products",
763
+ "google.cat/products",
764
+ "google.cc/products",
765
+ "google.cd/products",
766
+ "google.cf/products",
767
+ "google.cg/products",
768
+ "google.ch/products",
769
+ "google.ci/products",
770
+ "google.cl/products",
771
+ "google.cm/products",
772
+ "google.cn/products",
773
+ "google.co.bw/products",
774
+ "google.co.ck/products",
775
+ "google.co.cr/products",
776
+ "google.co.id/products",
777
+ "google.co.il/products",
778
+ "google.co.in/products",
779
+ "google.co.jp/products",
780
+ "google.co.ke/products",
781
+ "google.co.kr/products",
782
+ "google.co.ls/products",
783
+ "google.co.ma/products",
784
+ "google.co.mz/products",
785
+ "google.co.nz/products",
786
+ "google.co.th/products",
787
+ "google.co.tz/products",
788
+ "google.co.ug/products",
789
+ "google.co.uk/products",
790
+ "google.co.uz/products",
791
+ "google.co.ve/products",
792
+ "google.co.vi/products",
793
+ "google.co.za/products",
794
+ "google.co.zm/products",
795
+ "google.co.zw/products",
796
+ "google.com/products",
797
+ "google.com.af/products",
798
+ "google.com.ag/products",
799
+ "google.com.ai/products",
800
+ "google.com.ar/products",
801
+ "google.com.au/products",
802
+ "google.com.bd/products",
803
+ "google.com.bh/products",
804
+ "google.com.bn/products",
805
+ "google.com.bo/products",
806
+ "google.com.br/products",
807
+ "google.com.by/products",
808
+ "google.com.bz/products",
809
+ "google.com.co/products",
810
+ "google.com.cu/products",
811
+ "google.com.cy/products",
812
+ "google.com.do/products",
813
+ "google.com.ec/products",
814
+ "google.com.eg/products",
815
+ "google.com.et/products",
816
+ "google.com.fj/products",
817
+ "google.com.gh/products",
818
+ "google.com.gi/products",
819
+ "google.com.gt/products",
820
+ "google.com.hk/products",
821
+ "google.com.jm/products",
822
+ "google.com.kh/products",
823
+ "google.com.kh/products",
824
+ "google.com.kw/products",
825
+ "google.com.lb/products",
826
+ "google.com.lc/products",
827
+ "google.com.ly/products",
828
+ "google.com.mt/products",
829
+ "google.com.mx/products",
830
+ "google.com.my/products",
831
+ "google.com.na/products",
832
+ "google.com.nf/products",
833
+ "google.com.ng/products",
834
+ "google.com.ni/products",
835
+ "google.com.np/products",
836
+ "google.com.om/products",
837
+ "google.com.pa/products",
838
+ "google.com.pe/products",
839
+ "google.com.ph/products",
840
+ "google.com.pk/products",
841
+ "google.com.pr/products",
842
+ "google.com.py/products",
843
+ "google.com.qa/products",
844
+ "google.com.sa/products",
845
+ "google.com.sb/products",
846
+ "google.com.sg/products",
847
+ "google.com.sl/products",
848
+ "google.com.sv/products",
849
+ "google.com.tj/products",
850
+ "google.com.tn/products",
851
+ "google.com.tr/products",
852
+ "google.com.tw/products",
853
+ "google.com.ua/products",
854
+ "google.com.uy/products",
855
+ "google.com.vc/products",
856
+ "google.com.vn/products",
857
+ "google.cv/products",
858
+ "google.cz/products",
859
+ "google.de/products",
860
+ "google.dj/products",
861
+ "google.dk/products",
862
+ "google.dm/products",
863
+ "google.dz/products",
864
+ "google.ee/products",
865
+ "google.es/products",
866
+ "google.fi/products",
867
+ "google.fm/products",
868
+ "google.fr/products",
869
+ "google.ga/products",
870
+ "google.gd/products",
871
+ "google.ge/products",
872
+ "google.gf/products",
873
+ "google.gg/products",
874
+ "google.gl/products",
875
+ "google.gm/products",
876
+ "google.gp/products",
877
+ "google.gr/products",
878
+ "google.gy/products",
879
+ "google.hn/products",
880
+ "google.hr/products",
881
+ "google.ht/products",
882
+ "google.hu/products",
883
+ "google.ie/products",
884
+ "google.im/products",
885
+ "google.io/products",
886
+ "google.iq/products",
887
+ "google.is/products",
888
+ "google.it/products",
889
+ "google.it.ao/products",
890
+ "google.je/products",
891
+ "google.jo/products",
892
+ "google.kg/products",
893
+ "google.ki/products",
894
+ "google.kz/products",
895
+ "google.la/products",
896
+ "google.li/products",
897
+ "google.lk/products",
898
+ "google.lt/products",
899
+ "google.lu/products",
900
+ "google.lv/products",
901
+ "google.md/products",
902
+ "google.me/products",
903
+ "google.mg/products",
904
+ "google.mk/products",
905
+ "google.ml/products",
906
+ "google.mn/products",
907
+ "google.ms/products",
908
+ "google.mu/products",
909
+ "google.mv/products",
910
+ "google.mw/products",
911
+ "google.ne/products",
912
+ "google.nl/products",
913
+ "google.no/products",
914
+ "google.nr/products",
915
+ "google.nu/products",
916
+ "google.pl/products",
917
+ "google.pn/products",
918
+ "google.ps/products",
919
+ "google.pt/products",
920
+ "google.ro/products",
921
+ "google.rs/products",
922
+ "google.ru/products",
923
+ "google.rw/products",
924
+ "google.sc/products",
925
+ "google.se/products",
926
+ "google.sh/products",
927
+ "google.si/products",
928
+ "google.sk/products",
929
+ "google.sm/products",
930
+ "google.sn/products",
931
+ "google.so/products",
932
+ "google.st/products",
933
+ "google.td/products",
934
+ "google.tg/products",
935
+ "google.tk/products",
936
+ "google.tl/products",
937
+ "google.tm/products",
938
+ "google.to/products",
939
+ "google.tt/products",
940
+ "google.us/products",
941
+ "google.vg/products",
942
+ "google.vu/products",
943
+ "google.ws/products",
944
+ "www.google.ac/products",
945
+ "www.google.ad/products",
946
+ "www.google.ae/products",
947
+ "www.google.am/products",
948
+ "www.google.as/products",
949
+ "www.google.at/products",
950
+ "www.google.az/products",
951
+ "www.google.ba/products",
952
+ "www.google.be/products",
953
+ "www.google.bf/products",
954
+ "www.google.bg/products",
955
+ "www.google.bi/products",
956
+ "www.google.bj/products",
957
+ "www.google.bs/products",
958
+ "www.google.by/products",
959
+ "www.google.ca/products",
960
+ "www.google.cat/products",
961
+ "www.google.cc/products",
962
+ "www.google.cd/products",
963
+ "www.google.cf/products",
964
+ "www.google.cg/products",
965
+ "www.google.ch/products",
966
+ "www.google.ci/products",
967
+ "www.google.cl/products",
968
+ "www.google.cm/products",
969
+ "www.google.cn/products",
970
+ "www.google.co.bw/products",
971
+ "www.google.co.ck/products",
972
+ "www.google.co.cr/products",
973
+ "www.google.co.id/products",
974
+ "www.google.co.il/products",
975
+ "www.google.co.in/products",
976
+ "www.google.co.jp/products",
977
+ "www.google.co.ke/products",
978
+ "www.google.co.kr/products",
979
+ "www.google.co.ls/products",
980
+ "www.google.co.ma/products",
981
+ "www.google.co.mz/products",
982
+ "www.google.co.nz/products",
983
+ "www.google.co.th/products",
984
+ "www.google.co.tz/products",
985
+ "www.google.co.ug/products",
986
+ "www.google.co.uk/products",
987
+ "www.google.co.uz/products",
988
+ "www.google.co.ve/products",
989
+ "www.google.co.vi/products",
990
+ "www.google.co.za/products",
991
+ "www.google.co.zm/products",
992
+ "www.google.co.zw/products",
993
+ "www.google.com/products",
994
+ "www.google.com.af/products",
995
+ "www.google.com.ag/products",
996
+ "www.google.com.ai/products",
997
+ "www.google.com.ar/products",
998
+ "www.google.com.au/products",
999
+ "www.google.com.bd/products",
1000
+ "www.google.com.bh/products",
1001
+ "www.google.com.bn/products",
1002
+ "www.google.com.bo/products",
1003
+ "www.google.com.br/products",
1004
+ "www.google.com.by/products",
1005
+ "www.google.com.bz/products",
1006
+ "www.google.com.co/products",
1007
+ "www.google.com.cu/products",
1008
+ "www.google.com.cy/products",
1009
+ "www.google.com.do/products",
1010
+ "www.google.com.ec/products",
1011
+ "www.google.com.eg/products",
1012
+ "www.google.com.et/products",
1013
+ "www.google.com.fj/products",
1014
+ "www.google.com.gh/products",
1015
+ "www.google.com.gi/products",
1016
+ "www.google.com.gt/products",
1017
+ "www.google.com.hk/products",
1018
+ "www.google.com.jm/products",
1019
+ "www.google.com.kh/products",
1020
+ "www.google.com.kh/products",
1021
+ "www.google.com.kw/products",
1022
+ "www.google.com.lb/products",
1023
+ "www.google.com.lc/products",
1024
+ "www.google.com.ly/products",
1025
+ "www.google.com.mt/products",
1026
+ "www.google.com.mx/products",
1027
+ "www.google.com.my/products",
1028
+ "www.google.com.na/products",
1029
+ "www.google.com.nf/products",
1030
+ "www.google.com.ng/products",
1031
+ "www.google.com.ni/products",
1032
+ "www.google.com.np/products",
1033
+ "www.google.com.om/products",
1034
+ "www.google.com.pa/products",
1035
+ "www.google.com.pe/products",
1036
+ "www.google.com.ph/products",
1037
+ "www.google.com.pk/products",
1038
+ "www.google.com.pr/products",
1039
+ "www.google.com.py/products",
1040
+ "www.google.com.qa/products",
1041
+ "www.google.com.sa/products",
1042
+ "www.google.com.sb/products",
1043
+ "www.google.com.sg/products",
1044
+ "www.google.com.sl/products",
1045
+ "www.google.com.sv/products",
1046
+ "www.google.com.tj/products",
1047
+ "www.google.com.tn/products",
1048
+ "www.google.com.tr/products",
1049
+ "www.google.com.tw/products",
1050
+ "www.google.com.ua/products",
1051
+ "www.google.com.uy/products",
1052
+ "www.google.com.vc/products",
1053
+ "www.google.com.vn/products",
1054
+ "www.google.cv/products",
1055
+ "www.google.cz/products",
1056
+ "www.google.de/products",
1057
+ "www.google.dj/products",
1058
+ "www.google.dk/products",
1059
+ "www.google.dm/products",
1060
+ "www.google.dz/products",
1061
+ "www.google.ee/products",
1062
+ "www.google.es/products",
1063
+ "www.google.fi/products",
1064
+ "www.google.fm/products",
1065
+ "www.google.fr/products",
1066
+ "www.google.ga/products",
1067
+ "www.google.gd/products",
1068
+ "www.google.ge/products",
1069
+ "www.google.gf/products",
1070
+ "www.google.gg/products",
1071
+ "www.google.gl/products",
1072
+ "www.google.gm/products",
1073
+ "www.google.gp/products",
1074
+ "www.google.gr/products",
1075
+ "www.google.gy/products",
1076
+ "www.google.hn/products",
1077
+ "www.google.hr/products",
1078
+ "www.google.ht/products",
1079
+ "www.google.hu/products",
1080
+ "www.google.ie/products",
1081
+ "www.google.im/products",
1082
+ "www.google.io/products",
1083
+ "www.google.iq/products",
1084
+ "www.google.is/products",
1085
+ "www.google.it/products",
1086
+ "www.google.it.ao/products",
1087
+ "www.google.je/products",
1088
+ "www.google.jo/products",
1089
+ "www.google.kg/products",
1090
+ "www.google.ki/products",
1091
+ "www.google.kz/products",
1092
+ "www.google.la/products",
1093
+ "www.google.li/products",
1094
+ "www.google.lk/products",
1095
+ "www.google.lt/products",
1096
+ "www.google.lu/products",
1097
+ "www.google.lv/products",
1098
+ "www.google.md/products",
1099
+ "www.google.me/products",
1100
+ "www.google.mg/products",
1101
+ "www.google.mk/products",
1102
+ "www.google.ml/products",
1103
+ "www.google.mn/products",
1104
+ "www.google.ms/products",
1105
+ "www.google.mu/products",
1106
+ "www.google.mv/products",
1107
+ "www.google.mw/products",
1108
+ "www.google.ne/products",
1109
+ "www.google.nl/products",
1110
+ "www.google.no/products",
1111
+ "www.google.nr/products",
1112
+ "www.google.nu/products",
1113
+ "www.google.pl/products",
1114
+ "www.google.pn/products",
1115
+ "www.google.ps/products",
1116
+ "www.google.pt/products",
1117
+ "www.google.ro/products",
1118
+ "www.google.rs/products",
1119
+ "www.google.ru/products",
1120
+ "www.google.rw/products",
1121
+ "www.google.sc/products",
1122
+ "www.google.se/products",
1123
+ "www.google.sh/products",
1124
+ "www.google.si/products",
1125
+ "www.google.sk/products",
1126
+ "www.google.sm/products",
1127
+ "www.google.sn/products",
1128
+ "www.google.so/products",
1129
+ "www.google.st/products",
1130
+ "www.google.td/products",
1131
+ "www.google.tg/products",
1132
+ "www.google.tk/products",
1133
+ "www.google.tl/products",
1134
+ "www.google.tm/products",
1135
+ "www.google.to/products",
1136
+ "www.google.tt/products",
1137
+ "www.google.us/products",
1138
+ "www.google.vg/products",
1139
+ "www.google.vu/products",
1140
+ "www.google.ws/products"
1141
+ ],
1142
+ "parameters": [
1143
+ "q"
1144
+ ]
1145
+ },
1146
+ "DasOertliche": {
1147
+ "domains": [
1148
+ "www.dasoertliche.de"
1149
+ ],
1150
+ "parameters": [
1151
+ "kw"
1152
+ ]
1153
+ },
1154
+ "InfoSpace": {
1155
+ "domains": [
1156
+ "infospace.com",
1157
+ "dogpile.com",
1158
+ "www.dogpile.com",
1159
+ "metacrawler.com",
1160
+ "webfetch.com",
1161
+ "webcrawler.com",
1162
+ "search.kiwee.com",
1163
+ "isearch.babylon.com",
1164
+ "start.facemoods.com",
1165
+ "search.magnetic.com",
1166
+ "search.searchcompletion.com",
1167
+ "clusty.com"
1168
+ ],
1169
+ "parameters": [
1170
+ "q",
1171
+ "s"
1172
+ ]
1173
+ },
1174
+ "Weborama": {
1175
+ "domains": [
1176
+ "www.weborama.com"
1177
+ ],
1178
+ "parameters": [
1179
+ "QUERY"
1180
+ ]
1181
+ },
1182
+ "Bluewin": {
1183
+ "domains": [
1184
+ "search.bluewin.ch"
1185
+ ],
1186
+ "parameters": [
1187
+ "searchTerm"
1188
+ ]
1189
+ },
1190
+ "Neti": {
1191
+ "domains": [
1192
+ "www.neti.ee"
1193
+ ],
1194
+ "parameters": [
1195
+ "query"
1196
+ ]
1197
+ },
1198
+ "Winamp": {
1199
+ "domains": [
1200
+ "search.winamp.com"
1201
+ ],
1202
+ "parameters": [
1203
+ "q"
1204
+ ]
1205
+ },
1206
+ "Nigma": {
1207
+ "domains": [
1208
+ "nigma.ru"
1209
+ ],
1210
+ "parameters": [
1211
+ "s"
1212
+ ]
1213
+ },
1214
+ "Yahoo! Images": {
1215
+ "domains": [
1216
+ "image.yahoo.cn",
1217
+ "images.search.yahoo.com"
1218
+ ],
1219
+ "parameters": [
1220
+ "p",
1221
+ "q"
1222
+ ]
1223
+ },
1224
+ "Exalead": {
1225
+ "domains": [
1226
+ "www.exalead.fr",
1227
+ "www.exalead.com"
1228
+ ],
1229
+ "parameters": [
1230
+ "q"
1231
+ ]
1232
+ },
1233
+ "Teoma": {
1234
+ "domains": [
1235
+ "www.teoma.com"
1236
+ ],
1237
+ "parameters": [
1238
+ "q"
1239
+ ]
1240
+ },
1241
+ "Needtofind": {
1242
+ "domains": [
1243
+ "ko.search.need2find.com"
1244
+ ],
1245
+ "parameters": [
1246
+ "searchfor"
1247
+ ]
1248
+ },
1249
+ "Looksmart": {
1250
+ "domains": [
1251
+ "www.looksmart.com"
1252
+ ],
1253
+ "parameters": [
1254
+ "key"
1255
+ ]
1256
+ },
1257
+ "Wirtualna Polska": {
1258
+ "domains": [
1259
+ "szukaj.wp.pl"
1260
+ ],
1261
+ "parameters": [
1262
+ "szukaj"
1263
+ ]
1264
+ },
1265
+ "Toolbarhome": {
1266
+ "domains": [
1267
+ "www.toolbarhome.com",
1268
+ "vshare.toolbarhome.com"
1269
+ ],
1270
+ "parameters": [
1271
+ "q"
1272
+ ]
1273
+ },
1274
+ "Searchalot": {
1275
+ "domains": [
1276
+ "searchalot.com"
1277
+ ],
1278
+ "parameters": [
1279
+ "q"
1280
+ ]
1281
+ },
1282
+ "Yandex": {
1283
+ "domains": [
1284
+ "yandex.ru",
1285
+ "yandex.ua",
1286
+ "yandex.com",
1287
+ "www.yandex.ru",
1288
+ "www.yandex.ua",
1289
+ "www.yandex.com"
1290
+ ],
1291
+ "parameters": [
1292
+ "text"
1293
+ ]
1294
+ },
1295
+ "canoe.ca": {
1296
+ "domains": [
1297
+ "web.canoe.ca"
1298
+ ],
1299
+ "parameters": [
1300
+ "q"
1301
+ ]
1302
+ },
1303
+ "Compuserve": {
1304
+ "domains": [
1305
+ "websearch.cs.com"
1306
+ ],
1307
+ "parameters": [
1308
+ "query"
1309
+ ]
1310
+ },
1311
+ "Startpagina": {
1312
+ "domains": [
1313
+ "startgoogle.startpagina.nl"
1314
+ ],
1315
+ "parameters": [
1316
+ "q"
1317
+ ]
1318
+ },
1319
+ "eo": {
1320
+ "domains": [
1321
+ "eo.st"
1322
+ ],
1323
+ "parameters": [
1324
+ "x_query"
1325
+ ]
1326
+ },
1327
+ "Zhongsou": {
1328
+ "domains": [
1329
+ "p.zhongsou.com"
1330
+ ],
1331
+ "parameters": [
1332
+ "w"
1333
+ ]
1334
+ },
1335
+ "La Toile Du Quebec Via Google": {
1336
+ "domains": [
1337
+ "www.toile.com",
1338
+ "web.toile.com"
1339
+ ],
1340
+ "parameters": [
1341
+ "q"
1342
+ ]
1343
+ },
1344
+ "Paperball": {
1345
+ "domains": [
1346
+ "www.paperball.de"
1347
+ ],
1348
+ "parameters": [
1349
+ "q"
1350
+ ]
1351
+ },
1352
+ "Jungle Spider": {
1353
+ "domains": [
1354
+ "www.jungle-spider.de"
1355
+ ],
1356
+ "parameters": [
1357
+ "q"
1358
+ ]
1359
+ },
1360
+ "PeoplePC": {
1361
+ "domains": [
1362
+ "search.peoplepc.com"
1363
+ ],
1364
+ "parameters": [
1365
+ "q"
1366
+ ]
1367
+ },
1368
+ "MetaCrawler.de": {
1369
+ "domains": [
1370
+ "s1.metacrawler.de",
1371
+ "s2.metacrawler.de",
1372
+ "s3.metacrawler.de"
1373
+ ],
1374
+ "parameters": [
1375
+ "qry"
1376
+ ]
1377
+ },
1378
+ "Orange": {
1379
+ "domains": [
1380
+ "busca.orange.es",
1381
+ "search.orange.co.uk"
1382
+ ],
1383
+ "parameters": [
1384
+ "q"
1385
+ ]
1386
+ },
1387
+ "Gule Sider": {
1388
+ "domains": [
1389
+ "www.gulesider.no"
1390
+ ],
1391
+ "parameters": [
1392
+ "q"
1393
+ ]
1394
+ },
1395
+ "Francite": {
1396
+ "domains": [
1397
+ "recherche.francite.com"
1398
+ ],
1399
+ "parameters": [
1400
+ "name"
1401
+ ]
1402
+ },
1403
+ "Ask Toolbar": {
1404
+ "domains": [
1405
+ "search.tb.ask.com"
1406
+ ],
1407
+ "parameters": [
1408
+ "searchfor"
1409
+ ]
1410
+ },
1411
+ "Aport": {
1412
+ "domains": [
1413
+ "sm.aport.ru"
1414
+ ],
1415
+ "parameters": [
1416
+ "r"
1417
+ ]
1418
+ },
1419
+ "Trusted-Search": {
1420
+ "domains": [
1421
+ "www.trusted--search.com"
1422
+ ],
1423
+ "parameters": [
1424
+ "w"
1425
+ ]
1426
+ },
1427
+ "goo": {
1428
+ "domains": [
1429
+ "search.goo.ne.jp",
1430
+ "ocnsearch.goo.ne.jp"
1431
+ ],
1432
+ "parameters": [
1433
+ "MT"
1434
+ ]
1435
+ },
1436
+ "Fast Browser Search": {
1437
+ "domains": [
1438
+ "www.fastbrowsersearch.com"
1439
+ ],
1440
+ "parameters": [
1441
+ "q"
1442
+ ]
1443
+ },
1444
+ "Blogpulse": {
1445
+ "domains": [
1446
+ "www.blogpulse.com"
1447
+ ],
1448
+ "parameters": [
1449
+ "query"
1450
+ ]
1451
+ },
1452
+ "Volny": {
1453
+ "domains": [
1454
+ "web.volny.cz"
1455
+ ],
1456
+ "parameters": [
1457
+ "search"
1458
+ ]
1459
+ },
1460
+ "Icerockeet": {
1461
+ "domains": [
1462
+ "blogs.icerocket.com"
1463
+ ],
1464
+ "parameters": [
1465
+ "q"
1466
+ ]
1467
+ },
1468
+ "Terra": {
1469
+ "domains": [
1470
+ "buscador.terra.es",
1471
+ "buscador.terra.cl",
1472
+ "buscador.terra.com.br"
1473
+ ],
1474
+ "parameters": [
1475
+ "query"
1476
+ ]
1477
+ },
1478
+ "Searchy": {
1479
+ "domains": [
1480
+ "www.searchy.co.uk"
1481
+ ],
1482
+ "parameters": [
1483
+ "q"
1484
+ ]
1485
+ },
1486
+ "Onet": {
1487
+ "domains": [
1488
+ "szukaj.onet.pl"
1489
+ ],
1490
+ "parameters": [
1491
+ "qt"
1492
+ ]
1493
+ },
1494
+ "Digg": {
1495
+ "domains": [
1496
+ "digg.com"
1497
+ ],
1498
+ "parameters": [
1499
+ "s"
1500
+ ]
1501
+ },
1502
+ "Abacho": {
1503
+ "domains": [
1504
+ "www.abacho.de",
1505
+ "www.abacho.com",
1506
+ "www.abacho.co.uk",
1507
+ "www.se.abacho.com",
1508
+ "www.tr.abacho.com",
1509
+ "www.abacho.at",
1510
+ "www.abacho.fr",
1511
+ "www.abacho.es",
1512
+ "www.abacho.ch",
1513
+ "www.abacho.it"
1514
+ ],
1515
+ "parameters": [
1516
+ "q"
1517
+ ]
1518
+ },
1519
+ "maailm": {
1520
+ "domains": [
1521
+ "www.maailm.com"
1522
+ ],
1523
+ "parameters": [
1524
+ "tekst"
1525
+ ]
1526
+ },
1527
+ "Flix": {
1528
+ "domains": [
1529
+ "www.flix.de"
1530
+ ],
1531
+ "parameters": [
1532
+ "keyword"
1533
+ ]
1534
+ },
1535
+ "Suchnase": {
1536
+ "domains": [
1537
+ "www.suchnase.de"
1538
+ ],
1539
+ "parameters": [
1540
+ "q"
1541
+ ]
1542
+ },
1543
+ "Freenet": {
1544
+ "domains": [
1545
+ "suche.freenet.de"
1546
+ ],
1547
+ "parameters": [
1548
+ "query",
1549
+ "Keywords"
1550
+ ]
1551
+ },
1552
+ "DuckDuckGoL": {
1553
+ "domains": [
1554
+ "duckduckgo.com"
1555
+ ],
1556
+ "parameters": [
1557
+ "q"
1558
+ ]
1559
+ },
1560
+ "Poisk.ru": {
1561
+ "domains": [
1562
+ "www.plazoo.com"
1563
+ ],
1564
+ "parameters": [
1565
+ "q"
1566
+ ]
1567
+ },
1568
+ "Sharelook": {
1569
+ "domains": [
1570
+ "www.sharelook.fr"
1571
+ ],
1572
+ "parameters": [
1573
+ "keyword"
1574
+ ]
1575
+ },
1576
+ "Najdi": {
1577
+ "domains": [
1578
+ "www.najdi.si"
1579
+ ],
1580
+ "parameters": [
1581
+ "q"
1582
+ ]
1583
+ },
1584
+ "Picsearch": {
1585
+ "domains": [
1586
+ "www.picsearch.com"
1587
+ ],
1588
+ "parameters": [
1589
+ "q"
1590
+ ]
1591
+ },
1592
+ "Mail.ru": {
1593
+ "domains": [
1594
+ "go.mail.ru"
1595
+ ],
1596
+ "parameters": [
1597
+ "q"
1598
+ ]
1599
+ },
1600
+ "Alexa": {
1601
+ "domains": [
1602
+ "alexa.com",
1603
+ "search.toolbars.alexa.com"
1604
+ ],
1605
+ "parameters": [
1606
+ "q"
1607
+ ]
1608
+ },
1609
+ "Metager": {
1610
+ "domains": [
1611
+ "meta.rrzn.uni-hannover.de",
1612
+ "www.metager.de"
1613
+ ],
1614
+ "parameters": [
1615
+ "eingabe"
1616
+ ]
1617
+ },
1618
+ "Technorati": {
1619
+ "domains": [
1620
+ "technorati.com"
1621
+ ],
1622
+ "parameters": [
1623
+ "q"
1624
+ ]
1625
+ },
1626
+ "WWW": {
1627
+ "domains": [
1628
+ "search.www.ee"
1629
+ ],
1630
+ "parameters": [
1631
+ "query"
1632
+ ]
1633
+ },
1634
+ "Trouvez.com": {
1635
+ "domains": [
1636
+ "www.trouvez.com"
1637
+ ],
1638
+ "parameters": [
1639
+ "query"
1640
+ ]
1641
+ },
1642
+ "IXquick": {
1643
+ "domains": [
1644
+ "ixquick.com",
1645
+ "www.eu.ixquick.com",
1646
+ "ixquick.de",
1647
+ "www.ixquick.de",
1648
+ "us.ixquick.com",
1649
+ "s1.us.ixquick.com",
1650
+ "s2.us.ixquick.com",
1651
+ "s3.us.ixquick.com",
1652
+ "s4.us.ixquick.com",
1653
+ "s5.us.ixquick.com",
1654
+ "eu.ixquick.com",
1655
+ "s8-eu.ixquick.com",
1656
+ "s1-eu.ixquick.de"
1657
+ ],
1658
+ "parameters": [
1659
+ "query"
1660
+ ]
1661
+ },
1662
+ "Zapmeta": {
1663
+ "domains": [
1664
+ "www.zapmeta.com",
1665
+ "www.zapmeta.nl",
1666
+ "www.zapmeta.de",
1667
+ "uk.zapmeta.com"
1668
+ ],
1669
+ "parameters": [
1670
+ "q",
1671
+ "query"
1672
+ ]
1673
+ },
1674
+ "Yippy": {
1675
+ "domains": [
1676
+ "search.yippy.com"
1677
+ ],
1678
+ "parameters": [
1679
+ "q",
1680
+ "query"
1681
+ ]
1682
+ },
1683
+ "Gomeo": {
1684
+ "domains": [
1685
+ "www.gomeo.com"
1686
+ ],
1687
+ "parameters": [
1688
+ "Keywords"
1689
+ ]
1690
+ },
1691
+ "Walhello": {
1692
+ "domains": [
1693
+ "www.walhello.info",
1694
+ "www.walhello.com",
1695
+ "www.walhello.de",
1696
+ "www.walhello.nl"
1697
+ ],
1698
+ "parameters": [
1699
+ "key"
1700
+ ]
1701
+ },
1702
+ "Meta": {
1703
+ "domains": [
1704
+ "meta.ua"
1705
+ ],
1706
+ "parameters": [
1707
+ "q"
1708
+ ]
1709
+ },
1710
+ "Skynet": {
1711
+ "domains": [
1712
+ "www.skynet.be"
1713
+ ],
1714
+ "parameters": [
1715
+ "q"
1716
+ ]
1717
+ },
1718
+ "Blogdigger": {
1719
+ "domains": [
1720
+ "www.blogdigger.com"
1721
+ ],
1722
+ "parameters": [
1723
+ "q"
1724
+ ]
1725
+ },
1726
+ "WebSearch": {
1727
+ "domains": [
1728
+ "www.websearch.com"
1729
+ ],
1730
+ "parameters": [
1731
+ "qkw",
1732
+ "q"
1733
+ ]
1734
+ },
1735
+ "Rambler": {
1736
+ "domains": [
1737
+ "nova.rambler.ru"
1738
+ ],
1739
+ "parameters": [
1740
+ "query",
1741
+ "words"
1742
+ ]
1743
+ },
1744
+ "Latne": {
1745
+ "domains": [
1746
+ "www.latne.lv"
1747
+ ],
1748
+ "parameters": [
1749
+ "q"
1750
+ ]
1751
+ },
1752
+ "MySearch": {
1753
+ "domains": [
1754
+ "www.mysearch.com",
1755
+ "ms114.mysearch.com",
1756
+ "ms146.mysearch.com",
1757
+ "kf.mysearch.myway.com",
1758
+ "ki.mysearch.myway.com",
1759
+ "search.myway.com",
1760
+ "search.mywebsearch.com"
1761
+ ],
1762
+ "parameters": [
1763
+ "searchfor",
1764
+ "searchFor"
1765
+ ]
1766
+ },
1767
+ "Cuil": {
1768
+ "domains": [
1769
+ "www.cuil.com"
1770
+ ],
1771
+ "parameters": [
1772
+ "q"
1773
+ ]
1774
+ },
1775
+ "Tixuma": {
1776
+ "domains": [
1777
+ "www.tixuma.de"
1778
+ ],
1779
+ "parameters": [
1780
+ "sc"
1781
+ ]
1782
+ },
1783
+ "Sapo": {
1784
+ "domains": [
1785
+ "pesquisa.sapo.pt"
1786
+ ],
1787
+ "parameters": [
1788
+ "q"
1789
+ ]
1790
+ },
1791
+ "Gnadenmeer": {
1792
+ "domains": [
1793
+ "www.gnadenmeer.de"
1794
+ ],
1795
+ "parameters": [
1796
+ "keyword"
1797
+ ]
1798
+ },
1799
+ "Arcor": {
1800
+ "domains": [
1801
+ "www.arcor.de"
1802
+ ],
1803
+ "parameters": [
1804
+ "Keywords"
1805
+ ]
1806
+ },
1807
+ "Naver": {
1808
+ "domains": [
1809
+ "search.naver.com"
1810
+ ],
1811
+ "parameters": [
1812
+ "query"
1813
+ ]
1814
+ },
1815
+ "Zoeken": {
1816
+ "domains": [
1817
+ "www.zoeken.nl"
1818
+ ],
1819
+ "parameters": [
1820
+ "q"
1821
+ ]
1822
+ },
1823
+ "Yam": {
1824
+ "domains": [
1825
+ "search.yam.com"
1826
+ ],
1827
+ "parameters": [
1828
+ "k"
1829
+ ]
1830
+ },
1831
+ "Eniro": {
1832
+ "domains": [
1833
+ "www.eniro.se"
1834
+ ],
1835
+ "parameters": [
1836
+ "q",
1837
+ "search_word"
1838
+ ]
1839
+ },
1840
+ "APOLL07": {
1841
+ "domains": [
1842
+ "apollo7.de"
1843
+ ],
1844
+ "parameters": [
1845
+ "query"
1846
+ ]
1847
+ },
1848
+ "Biglobe": {
1849
+ "domains": [
1850
+ "cgi.search.biglobe.ne.jp"
1851
+ ],
1852
+ "parameters": [
1853
+ "q"
1854
+ ]
1855
+ },
1856
+ "Mozbot": {
1857
+ "domains": [
1858
+ "www.mozbot.fr",
1859
+ "www.mozbot.co.uk",
1860
+ "www.mozbot.com"
1861
+ ],
1862
+ "parameters": [
1863
+ "q"
1864
+ ]
1865
+ },
1866
+ "ICQ": {
1867
+ "domains": [
1868
+ "www.icq.com",
1869
+ "search.icq.com"
1870
+ ],
1871
+ "parameters": [
1872
+ "q"
1873
+ ]
1874
+ },
1875
+ "Baidu": {
1876
+ "domains": [
1877
+ "www.baidu.com",
1878
+ "www1.baidu.com",
1879
+ "zhidao.baidu.com",
1880
+ "tieba.baidu.com",
1881
+ "news.baidu.com",
1882
+ "web.gougou.com"
1883
+ ],
1884
+ "parameters": [
1885
+ "wd",
1886
+ "word",
1887
+ "kw",
1888
+ "k"
1889
+ ]
1890
+ },
1891
+ "Conduit": {
1892
+ "domains": [
1893
+ "search.conduit.com"
1894
+ ],
1895
+ "parameters": [
1896
+ "q"
1897
+ ]
1898
+ },
1899
+ "Austronaut": {
1900
+ "domains": [
1901
+ "www2.austronaut.at",
1902
+ "www1.astronaut.at"
1903
+ ],
1904
+ "parameters": [
1905
+ "q"
1906
+ ]
1907
+ },
1908
+ "Vindex": {
1909
+ "domains": [
1910
+ "www.vindex.nl",
1911
+ "search.vindex.nl"
1912
+ ],
1913
+ "parameters": [
1914
+ "search_for"
1915
+ ]
1916
+ },
1917
+ "TrovaRapido": {
1918
+ "domains": [
1919
+ "www.trovarapido.com"
1920
+ ],
1921
+ "parameters": [
1922
+ "q"
1923
+ ]
1924
+ },
1925
+ "Suchmaschine.com": {
1926
+ "domains": [
1927
+ "www.suchmaschine.com"
1928
+ ],
1929
+ "parameters": [
1930
+ "suchstr"
1931
+ ]
1932
+ },
1933
+ "Lycos": {
1934
+ "domains": [
1935
+ "search.lycos.com",
1936
+ "www.lycos.com",
1937
+ "lycos.com"
1938
+ ],
1939
+ "parameters": [
1940
+ "query"
1941
+ ]
1942
+ },
1943
+ "Vinden": {
1944
+ "domains": [
1945
+ "www.vinden.nl"
1946
+ ],
1947
+ "parameters": [
1948
+ "q"
1949
+ ]
1950
+ },
1951
+ "Altavista": {
1952
+ "domains": [
1953
+ "www.altavista.com",
1954
+ "search.altavista.com",
1955
+ "listings.altavista.com",
1956
+ "altavista.de",
1957
+ "altavista.fr",
1958
+ "be-nl.altavista.com",
1959
+ "be-fr.altavista.com"
1960
+ ],
1961
+ "parameters": [
1962
+ "q"
1963
+ ]
1964
+ },
1965
+ "dmoz": {
1966
+ "domains": [
1967
+ "dmoz.org",
1968
+ "editors.dmoz.org"
1969
+ ],
1970
+ "parameters": [
1971
+ "q"
1972
+ ]
1973
+ },
1974
+ "Ecosia": {
1975
+ "domains": [
1976
+ "ecosia.org"
1977
+ ],
1978
+ "parameters": [
1979
+ "q"
1980
+ ]
1981
+ },
1982
+ "Maxwebsearch": {
1983
+ "domains": [
1984
+ "maxwebsearch.com"
1985
+ ],
1986
+ "parameters": [
1987
+ "query"
1988
+ ]
1989
+ },
1990
+ "Euroseek": {
1991
+ "domains": [
1992
+ "www.euroseek.com"
1993
+ ],
1994
+ "parameters": [
1995
+ "string"
1996
+ ]
1997
+ },
1998
+ "Bing": {
1999
+ "domains": [
2000
+ "bing.com",
2001
+ "www.bing.com",
2002
+ "msnbc.msn.com",
2003
+ "dizionario.it.msn.com",
2004
+ "cc.bingj.com",
2005
+ "m.bing.com"
2006
+ ],
2007
+ "parameters": [
2008
+ "q",
2009
+ "Q"
2010
+ ]
2011
+ },
2012
+ "X-recherche": {
2013
+ "domains": [
2014
+ "www.x-recherche.com"
2015
+ ],
2016
+ "parameters": [
2017
+ "MOTS"
2018
+ ]
2019
+ },
2020
+ "Yandex Images": {
2021
+ "domains": [
2022
+ "images.yandex.ru",
2023
+ "images.yandex.ua",
2024
+ "images.yandex.com"
2025
+ ],
2026
+ "parameters": [
2027
+ "text"
2028
+ ]
2029
+ },
2030
+ "GMX": {
2031
+ "domains": [
2032
+ "suche.gmx.net"
2033
+ ],
2034
+ "parameters": [
2035
+ "su"
2036
+ ]
2037
+ },
2038
+ "Daemon search": {
2039
+ "domains": [
2040
+ "daemon-search.com",
2041
+ "my.daemon-search.com"
2042
+ ],
2043
+ "parameters": [
2044
+ "q"
2045
+ ]
2046
+ },
2047
+ "Jungle Key": {
2048
+ "domains": [
2049
+ "junglekey.com",
2050
+ "junglekey.fr"
2051
+ ],
2052
+ "parameters": [
2053
+ "query"
2054
+ ]
2055
+ },
2056
+ "Firstfind": {
2057
+ "domains": [
2058
+ "www.firstsfind.com"
2059
+ ],
2060
+ "parameters": [
2061
+ "qry"
2062
+ ]
2063
+ },
2064
+ "Crawler": {
2065
+ "domains": [
2066
+ "www.crawler.com"
2067
+ ],
2068
+ "parameters": [
2069
+ "q"
2070
+ ]
2071
+ },
2072
+ "Holmes": {
2073
+ "domains": [
2074
+ "holmes.ge"
2075
+ ],
2076
+ "parameters": [
2077
+ "q"
2078
+ ]
2079
+ },
2080
+ "Charter": {
2081
+ "domains": [
2082
+ "www.charter.net"
2083
+ ],
2084
+ "parameters": [
2085
+ "q"
2086
+ ]
2087
+ },
2088
+ "Ilse": {
2089
+ "domains": [
2090
+ "www.ilse.nl"
2091
+ ],
2092
+ "parameters": [
2093
+ "search_for"
2094
+ ]
2095
+ },
2096
+ "earthlink": {
2097
+ "domains": [
2098
+ "search.earthlink.net"
2099
+ ],
2100
+ "parameters": [
2101
+ "q"
2102
+ ]
2103
+ },
2104
+ "Qualigo": {
2105
+ "domains": [
2106
+ "www.qualigo.at",
2107
+ "www.qualigo.ch",
2108
+ "www.qualigo.de",
2109
+ "www.qualigo.nl"
2110
+ ],
2111
+ "parameters": [
2112
+ "q"
2113
+ ]
2114
+ },
2115
+ "El Mundo": {
2116
+ "domains": [
2117
+ "ariadna.elmundo.es"
2118
+ ],
2119
+ "parameters": [
2120
+ "q"
2121
+ ]
2122
+ },
2123
+ "Metager2": {
2124
+ "domains": [
2125
+ "metager2.de"
2126
+ ],
2127
+ "parameters": [
2128
+ "q"
2129
+ ]
2130
+ },
2131
+ "Forestle": {
2132
+ "domains": [
2133
+ "forestle.org",
2134
+ "www.forestle.org",
2135
+ "forestle.mobi"
2136
+ ],
2137
+ "parameters": [
2138
+ "q"
2139
+ ]
2140
+ },
2141
+ "Search.ch": {
2142
+ "domains": [
2143
+ "www.search.ch"
2144
+ ],
2145
+ "parameters": [
2146
+ "q"
2147
+ ]
2148
+ },
2149
+ "Meinestadt": {
2150
+ "domains": [
2151
+ "www.meinestadt.de"
2152
+ ],
2153
+ "parameters": [
2154
+ "words"
2155
+ ]
2156
+ },
2157
+ "Freshweather": {
2158
+ "domains": [
2159
+ "www.fresh-weather.com"
2160
+ ],
2161
+ "parameters": [
2162
+ "q"
2163
+ ]
2164
+ },
2165
+ "AllTheWeb": {
2166
+ "domains": [
2167
+ "www.alltheweb.com"
2168
+ ],
2169
+ "parameters": [
2170
+ "q"
2171
+ ]
2172
+ },
2173
+ "Zoek": {
2174
+ "domains": [
2175
+ "www3.zoek.nl"
2176
+ ],
2177
+ "parameters": [
2178
+ "q"
2179
+ ]
2180
+ },
2181
+ "Daum": {
2182
+ "domains": [
2183
+ "search.daum.net"
2184
+ ],
2185
+ "parameters": [
2186
+ "q"
2187
+ ]
2188
+ },
2189
+ "Marktplaats": {
2190
+ "domains": [
2191
+ "www.marktplaats.nl"
2192
+ ],
2193
+ "parameters": [
2194
+ "query"
2195
+ ]
2196
+ },
2197
+ "suche.info": {
2198
+ "domains": [
2199
+ "suche.info"
2200
+ ],
2201
+ "parameters": [
2202
+ "q"
2203
+ ]
2204
+ },
2205
+ "Google News": {
2206
+ "domains": [
2207
+ "news.google.ac",
2208
+ "news.google.ad",
2209
+ "news.google.ae",
2210
+ "news.google.am",
2211
+ "news.google.as",
2212
+ "news.google.at",
2213
+ "news.google.az",
2214
+ "news.google.ba",
2215
+ "news.google.be",
2216
+ "news.google.bf",
2217
+ "news.google.bg",
2218
+ "news.google.bi",
2219
+ "news.google.bj",
2220
+ "news.google.bs",
2221
+ "news.google.by",
2222
+ "news.google.ca",
2223
+ "news.google.cat",
2224
+ "news.google.cc",
2225
+ "news.google.cd",
2226
+ "news.google.cf",
2227
+ "news.google.cg",
2228
+ "news.google.ch",
2229
+ "news.google.ci",
2230
+ "news.google.cl",
2231
+ "news.google.cm",
2232
+ "news.google.cn",
2233
+ "news.google.co.bw",
2234
+ "news.google.co.ck",
2235
+ "news.google.co.cr",
2236
+ "news.google.co.id",
2237
+ "news.google.co.il",
2238
+ "news.google.co.in",
2239
+ "news.google.co.jp",
2240
+ "news.google.co.ke",
2241
+ "news.google.co.kr",
2242
+ "news.google.co.ls",
2243
+ "news.google.co.ma",
2244
+ "news.google.co.mz",
2245
+ "news.google.co.nz",
2246
+ "news.google.co.th",
2247
+ "news.google.co.tz",
2248
+ "news.google.co.ug",
2249
+ "news.google.co.uk",
2250
+ "news.google.co.uz",
2251
+ "news.google.co.ve",
2252
+ "news.google.co.vi",
2253
+ "news.google.co.za",
2254
+ "news.google.co.zm",
2255
+ "news.google.co.zw",
2256
+ "news.google.com",
2257
+ "news.google.com.af",
2258
+ "news.google.com.ag",
2259
+ "news.google.com.ai",
2260
+ "news.google.com.ar",
2261
+ "news.google.com.au",
2262
+ "news.google.com.bd",
2263
+ "news.google.com.bh",
2264
+ "news.google.com.bn",
2265
+ "news.google.com.bo",
2266
+ "news.google.com.br",
2267
+ "news.google.com.by",
2268
+ "news.google.com.bz",
2269
+ "news.google.com.co",
2270
+ "news.google.com.cu",
2271
+ "news.google.com.cy",
2272
+ "news.google.com.do",
2273
+ "news.google.com.ec",
2274
+ "news.google.com.eg",
2275
+ "news.google.com.et",
2276
+ "news.google.com.fj",
2277
+ "news.google.com.gh",
2278
+ "news.google.com.gi",
2279
+ "news.google.com.gt",
2280
+ "news.google.com.hk",
2281
+ "news.google.com.jm",
2282
+ "news.google.com.kh",
2283
+ "news.google.com.kh",
2284
+ "news.google.com.kw",
2285
+ "news.google.com.lb",
2286
+ "news.google.com.lc",
2287
+ "news.google.com.ly",
2288
+ "news.google.com.mt",
2289
+ "news.google.com.mx",
2290
+ "news.google.com.my",
2291
+ "news.google.com.na",
2292
+ "news.google.com.nf",
2293
+ "news.google.com.ng",
2294
+ "news.google.com.ni",
2295
+ "news.google.com.np",
2296
+ "news.google.com.om",
2297
+ "news.google.com.pa",
2298
+ "news.google.com.pe",
2299
+ "news.google.com.ph",
2300
+ "news.google.com.pk",
2301
+ "news.google.com.pr",
2302
+ "news.google.com.py",
2303
+ "news.google.com.qa",
2304
+ "news.google.com.sa",
2305
+ "news.google.com.sb",
2306
+ "news.google.com.sg",
2307
+ "news.google.com.sl",
2308
+ "news.google.com.sv",
2309
+ "news.google.com.tj",
2310
+ "news.google.com.tn",
2311
+ "news.google.com.tr",
2312
+ "news.google.com.tw",
2313
+ "news.google.com.ua",
2314
+ "news.google.com.uy",
2315
+ "news.google.com.vc",
2316
+ "news.google.com.vn",
2317
+ "news.google.cv",
2318
+ "news.google.cz",
2319
+ "news.google.de",
2320
+ "news.google.dj",
2321
+ "news.google.dk",
2322
+ "news.google.dm",
2323
+ "news.google.dz",
2324
+ "news.google.ee",
2325
+ "news.google.es",
2326
+ "news.google.fi",
2327
+ "news.google.fm",
2328
+ "news.google.fr",
2329
+ "news.google.ga",
2330
+ "news.google.gd",
2331
+ "news.google.ge",
2332
+ "news.google.gf",
2333
+ "news.google.gg",
2334
+ "news.google.gl",
2335
+ "news.google.gm",
2336
+ "news.google.gp",
2337
+ "news.google.gr",
2338
+ "news.google.gy",
2339
+ "news.google.hn",
2340
+ "news.google.hr",
2341
+ "news.google.ht",
2342
+ "news.google.hu",
2343
+ "news.google.ie",
2344
+ "news.google.im",
2345
+ "news.google.io",
2346
+ "news.google.iq",
2347
+ "news.google.is",
2348
+ "news.google.it",
2349
+ "news.google.it.ao",
2350
+ "news.google.je",
2351
+ "news.google.jo",
2352
+ "news.google.kg",
2353
+ "news.google.ki",
2354
+ "news.google.kz",
2355
+ "news.google.la",
2356
+ "news.google.li",
2357
+ "news.google.lk",
2358
+ "news.google.lt",
2359
+ "news.google.lu",
2360
+ "news.google.lv",
2361
+ "news.google.md",
2362
+ "news.google.me",
2363
+ "news.google.mg",
2364
+ "news.google.mk",
2365
+ "news.google.ml",
2366
+ "news.google.mn",
2367
+ "news.google.ms",
2368
+ "news.google.mu",
2369
+ "news.google.mv",
2370
+ "news.google.mw",
2371
+ "news.google.ne",
2372
+ "news.google.nl",
2373
+ "news.google.no",
2374
+ "news.google.nr",
2375
+ "news.google.nu",
2376
+ "news.google.pl",
2377
+ "news.google.pn",
2378
+ "news.google.ps",
2379
+ "news.google.pt",
2380
+ "news.google.ro",
2381
+ "news.google.rs",
2382
+ "news.google.ru",
2383
+ "news.google.rw",
2384
+ "news.google.sc",
2385
+ "news.google.se",
2386
+ "news.google.sh",
2387
+ "news.google.si",
2388
+ "news.google.sk",
2389
+ "news.google.sm",
2390
+ "news.google.sn",
2391
+ "news.google.so",
2392
+ "news.google.st",
2393
+ "news.google.td",
2394
+ "news.google.tg",
2395
+ "news.google.tk",
2396
+ "news.google.tl",
2397
+ "news.google.tm",
2398
+ "news.google.to",
2399
+ "news.google.tt",
2400
+ "news.google.us",
2401
+ "news.google.vg",
2402
+ "news.google.vu",
2403
+ "news.google.ws"
2404
+ ],
2405
+ "parameters": [
2406
+ "q"
2407
+ ]
2408
+ },
2409
+ "Zoohoo": {
2410
+ "domains": [
2411
+ "zoohoo.cz"
2412
+ ],
2413
+ "parameters": [
2414
+ "q"
2415
+ ]
2416
+ },
2417
+ "Seznam": {
2418
+ "domains": [
2419
+ "search.seznam.cz"
2420
+ ],
2421
+ "parameters": [
2422
+ "q"
2423
+ ]
2424
+ },
2425
+ "Online.no": {
2426
+ "domains": [
2427
+ "online.no"
2428
+ ],
2429
+ "parameters": [
2430
+ "q"
2431
+ ]
2432
+ },
2433
+ "Eurip": {
2434
+ "domains": [
2435
+ "www.eurip.com"
2436
+ ],
2437
+ "parameters": [
2438
+ "q"
2439
+ ]
2440
+ },
2441
+ "all.by": {
2442
+ "domains": [
2443
+ "all.by"
2444
+ ],
2445
+ "parameters": [
2446
+ "query"
2447
+ ]
2448
+ },
2449
+ "Road Runner Search": {
2450
+ "domains": [
2451
+ "search.rr.com"
2452
+ ],
2453
+ "parameters": [
2454
+ "q"
2455
+ ]
2456
+ },
2457
+ "Opplysningen 1881": {
2458
+ "domains": [
2459
+ "www.1881.no"
2460
+ ],
2461
+ "parameters": [
2462
+ "Query"
2463
+ ]
2464
+ },
2465
+ "YouGoo": {
2466
+ "domains": [
2467
+ "www.yougoo.fr"
2468
+ ],
2469
+ "parameters": [
2470
+ "q"
2471
+ ]
2472
+ },
2473
+ "Bing Images": {
2474
+ "domains": [
2475
+ "bing.com/images/search",
2476
+ "www.bing.com/images/search"
2477
+ ],
2478
+ "parameters": [
2479
+ "q",
2480
+ "Q"
2481
+ ]
2482
+ },
2483
+ "Geona": {
2484
+ "domains": [
2485
+ "geona.net"
2486
+ ],
2487
+ "parameters": [
2488
+ "q"
2489
+ ]
2490
+ },
2491
+ "Nate": {
2492
+ "domains": [
2493
+ "search.nate.com"
2494
+ ],
2495
+ "parameters": [
2496
+ "q"
2497
+ ]
2498
+ },
2499
+ "T-Online": {
2500
+ "domains": [
2501
+ "suche.t-online.de",
2502
+ "brisbane.t-online.de",
2503
+ "navigationshilfe.t-online.de"
2504
+ ],
2505
+ "parameters": [
2506
+ "q"
2507
+ ]
2508
+ },
2509
+ "Hotbot": {
2510
+ "domains": [
2511
+ "www.hotbot.com"
2512
+ ],
2513
+ "parameters": [
2514
+ "query"
2515
+ ]
2516
+ },
2517
+ "Kvasir": {
2518
+ "domains": [
2519
+ "www.kvasir.no"
2520
+ ],
2521
+ "parameters": [
2522
+ "q"
2523
+ ]
2524
+ },
2525
+ "Babylon": {
2526
+ "domains": [
2527
+ "search.babylon.com",
2528
+ "searchassist.babylon.com"
2529
+ ],
2530
+ "parameters": [
2531
+ "q"
2532
+ ]
2533
+ },
2534
+ "Excite": {
2535
+ "domains": [
2536
+ "search.excite.it",
2537
+ "search.excite.fr",
2538
+ "search.excite.de",
2539
+ "search.excite.co.uk",
2540
+ "serach.excite.es",
2541
+ "search.excite.nl",
2542
+ "msxml.excite.com",
2543
+ "www.excite.co.jp"
2544
+ ],
2545
+ "parameters": [
2546
+ "q",
2547
+ "search"
2548
+ ]
2549
+ },
2550
+ "qip": {
2551
+ "domains": [
2552
+ "search.qip.ru"
2553
+ ],
2554
+ "parameters": [
2555
+ "query"
2556
+ ]
2557
+ },
2558
+ "Yahoo!": {
2559
+ "domains": [
2560
+ "search.yahoo.com",
2561
+ "yahoo.com",
2562
+ "ar.search.yahoo.com",
2563
+ "ar.yahoo.com",
2564
+ "au.search.yahoo.com",
2565
+ "au.yahoo.com",
2566
+ "br.search.yahoo.com",
2567
+ "br.yahoo.com",
2568
+ "cade.searchde.yahoo.com",
2569
+ "cade.yahoo.com",
2570
+ "chinese.searchinese.yahoo.com",
2571
+ "chinese.yahoo.com",
2572
+ "cn.search.yahoo.com",
2573
+ "cn.yahoo.com",
2574
+ "de.search.yahoo.com",
2575
+ "de.yahoo.com",
2576
+ "dk.search.yahoo.com",
2577
+ "dk.yahoo.com",
2578
+ "es.search.yahoo.com",
2579
+ "es.yahoo.com",
2580
+ "espanol.searchpanol.yahoo.com",
2581
+ "espanol.searchpanol.yahoo.com",
2582
+ "espanol.yahoo.com",
2583
+ "espanol.yahoo.com",
2584
+ "fr.search.yahoo.com",
2585
+ "fr.yahoo.com",
2586
+ "ie.search.yahoo.com",
2587
+ "ie.yahoo.com",
2588
+ "it.search.yahoo.com",
2589
+ "it.yahoo.com",
2590
+ "kr.search.yahoo.com",
2591
+ "kr.yahoo.com",
2592
+ "mx.search.yahoo.com",
2593
+ "mx.yahoo.com",
2594
+ "no.search.yahoo.com",
2595
+ "no.yahoo.com",
2596
+ "nz.search.yahoo.com",
2597
+ "nz.yahoo.com",
2598
+ "one.cn.yahoo.com",
2599
+ "one.searchn.yahoo.com",
2600
+ "qc.search.yahoo.com",
2601
+ "qc.search.yahoo.com",
2602
+ "qc.search.yahoo.com",
2603
+ "qc.yahoo.com",
2604
+ "qc.yahoo.com",
2605
+ "se.search.yahoo.com",
2606
+ "se.search.yahoo.com",
2607
+ "se.yahoo.com",
2608
+ "search.searcharch.yahoo.com",
2609
+ "search.yahoo.com",
2610
+ "uk.search.yahoo.com",
2611
+ "uk.yahoo.com",
2612
+ "www.yahoo.co.jp",
2613
+ "search.yahoo.co.jp",
2614
+ "www.cercato.it",
2615
+ "search.offerbox.com",
2616
+ "ys.mirostart.com"
2617
+ ],
2618
+ "parameters": [
2619
+ "p",
2620
+ "q"
2621
+ ]
2622
+ },
2623
+ "URL.ORGanizier": {
2624
+ "domains": [
2625
+ "www.url.org"
2626
+ ],
2627
+ "parameters": [
2628
+ "q"
2629
+ ]
2630
+ },
2631
+ "Witch": {
2632
+ "domains": [
2633
+ "www.witch.de"
2634
+ ],
2635
+ "parameters": [
2636
+ "search"
2637
+ ]
2638
+ },
2639
+ "Mister Wong": {
2640
+ "domains": [
2641
+ "www.mister-wong.com",
2642
+ "www.mister-wong.de"
2643
+ ],
2644
+ "parameters": [
2645
+ "Keywords"
2646
+ ]
2647
+ },
2648
+ "Startsiden": {
2649
+ "domains": [
2650
+ "www.startsiden.no"
2651
+ ],
2652
+ "parameters": [
2653
+ "q"
2654
+ ]
2655
+ },
2656
+ "Web.de": {
2657
+ "domains": [
2658
+ "suche.web.de"
2659
+ ],
2660
+ "parameters": [
2661
+ "su"
2662
+ ]
2663
+ },
2664
+ "Ask": {
2665
+ "domains": [
2666
+ "ask.com",
2667
+ "www.ask.com",
2668
+ "web.ask.com",
2669
+ "int.ask.com",
2670
+ "mws.ask.com",
2671
+ "uk.ask.com",
2672
+ "images.ask.com",
2673
+ "ask.reference.com",
2674
+ "www.askkids.com",
2675
+ "iwon.ask.com",
2676
+ "www.ask.co.uk",
2677
+ "www.qbyrd.com",
2678
+ "search-results.com",
2679
+ "uk.search-results.com",
2680
+ "www.search-results.com",
2681
+ "int.search-results.com"
2682
+ ],
2683
+ "parameters": [
2684
+ "q"
2685
+ ]
2686
+ },
2687
+ "Centrum": {
2688
+ "domains": [
2689
+ "serach.centrum.cz",
2690
+ "morfeo.centrum.cz"
2691
+ ],
2692
+ "parameters": [
2693
+ "q"
2694
+ ]
2695
+ },
2696
+ "Everyclick": {
2697
+ "domains": [
2698
+ "www.everyclick.com"
2699
+ ],
2700
+ "parameters": [
2701
+ "keyword"
2702
+ ]
2703
+ },
2704
+ "Google Video": {
2705
+ "domains": [
2706
+ "video.google.com"
2707
+ ],
2708
+ "parameters": [
2709
+ "q"
2710
+ ]
2711
+ },
2712
+ "Delfi": {
2713
+ "domains": [
2714
+ "otsing.delfi.ee"
2715
+ ],
2716
+ "parameters": [
2717
+ "q"
2718
+ ]
2719
+ },
2720
+ "blekko": {
2721
+ "domains": [
2722
+ "blekko.com"
2723
+ ],
2724
+ "parameters": [
2725
+ "q"
2726
+ ]
2727
+ },
2728
+ "Jyxo": {
2729
+ "domains": [
2730
+ "jyxo.1188.cz"
2731
+ ],
2732
+ "parameters": [
2733
+ "q"
2734
+ ]
2735
+ },
2736
+ "Kataweb": {
2737
+ "domains": [
2738
+ "www.kataweb.it"
2739
+ ],
2740
+ "parameters": [
2741
+ "q"
2742
+ ]
2743
+ },
2744
+ "uol.com.br": {
2745
+ "domains": [
2746
+ "busca.uol.com.br"
2747
+ ],
2748
+ "parameters": [
2749
+ "q"
2750
+ ]
2751
+ },
2752
+ "Arianna": {
2753
+ "domains": [
2754
+ "arianna.libero.it",
2755
+ "www.arianna.com"
2756
+ ],
2757
+ "parameters": [
2758
+ "query"
2759
+ ]
2760
+ },
2761
+ "Mamma": {
2762
+ "domains": [
2763
+ "www.mamma.com",
2764
+ "mamma75.mamma.com"
2765
+ ],
2766
+ "parameters": [
2767
+ "query"
2768
+ ]
2769
+ },
2770
+ "Yatedo": {
2771
+ "domains": [
2772
+ "www.yatedo.com",
2773
+ "www.yatedo.fr"
2774
+ ],
2775
+ "parameters": [
2776
+ "q"
2777
+ ]
2778
+ },
2779
+ "Twingly": {
2780
+ "domains": [
2781
+ "www.twingly.com"
2782
+ ],
2783
+ "parameters": [
2784
+ "q"
2785
+ ]
2786
+ },
2787
+ "Delfi latvia": {
2788
+ "domains": [
2789
+ "smart.delfi.lv"
2790
+ ],
2791
+ "parameters": [
2792
+ "q"
2793
+ ]
2794
+ },
2795
+ "PriceRunner": {
2796
+ "domains": [
2797
+ "www.pricerunner.co.uk"
2798
+ ],
2799
+ "parameters": [
2800
+ "q"
2801
+ ]
2802
+ },
2803
+ "Rakuten": {
2804
+ "domains": [
2805
+ "websearch.rakuten.co.jp"
2806
+ ],
2807
+ "parameters": [
2808
+ "qt"
2809
+ ]
2810
+ },
2811
+ "Google": {
2812
+ "domains": [
2813
+ "www.google.com",
2814
+ "www.google.ac",
2815
+ "www.google.ad",
2816
+ "www.google.com.af",
2817
+ "www.google.com.ag",
2818
+ "www.google.com.ai",
2819
+ "www.google.am",
2820
+ "www.google.it.ao",
2821
+ "www.google.com.ar",
2822
+ "www.google.as",
2823
+ "www.google.at",
2824
+ "www.google.com.au",
2825
+ "www.google.az",
2826
+ "www.google.ba",
2827
+ "www.google.com.bd",
2828
+ "www.google.be",
2829
+ "www.google.bf",
2830
+ "www.google.bg",
2831
+ "www.google.com.bh",
2832
+ "www.google.bi",
2833
+ "www.google.bj",
2834
+ "www.google.com.bn",
2835
+ "www.google.com.bo",
2836
+ "www.google.com.br",
2837
+ "www.google.bs",
2838
+ "www.google.co.bw",
2839
+ "www.google.com.by",
2840
+ "www.google.by",
2841
+ "www.google.com.bz",
2842
+ "www.google.ca",
2843
+ "www.google.com.kh",
2844
+ "www.google.cc",
2845
+ "www.google.cd",
2846
+ "www.google.cf",
2847
+ "www.google.cat",
2848
+ "www.google.cg",
2849
+ "www.google.ch",
2850
+ "www.google.ci",
2851
+ "www.google.co.ck",
2852
+ "www.google.cl",
2853
+ "www.google.cm",
2854
+ "www.google.cn",
2855
+ "www.google.com.co",
2856
+ "www.google.co.cr",
2857
+ "www.google.com.cu",
2858
+ "www.google.cv",
2859
+ "www.google.com.cy",
2860
+ "www.google.cz",
2861
+ "www.google.de",
2862
+ "www.google.dj",
2863
+ "www.google.dk",
2864
+ "www.google.dm",
2865
+ "www.google.com.do",
2866
+ "www.google.dz",
2867
+ "www.google.com.ec",
2868
+ "www.google.ee",
2869
+ "www.google.com.eg",
2870
+ "www.google.es",
2871
+ "www.google.com.et",
2872
+ "www.google.fi",
2873
+ "www.google.com.fj",
2874
+ "www.google.fm",
2875
+ "www.google.fr",
2876
+ "www.google.ga",
2877
+ "www.google.gd",
2878
+ "www.google.ge",
2879
+ "www.google.gf",
2880
+ "www.google.gg",
2881
+ "www.google.com.gh",
2882
+ "www.google.com.gi",
2883
+ "www.google.gl",
2884
+ "www.google.gm",
2885
+ "www.google.gp",
2886
+ "www.google.gr",
2887
+ "www.google.com.gt",
2888
+ "www.google.gy",
2889
+ "www.google.com.hk",
2890
+ "www.google.hn",
2891
+ "www.google.hr",
2892
+ "www.google.ht",
2893
+ "www.google.hu",
2894
+ "www.google.co.id",
2895
+ "www.google.iq",
2896
+ "www.google.ie",
2897
+ "www.google.co.il",
2898
+ "www.google.im",
2899
+ "www.google.co.in",
2900
+ "www.google.io",
2901
+ "www.google.is",
2902
+ "www.google.it",
2903
+ "www.google.je",
2904
+ "www.google.com.jm",
2905
+ "www.google.jo",
2906
+ "www.google.co.jp",
2907
+ "www.google.co.ke",
2908
+ "www.google.com.kh",
2909
+ "www.google.ki",
2910
+ "www.google.kg",
2911
+ "www.google.co.kr",
2912
+ "www.google.com.kw",
2913
+ "www.google.kz",
2914
+ "www.google.la",
2915
+ "www.google.com.lb",
2916
+ "www.google.com.lc",
2917
+ "www.google.li",
2918
+ "www.google.lk",
2919
+ "www.google.co.ls",
2920
+ "www.google.lt",
2921
+ "www.google.lu",
2922
+ "www.google.lv",
2923
+ "www.google.com.ly",
2924
+ "www.google.co.ma",
2925
+ "www.google.md",
2926
+ "www.google.me",
2927
+ "www.google.mg",
2928
+ "www.google.mk",
2929
+ "www.google.ml",
2930
+ "www.google.mn",
2931
+ "www.google.ms",
2932
+ "www.google.com.mt",
2933
+ "www.google.mu",
2934
+ "www.google.mv",
2935
+ "www.google.mw",
2936
+ "www.google.com.mx",
2937
+ "www.google.com.my",
2938
+ "www.google.co.mz",
2939
+ "www.google.com.na",
2940
+ "www.google.ne",
2941
+ "www.google.com.nf",
2942
+ "www.google.com.ng",
2943
+ "www.google.com.ni",
2944
+ "www.google.nl",
2945
+ "www.google.no",
2946
+ "www.google.com.np",
2947
+ "www.google.nr",
2948
+ "www.google.nu",
2949
+ "www.google.co.nz",
2950
+ "www.google.com.om",
2951
+ "www.google.com.pa",
2952
+ "www.google.com.pe",
2953
+ "www.google.com.ph",
2954
+ "www.google.com.pk",
2955
+ "www.google.pl",
2956
+ "www.google.pn",
2957
+ "www.google.com.pr",
2958
+ "www.google.ps",
2959
+ "www.google.pt",
2960
+ "www.google.com.py",
2961
+ "www.google.com.qa",
2962
+ "www.google.ro",
2963
+ "www.google.rs",
2964
+ "www.google.ru",
2965
+ "www.google.rw",
2966
+ "www.google.com.sa",
2967
+ "www.google.com.sb",
2968
+ "www.google.sc",
2969
+ "www.google.se",
2970
+ "www.google.com.sg",
2971
+ "www.google.sh",
2972
+ "www.google.si",
2973
+ "www.google.sk",
2974
+ "www.google.com.sl",
2975
+ "www.google.sn",
2976
+ "www.google.sm",
2977
+ "www.google.so",
2978
+ "www.google.st",
2979
+ "www.google.com.sv",
2980
+ "www.google.td",
2981
+ "www.google.tg",
2982
+ "www.google.co.th",
2983
+ "www.google.com.tj",
2984
+ "www.google.tk",
2985
+ "www.google.tl",
2986
+ "www.google.tm",
2987
+ "www.google.to",
2988
+ "www.google.com.tn",
2989
+ "www.google.com.tr",
2990
+ "www.google.tt",
2991
+ "www.google.com.tw",
2992
+ "www.google.co.tz",
2993
+ "www.google.com.ua",
2994
+ "www.google.co.ug",
2995
+ "www.google.ae",
2996
+ "www.google.co.uk",
2997
+ "www.google.us",
2998
+ "www.google.com.uy",
2999
+ "www.google.co.uz",
3000
+ "www.google.com.vc",
3001
+ "www.google.co.ve",
3002
+ "www.google.vg",
3003
+ "www.google.co.vi",
3004
+ "www.google.com.vn",
3005
+ "www.google.vu",
3006
+ "www.google.ws",
3007
+ "www.google.co.za",
3008
+ "www.google.co.zm",
3009
+ "www.google.co.zw",
3010
+ "google.com",
3011
+ "google.ac",
3012
+ "google.ad",
3013
+ "google.com.af",
3014
+ "google.com.ag",
3015
+ "google.com.ai",
3016
+ "google.am",
3017
+ "google.it.ao",
3018
+ "google.com.ar",
3019
+ "google.as",
3020
+ "google.at",
3021
+ "google.com.au",
3022
+ "google.az",
3023
+ "google.ba",
3024
+ "google.com.bd",
3025
+ "google.be",
3026
+ "google.bf",
3027
+ "google.bg",
3028
+ "google.com.bh",
3029
+ "google.bi",
3030
+ "google.bj",
3031
+ "google.com.bn",
3032
+ "google.com.bo",
3033
+ "google.com.br",
3034
+ "google.bs",
3035
+ "google.co.bw",
3036
+ "google.com.by",
3037
+ "google.by",
3038
+ "google.com.bz",
3039
+ "google.ca",
3040
+ "google.com.kh",
3041
+ "google.cc",
3042
+ "google.cd",
3043
+ "google.cf",
3044
+ "google.cat",
3045
+ "google.cg",
3046
+ "google.ch",
3047
+ "google.ci",
3048
+ "google.co.ck",
3049
+ "google.cl",
3050
+ "google.cm",
3051
+ "google.cn",
3052
+ "google.com.co",
3053
+ "google.co.cr",
3054
+ "google.com.cu",
3055
+ "google.cv",
3056
+ "google.com.cy",
3057
+ "google.cz",
3058
+ "google.de",
3059
+ "google.dj",
3060
+ "google.dk",
3061
+ "google.dm",
3062
+ "google.com.do",
3063
+ "google.dz",
3064
+ "google.com.ec",
3065
+ "google.ee",
3066
+ "google.com.eg",
3067
+ "google.es",
3068
+ "google.com.et",
3069
+ "google.fi",
3070
+ "google.com.fj",
3071
+ "google.fm",
3072
+ "google.fr",
3073
+ "google.ga",
3074
+ "google.gd",
3075
+ "google.ge",
3076
+ "google.gf",
3077
+ "google.gg",
3078
+ "google.com.gh",
3079
+ "google.com.gi",
3080
+ "google.gl",
3081
+ "google.gm",
3082
+ "google.gp",
3083
+ "google.gr",
3084
+ "google.com.gt",
3085
+ "google.gy",
3086
+ "google.com.hk",
3087
+ "google.hn",
3088
+ "google.hr",
3089
+ "google.ht",
3090
+ "google.hu",
3091
+ "google.co.id",
3092
+ "google.iq",
3093
+ "google.ie",
3094
+ "google.co.il",
3095
+ "google.im",
3096
+ "google.co.in",
3097
+ "google.io",
3098
+ "google.is",
3099
+ "google.it",
3100
+ "google.je",
3101
+ "google.com.jm",
3102
+ "google.jo",
3103
+ "google.co.jp",
3104
+ "google.co.ke",
3105
+ "google.com.kh",
3106
+ "google.ki",
3107
+ "google.kg",
3108
+ "google.co.kr",
3109
+ "google.com.kw",
3110
+ "google.kz",
3111
+ "google.la",
3112
+ "google.com.lb",
3113
+ "google.com.lc",
3114
+ "google.li",
3115
+ "google.lk",
3116
+ "google.co.ls",
3117
+ "google.lt",
3118
+ "google.lu",
3119
+ "google.lv",
3120
+ "google.com.ly",
3121
+ "google.co.ma",
3122
+ "google.md",
3123
+ "google.me",
3124
+ "google.mg",
3125
+ "google.mk",
3126
+ "google.ml",
3127
+ "google.mn",
3128
+ "google.ms",
3129
+ "google.com.mt",
3130
+ "google.mu",
3131
+ "google.mv",
3132
+ "google.mw",
3133
+ "google.com.mx",
3134
+ "google.com.my",
3135
+ "google.co.mz",
3136
+ "google.com.na",
3137
+ "google.ne",
3138
+ "google.com.nf",
3139
+ "google.com.ng",
3140
+ "google.com.ni",
3141
+ "google.nl",
3142
+ "google.no",
3143
+ "google.com.np",
3144
+ "google.nr",
3145
+ "google.nu",
3146
+ "google.co.nz",
3147
+ "google.com.om",
3148
+ "google.com.pa",
3149
+ "google.com.pe",
3150
+ "google.com.ph",
3151
+ "google.com.pk",
3152
+ "google.pl",
3153
+ "google.pn",
3154
+ "google.com.pr",
3155
+ "google.ps",
3156
+ "google.pt",
3157
+ "google.com.py",
3158
+ "google.com.qa",
3159
+ "google.ro",
3160
+ "google.rs",
3161
+ "google.ru",
3162
+ "google.rw",
3163
+ "google.com.sa",
3164
+ "google.com.sb",
3165
+ "google.sc",
3166
+ "google.se",
3167
+ "google.com.sg",
3168
+ "google.sh",
3169
+ "google.si",
3170
+ "google.sk",
3171
+ "google.com.sl",
3172
+ "google.sn",
3173
+ "google.sm",
3174
+ "google.so",
3175
+ "google.st",
3176
+ "google.com.sv",
3177
+ "google.td",
3178
+ "google.tg",
3179
+ "google.co.th",
3180
+ "google.com.tj",
3181
+ "google.tk",
3182
+ "google.tl",
3183
+ "google.tm",
3184
+ "google.to",
3185
+ "google.com.tn",
3186
+ "google.com.tr",
3187
+ "google.tt",
3188
+ "google.com.tw",
3189
+ "google.co.tz",
3190
+ "google.com.ua",
3191
+ "google.co.ug",
3192
+ "google.ae",
3193
+ "google.co.uk",
3194
+ "google.us",
3195
+ "google.com.uy",
3196
+ "google.co.uz",
3197
+ "google.com.vc",
3198
+ "google.co.ve",
3199
+ "google.vg",
3200
+ "google.co.vi",
3201
+ "google.com.vn",
3202
+ "google.vu",
3203
+ "google.ws",
3204
+ "google.co.za",
3205
+ "google.co.zm",
3206
+ "google.co.zw",
3207
+ "search.avg.com",
3208
+ "isearch.avg.com",
3209
+ "www.cnn.com",
3210
+ "darkoogle.com",
3211
+ "search.darkoogle.com",
3212
+ "search.foxtab.com",
3213
+ "www.gooofullsearch.com",
3214
+ "search.hiyo.com",
3215
+ "search.incredimail.com",
3216
+ "search1.incredimail.com",
3217
+ "search2.incredimail.com",
3218
+ "search3.incredimail.com",
3219
+ "search4.incredimail.com",
3220
+ "search.incredibar.com",
3221
+ "search.sweetim.com",
3222
+ "www.fastweb.it",
3223
+ "search.juno.com",
3224
+ "find.tdc.dk",
3225
+ "searchresults.verizon.com",
3226
+ "search.walla.co.il",
3227
+ "search.alot.com",
3228
+ "www.googleearth.de",
3229
+ "www.googleearth.fr",
3230
+ "webcache.googleusercontent.com",
3231
+ "encrypted.google.com",
3232
+ "googlesyndicatedsearch.com"
3233
+ ],
3234
+ "parameters": [
3235
+ "q",
3236
+ "query",
3237
+ "Keywords"
3238
+ ]
3239
+ },
3240
+ "Google Blogsearch": {
3241
+ "domains": [
3242
+ "blogsearch.google.ac",
3243
+ "blogsearch.google.ad",
3244
+ "blogsearch.google.ae",
3245
+ "blogsearch.google.am",
3246
+ "blogsearch.google.as",
3247
+ "blogsearch.google.at",
3248
+ "blogsearch.google.az",
3249
+ "blogsearch.google.ba",
3250
+ "blogsearch.google.be",
3251
+ "blogsearch.google.bf",
3252
+ "blogsearch.google.bg",
3253
+ "blogsearch.google.bi",
3254
+ "blogsearch.google.bj",
3255
+ "blogsearch.google.bs",
3256
+ "blogsearch.google.by",
3257
+ "blogsearch.google.ca",
3258
+ "blogsearch.google.cat",
3259
+ "blogsearch.google.cc",
3260
+ "blogsearch.google.cd",
3261
+ "blogsearch.google.cf",
3262
+ "blogsearch.google.cg",
3263
+ "blogsearch.google.ch",
3264
+ "blogsearch.google.ci",
3265
+ "blogsearch.google.cl",
3266
+ "blogsearch.google.cm",
3267
+ "blogsearch.google.cn",
3268
+ "blogsearch.google.co.bw",
3269
+ "blogsearch.google.co.ck",
3270
+ "blogsearch.google.co.cr",
3271
+ "blogsearch.google.co.id",
3272
+ "blogsearch.google.co.il",
3273
+ "blogsearch.google.co.in",
3274
+ "blogsearch.google.co.jp",
3275
+ "blogsearch.google.co.ke",
3276
+ "blogsearch.google.co.kr",
3277
+ "blogsearch.google.co.ls",
3278
+ "blogsearch.google.co.ma",
3279
+ "blogsearch.google.co.mz",
3280
+ "blogsearch.google.co.nz",
3281
+ "blogsearch.google.co.th",
3282
+ "blogsearch.google.co.tz",
3283
+ "blogsearch.google.co.ug",
3284
+ "blogsearch.google.co.uk",
3285
+ "blogsearch.google.co.uz",
3286
+ "blogsearch.google.co.ve",
3287
+ "blogsearch.google.co.vi",
3288
+ "blogsearch.google.co.za",
3289
+ "blogsearch.google.co.zm",
3290
+ "blogsearch.google.co.zw",
3291
+ "blogsearch.google.com",
3292
+ "blogsearch.google.com.af",
3293
+ "blogsearch.google.com.ag",
3294
+ "blogsearch.google.com.ai",
3295
+ "blogsearch.google.com.ar",
3296
+ "blogsearch.google.com.au",
3297
+ "blogsearch.google.com.bd",
3298
+ "blogsearch.google.com.bh",
3299
+ "blogsearch.google.com.bn",
3300
+ "blogsearch.google.com.bo",
3301
+ "blogsearch.google.com.br",
3302
+ "blogsearch.google.com.by",
3303
+ "blogsearch.google.com.bz",
3304
+ "blogsearch.google.com.co",
3305
+ "blogsearch.google.com.cu",
3306
+ "blogsearch.google.com.cy",
3307
+ "blogsearch.google.com.do",
3308
+ "blogsearch.google.com.ec",
3309
+ "blogsearch.google.com.eg",
3310
+ "blogsearch.google.com.et",
3311
+ "blogsearch.google.com.fj",
3312
+ "blogsearch.google.com.gh",
3313
+ "blogsearch.google.com.gi",
3314
+ "blogsearch.google.com.gt",
3315
+ "blogsearch.google.com.hk",
3316
+ "blogsearch.google.com.jm",
3317
+ "blogsearch.google.com.kh",
3318
+ "blogsearch.google.com.kh",
3319
+ "blogsearch.google.com.kw",
3320
+ "blogsearch.google.com.lb",
3321
+ "blogsearch.google.com.lc",
3322
+ "blogsearch.google.com.ly",
3323
+ "blogsearch.google.com.mt",
3324
+ "blogsearch.google.com.mx",
3325
+ "blogsearch.google.com.my",
3326
+ "blogsearch.google.com.na",
3327
+ "blogsearch.google.com.nf",
3328
+ "blogsearch.google.com.ng",
3329
+ "blogsearch.google.com.ni",
3330
+ "blogsearch.google.com.np",
3331
+ "blogsearch.google.com.om",
3332
+ "blogsearch.google.com.pa",
3333
+ "blogsearch.google.com.pe",
3334
+ "blogsearch.google.com.ph",
3335
+ "blogsearch.google.com.pk",
3336
+ "blogsearch.google.com.pr",
3337
+ "blogsearch.google.com.py",
3338
+ "blogsearch.google.com.qa",
3339
+ "blogsearch.google.com.sa",
3340
+ "blogsearch.google.com.sb",
3341
+ "blogsearch.google.com.sg",
3342
+ "blogsearch.google.com.sl",
3343
+ "blogsearch.google.com.sv",
3344
+ "blogsearch.google.com.tj",
3345
+ "blogsearch.google.com.tn",
3346
+ "blogsearch.google.com.tr",
3347
+ "blogsearch.google.com.tw",
3348
+ "blogsearch.google.com.ua",
3349
+ "blogsearch.google.com.uy",
3350
+ "blogsearch.google.com.vc",
3351
+ "blogsearch.google.com.vn",
3352
+ "blogsearch.google.cv",
3353
+ "blogsearch.google.cz",
3354
+ "blogsearch.google.de",
3355
+ "blogsearch.google.dj",
3356
+ "blogsearch.google.dk",
3357
+ "blogsearch.google.dm",
3358
+ "blogsearch.google.dz",
3359
+ "blogsearch.google.ee",
3360
+ "blogsearch.google.es",
3361
+ "blogsearch.google.fi",
3362
+ "blogsearch.google.fm",
3363
+ "blogsearch.google.fr",
3364
+ "blogsearch.google.ga",
3365
+ "blogsearch.google.gd",
3366
+ "blogsearch.google.ge",
3367
+ "blogsearch.google.gf",
3368
+ "blogsearch.google.gg",
3369
+ "blogsearch.google.gl",
3370
+ "blogsearch.google.gm",
3371
+ "blogsearch.google.gp",
3372
+ "blogsearch.google.gr",
3373
+ "blogsearch.google.gy",
3374
+ "blogsearch.google.hn",
3375
+ "blogsearch.google.hr",
3376
+ "blogsearch.google.ht",
3377
+ "blogsearch.google.hu",
3378
+ "blogsearch.google.ie",
3379
+ "blogsearch.google.im",
3380
+ "blogsearch.google.io",
3381
+ "blogsearch.google.iq",
3382
+ "blogsearch.google.is",
3383
+ "blogsearch.google.it",
3384
+ "blogsearch.google.it.ao",
3385
+ "blogsearch.google.je",
3386
+ "blogsearch.google.jo",
3387
+ "blogsearch.google.kg",
3388
+ "blogsearch.google.ki",
3389
+ "blogsearch.google.kz",
3390
+ "blogsearch.google.la",
3391
+ "blogsearch.google.li",
3392
+ "blogsearch.google.lk",
3393
+ "blogsearch.google.lt",
3394
+ "blogsearch.google.lu",
3395
+ "blogsearch.google.lv",
3396
+ "blogsearch.google.md",
3397
+ "blogsearch.google.me",
3398
+ "blogsearch.google.mg",
3399
+ "blogsearch.google.mk",
3400
+ "blogsearch.google.ml",
3401
+ "blogsearch.google.mn",
3402
+ "blogsearch.google.ms",
3403
+ "blogsearch.google.mu",
3404
+ "blogsearch.google.mv",
3405
+ "blogsearch.google.mw",
3406
+ "blogsearch.google.ne",
3407
+ "blogsearch.google.nl",
3408
+ "blogsearch.google.no",
3409
+ "blogsearch.google.nr",
3410
+ "blogsearch.google.nu",
3411
+ "blogsearch.google.pl",
3412
+ "blogsearch.google.pn",
3413
+ "blogsearch.google.ps",
3414
+ "blogsearch.google.pt",
3415
+ "blogsearch.google.ro",
3416
+ "blogsearch.google.rs",
3417
+ "blogsearch.google.ru",
3418
+ "blogsearch.google.rw",
3419
+ "blogsearch.google.sc",
3420
+ "blogsearch.google.se",
3421
+ "blogsearch.google.sh",
3422
+ "blogsearch.google.si",
3423
+ "blogsearch.google.sk",
3424
+ "blogsearch.google.sm",
3425
+ "blogsearch.google.sn",
3426
+ "blogsearch.google.so",
3427
+ "blogsearch.google.st",
3428
+ "blogsearch.google.td",
3429
+ "blogsearch.google.tg",
3430
+ "blogsearch.google.tk",
3431
+ "blogsearch.google.tl",
3432
+ "blogsearch.google.tm",
3433
+ "blogsearch.google.to",
3434
+ "blogsearch.google.tt",
3435
+ "blogsearch.google.us",
3436
+ "blogsearch.google.vg",
3437
+ "blogsearch.google.vu",
3438
+ "blogsearch.google.ws"
3439
+ ],
3440
+ "parameters": [
3441
+ "q"
3442
+ ]
3443
+ },
3444
+ "Amazon": {
3445
+ "domains": [
3446
+ "amazon.com",
3447
+ "www.amazon.com"
3448
+ ],
3449
+ "parameters": [
3450
+ "keywords"
3451
+ ]
3452
+ },
3453
+ "Hooseek.com": {
3454
+ "domains": [
3455
+ "www.hooseek.com"
3456
+ ],
3457
+ "parameters": [
3458
+ "recherche"
3459
+ ]
3460
+ },
3461
+ "Dalesearch": {
3462
+ "domains": [
3463
+ "www.dalesearch.com"
3464
+ ],
3465
+ "parameters": [
3466
+ "q"
3467
+ ]
3468
+ },
3469
+ "Alice Adsl": {
3470
+ "domains": [
3471
+ "rechercher.aliceadsl.fr"
3472
+ ],
3473
+ "parameters": [
3474
+ "q"
3475
+ ]
3476
+ },
3477
+ "soso.com": {
3478
+ "domains": [
3479
+ "www.soso.com"
3480
+ ],
3481
+ "parameters": [
3482
+ "w"
3483
+ ]
3484
+ },
3485
+ "Sogou": {
3486
+ "domains": [
3487
+ "www.sougou.com"
3488
+ ],
3489
+ "parameters": [
3490
+ "query"
3491
+ ]
3492
+ },
3493
+ "Hit-Parade": {
3494
+ "domains": [
3495
+ "req.-hit-parade.com",
3496
+ "class.hit-parade.com",
3497
+ "www.hit-parade.com"
3498
+ ],
3499
+ "parameters": [
3500
+ "p7"
3501
+ ]
3502
+ },
3503
+ "SearchCanvas": {
3504
+ "domains": [
3505
+ "www.searchcanvas.com"
3506
+ ],
3507
+ "parameters": [
3508
+ "q"
3509
+ ]
3510
+ },
3511
+ "Interia": {
3512
+ "domains": [
3513
+ "www.google.interia.pl"
3514
+ ],
3515
+ "parameters": [
3516
+ "q"
3517
+ ]
3518
+ },
3519
+ "Tiscali": {
3520
+ "domains": [
3521
+ "search.tiscali.it",
3522
+ "search-dyn.tiscali.it",
3523
+ "hledani.tiscali.cz"
3524
+ ],
3525
+ "parameters": [
3526
+ "q",
3527
+ "key"
3528
+ ]
3529
+ },
3530
+ "Clix": {
3531
+ "domains": [
3532
+ "pesquisa.clix.pt"
3533
+ ],
3534
+ "parameters": [
3535
+ "question"
3536
+ ]
3537
+ }
3538
+ },
3539
+ "email": {
3540
+ "Outlook.com": {
3541
+ "domains": [
3542
+ "mail.live.com"
3543
+ ]
3544
+ },
3545
+ "Orange Webmail": {
3546
+ "domains": [
3547
+ "orange.fr/webmail"
3548
+ ]
3549
+ },
3550
+ "Yahoo! Mail": {
3551
+ "domains": [
3552
+ "mail.yahoo.net",
3553
+ "mail.yahoo.com",
3554
+ "mail.yahoo.co.uk"
3555
+ ]
3556
+ },
3557
+ "Gmail": {
3558
+ "domains": [
3559
+ "mail.google.com"
3560
+ ]
3561
+ }
3562
+ },
3563
+ "social": {
3564
+ "hi5": {
3565
+ "domains": [
3566
+ "hi5.com"
3567
+ ]
3568
+ },
3569
+ "Friendster": {
3570
+ "domains": [
3571
+ "friendster.com"
3572
+ ]
3573
+ },
3574
+ "Weibo": {
3575
+ "domains": [
3576
+ "weibo.com",
3577
+ "t.cn"
3578
+ ]
3579
+ },
3580
+ "Xanga": {
3581
+ "domains": [
3582
+ "xanga.com"
3583
+ ]
3584
+ },
3585
+ "Myspace": {
3586
+ "domains": [
3587
+ "myspace.com"
3588
+ ]
3589
+ },
3590
+ "Buzznet": {
3591
+ "domains": [
3592
+ "wayn.com"
3593
+ ]
3594
+ },
3595
+ "MyLife": {
3596
+ "domains": [
3597
+ "mylife.ru"
3598
+ ]
3599
+ },
3600
+ "Flickr": {
3601
+ "domains": [
3602
+ "flickr.com"
3603
+ ]
3604
+ },
3605
+ "Sonico.com": {
3606
+ "domains": [
3607
+ "sonico.com"
3608
+ ]
3609
+ },
3610
+ "Odnoklassniki": {
3611
+ "domains": [
3612
+ "odnoklassniki.ru"
3613
+ ]
3614
+ },
3615
+ "GitHub": {
3616
+ "domains": [
3617
+ "github.com"
3618
+ ]
3619
+ },
3620
+ "Classmates": {
3621
+ "domains": [
3622
+ "classmates.com"
3623
+ ]
3624
+ },
3625
+ "Friends Reunited": {
3626
+ "domains": [
3627
+ "friendsreunited.com"
3628
+ ]
3629
+ },
3630
+ "Renren": {
3631
+ "domains": [
3632
+ "renren.com"
3633
+ ]
3634
+ },
3635
+ "vKruguDruzei.ru": {
3636
+ "domains": [
3637
+ "vkrugudruzei.ru"
3638
+ ]
3639
+ },
3640
+ "Gaia Online": {
3641
+ "domains": [
3642
+ "gaiaonline.com"
3643
+ ]
3644
+ },
3645
+ "Netlog": {
3646
+ "domains": [
3647
+ "netlog.com"
3648
+ ]
3649
+ },
3650
+ "Orkut": {
3651
+ "domains": [
3652
+ "orkut.com"
3653
+ ]
3654
+ },
3655
+ "MyHeritage": {
3656
+ "domains": [
3657
+ "myheritage.com"
3658
+ ]
3659
+ },
3660
+ "Multiply": {
3661
+ "domains": [
3662
+ "multiply.com"
3663
+ ]
3664
+ },
3665
+ "myYearbook": {
3666
+ "domains": [
3667
+ "myyearbook.com"
3668
+ ]
3669
+ },
3670
+ "WeeWorld": {
3671
+ "domains": [
3672
+ "weeworld.com"
3673
+ ]
3674
+ },
3675
+ "Geni": {
3676
+ "domains": [
3677
+ "geni.com"
3678
+ ]
3679
+ },
3680
+ "SourceForge": {
3681
+ "domains": [
3682
+ "sourceforge.net"
3683
+ ]
3684
+ },
3685
+ "Plaxo": {
3686
+ "domains": [
3687
+ "plaxo.com"
3688
+ ]
3689
+ },
3690
+ "Taringa!": {
3691
+ "domains": [
3692
+ "taringa.net"
3693
+ ]
3694
+ },
3695
+ "Tagged": {
3696
+ "domains": [
3697
+ "login.tagged.com"
3698
+ ]
3699
+ },
3700
+ "XING": {
3701
+ "domains": [
3702
+ "xing.com"
3703
+ ]
3704
+ },
3705
+ "Vkontakte": {
3706
+ "domains": [
3707
+ "vk.com",
3708
+ "vkontakte.ru"
3709
+ ]
3710
+ },
3711
+ "Twitter": {
3712
+ "domains": [
3713
+ "twitter.com",
3714
+ "t.co"
3715
+ ]
3716
+ },
3717
+ "WAYN": {
3718
+ "domains": [
3719
+ "wayn.com"
3720
+ ]
3721
+ },
3722
+ "Tuenti": {
3723
+ "domains": [
3724
+ "tuenti.com"
3725
+ ]
3726
+ },
3727
+ "Mail.ru": {
3728
+ "domains": [
3729
+ "my.mail.ru"
3730
+ ]
3731
+ },
3732
+ "Badoo": {
3733
+ "domains": [
3734
+ "badoo.com"
3735
+ ]
3736
+ },
3737
+ "Habbo": {
3738
+ "domains": [
3739
+ "habbo.com"
3740
+ ]
3741
+ },
3742
+ "Pinterest": {
3743
+ "domains": [
3744
+ "pinterest.com"
3745
+ ]
3746
+ },
3747
+ "LinkedIn": {
3748
+ "domains": [
3749
+ "linkedin.com"
3750
+ ]
3751
+ },
3752
+ "Foursquare": {
3753
+ "domains": [
3754
+ "foursquare.com"
3755
+ ]
3756
+ },
3757
+ "Flixster": {
3758
+ "domains": [
3759
+ "flixster.com"
3760
+ ]
3761
+ },
3762
+ "Windows Live Spaces": {
3763
+ "domains": [
3764
+ "login.live.com"
3765
+ ]
3766
+ },
3767
+ "BlackPlanet": {
3768
+ "domains": [
3769
+ "blackplanet.com"
3770
+ ]
3771
+ },
3772
+ "Cyworld": {
3773
+ "domains": [
3774
+ "global.cyworld.com"
3775
+ ]
3776
+ },
3777
+ "Skyrock": {
3778
+ "domains": [
3779
+ "skyrock.com"
3780
+ ]
3781
+ },
3782
+ "Facebook": {
3783
+ "domains": [
3784
+ "facebook.com",
3785
+ "fb.me"
3786
+ ]
3787
+ },
3788
+ "StudiVZ": {
3789
+ "domains": [
3790
+ "studivz.net"
3791
+ ]
3792
+ },
3793
+ "Fotolog": {
3794
+ "domains": [
3795
+ "fotolog.com"
3796
+ ]
3797
+ },
3798
+ "Google+": {
3799
+ "domains": [
3800
+ "url.google.com",
3801
+ "plus.google.com"
3802
+ ]
3803
+ },
3804
+ "Nasza-klasa.pl": {
3805
+ "domains": [
3806
+ "nk.pl"
3807
+ ]
3808
+ },
3809
+ "Douban": {
3810
+ "domains": [
3811
+ "douban.com"
3812
+ ]
3813
+ },
3814
+ "Bebo": {
3815
+ "domains": [
3816
+ "bebo.com"
3817
+ ]
3818
+ },
3819
+ "Reddit": {
3820
+ "domains": [
3821
+ "reddit.com"
3822
+ ]
3823
+ },
3824
+ "Identi.ca": {
3825
+ "domains": [
3826
+ "identi.ca"
3827
+ ]
3828
+ },
3829
+ "StackOverflow": {
3830
+ "domains": [
3831
+ "stackoverflow.com"
3832
+ ]
3833
+ },
3834
+ "Mixi": {
3835
+ "domains": [
3836
+ "mixi.jp"
3837
+ ]
3838
+ },
3839
+ "StumbleUpon": {
3840
+ "domains": [
3841
+ "stumbleupon.com"
3842
+ ]
3843
+ },
3844
+ "Viadeo": {
3845
+ "domains": [
3846
+ "viadeo.com"
3847
+ ]
3848
+ },
3849
+ "Last.fm": {
3850
+ "domains": [
3851
+ "lastfm.ru"
3852
+ ]
3853
+ },
3854
+ "LiveJournal": {
3855
+ "domains": [
3856
+ "livejournal.ru"
3857
+ ]
3858
+ },
3859
+ "Tumblr": {
3860
+ "domains": [
3861
+ "tumblr.com"
3862
+ ]
3863
+ },
3864
+ "Hacker News": {
3865
+ "domains": [
3866
+ "news.ycombinator.com"
3867
+ ]
3868
+ },
3869
+ "Qzone": {
3870
+ "domains": [
3871
+ "qzone.qq.com"
3872
+ ]
3873
+ },
3874
+ "Hyves": {
3875
+ "domains": [
3876
+ "hyves.nl"
3877
+ ]
3878
+ },
3879
+ "Paper.li": {
3880
+ "domains": [
3881
+ "paper.li"
3882
+ ]
3883
+ },
3884
+ "MoiKrug.ru": {
3885
+ "domains": [
3886
+ "moikrug.ru"
3887
+ ]
3888
+ }
3889
+ }
3890
+ }
admin/leadin-admin.php CHANGED
@@ -29,6 +29,9 @@ if ( !class_exists('LI_Pointers') )
29
  if ( !class_exists('LI_Viewers') )
30
  require_once LEADIN_PLUGIN_DIR . '/admin/inc/class-leadin-viewers.php';
31
 
 
 
 
32
  include_once(ABSPATH . 'wp-admin/includes/plugin.php');
33
 
34
  //=============================================
@@ -39,6 +42,7 @@ class WPLeadInAdmin {
39
  var $admin_power_ups;
40
  var $li_viewers;
41
  var $power_up_icon;
 
42
 
43
  /**
44
  * Class constructor
@@ -57,6 +61,11 @@ class WPLeadInAdmin {
57
  add_action('admin_init', array(&$this, 'leadin_build_settings_page'));
58
  add_action('admin_print_styles', array(&$this, 'add_leadin_admin_styles'));
59
  add_action('add_meta_boxes', array(&$this, 'add_li_analytics_meta_box' ));
 
 
 
 
 
60
  }
61
  }
62
 
@@ -74,6 +83,8 @@ class WPLeadInAdmin {
74
 
75
  self::check_admin_action();
76
 
 
 
77
  foreach ( $this->admin_power_ups as $power_up )
78
  {
79
  if ( $power_up->activated )
@@ -81,16 +92,15 @@ class WPLeadInAdmin {
81
  $power_up->admin_init();
82
 
83
  // Creates the menu icon for power-up if it's set. Overrides the main LeadIn menu to hit the contacts power-up
84
- if ( $power_up->menu_text == 'Contacts' )
85
- add_menu_page('LeadIn', 'LeadIn', 'manage_categories', 'leadin_contacts', array($power_up, 'power_up_setup_callback'), LEADIN_PATH . '/images/' . ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'leadin-icon-32x32.png' : 'leadin-svg-icon.svg'));
86
- else if ( $power_up->menu_text )
87
- add_submenu_page('leadin_contacts', $power_up->menu_text, $power_up->menu_text, 'manage_categories', 'leadin_' . $power_up->menu_link, array($power_up, 'power_up_setup_callback'));
88
  }
89
  }
90
 
91
- add_submenu_page('leadin_contacts', 'Settings', 'Settings', 'manage_categories', 'leadin_settings', array(&$this, 'leadin_plugin_options'));
92
- add_submenu_page('leadin_contacts', 'Power-ups', 'Power-ups', 'manage_categories', 'leadin_power_ups', array(&$this, 'leadin_power_ups_page'));
93
- $submenu['leadin_contacts'][0][0] = 'Contacts';
94
 
95
  if ( !isset($_GET['page']) || $_GET['page'] != 'leadin_settings' )
96
  {
@@ -118,6 +128,212 @@ class WPLeadInAdmin {
118
  return $links;
119
  }
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  /**
122
  * Creates settings options
123
  */
@@ -366,6 +582,7 @@ class WPLeadInAdmin {
366
 
367
  <ul class="powerup-list">
368
 
 
369
  <?php foreach ( $this->admin_power_ups as $power_up ) : ?>
370
  <?php
371
  // Skip displaying the power-up on the power-ups page if it's hidden
@@ -373,6 +590,18 @@ class WPLeadInAdmin {
373
  continue;
374
  ?>
375
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  <li class="powerup <?php echo ( $power_up->activated ? 'activated' : ''); ?>">
377
  <h2><?php echo $power_up->power_up_name; ?></h2>
378
  <?php if ( strstr($power_up->icon, 'dashicons') ) : ?>
@@ -399,16 +628,9 @@ class WPLeadInAdmin {
399
  <?php endif; ?>
400
  <?php endif; ?>
401
  </li>
 
402
  <?php endforeach; ?>
403
 
404
- <!-- static power-ups -->
405
- <li class="powerup">
406
- <h2>Content Analytics</h2>
407
- <img src="<?php echo LEADIN_PATH; ?>/images/powerup-icon-analytics@2x.png" height="80px" width="80px">
408
- <p>See where all your conversions are coming from.</p>
409
- <p><a href="http://leadin.com/content-analytics-plugin-wordpress/">Learn more</a></p>
410
- <a disabled="true" class="button button-primary button-large">Coming soon</a>
411
- </li>
412
  <li class="powerup">
413
  <h2>Your Idea</h2>
414
  <img src="<?php echo LEADIN_PATH; ?>/images/powerup-icon-ideas@2x.png" height="80px" width="80px">
@@ -416,6 +638,7 @@ class WPLeadInAdmin {
416
  <p>&nbsp;</p>
417
  <a href="mailto:team@leadin.com" target="_blank" class="button button-primary button-large">Suggest an idea</a>
418
  </li>
 
419
  </ul>
420
 
421
  <?php
@@ -471,6 +694,9 @@ class WPLeadInAdmin {
471
  {
472
  wp_register_style('leadin-admin-css', LEADIN_PATH . '/assets/css/build/leadin-admin.css');
473
  wp_enqueue_style('leadin-admin-css');
 
 
 
474
  }
475
 
476
  //=============================================
@@ -479,32 +705,35 @@ class WPLeadInAdmin {
479
 
480
  /**
481
  * Creates postbox for admin
 
482
  * @param string
483
  * @param string
484
  * @param string
485
  * @param bool
486
  * @return string HTML for postbox
487
  */
488
- function leadin_postbox ( $id, $title, $content, $handle = TRUE )
489
  {
490
  $postbox_wrap = "";
491
- $postbox_wrap .= '<div id="' . $id . '" class="postbox leadin-admin-postbox">';
492
- $postbox_wrap .= ( $handle ? '<div class="handlediv" title="Click to toggle"><br /></div>' : '' );
493
- $postbox_wrap .= '<h3 class="hndle"><span>' . $title . '</span></h3>';
494
- $postbox_wrap .= '<div class="inside">' . $content . '</div>';
495
  $postbox_wrap .= '</div>';
 
496
  return $postbox_wrap;
497
  }
498
 
499
  /**
500
  * Prints the admin page title, icon and help notification
 
501
  * @param string
502
  */
503
- function leadin_header ( $page_title = '' )
504
  {
505
  ?>
506
  <?php screen_icon('leadin'); ?>
507
- <h2><?php echo $page_title; ?></h2>
508
 
509
  <?php if ( isset($_GET['settings-updated']) ) : ?>
510
  <div id="message" class="updated">
@@ -625,7 +854,200 @@ class WPLeadInAdmin {
625
  </tr>
626
  </tbody></table>
627
  <?php
628
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
629
  }
630
 
631
  ?>
29
  if ( !class_exists('LI_Viewers') )
30
  require_once LEADIN_PLUGIN_DIR . '/admin/inc/class-leadin-viewers.php';
31
 
32
+ if ( !class_exists('LI_StatsDashboard') )
33
+ require_once LEADIN_PLUGIN_DIR . '/admin/inc/class-stats-dashboard.php';
34
+
35
  include_once(ABSPATH . 'wp-admin/includes/plugin.php');
36
 
37
  //=============================================
42
  var $admin_power_ups;
43
  var $li_viewers;
44
  var $power_up_icon;
45
+ var $stats_dashboard;
46
 
47
  /**
48
  * Class constructor
61
  add_action('admin_init', array(&$this, 'leadin_build_settings_page'));
62
  add_action('admin_print_styles', array(&$this, 'add_leadin_admin_styles'));
63
  add_action('add_meta_boxes', array(&$this, 'add_li_analytics_meta_box' ));
64
+
65
+ if ( isset($_GET['page']) && $_GET['page'] == 'leadin_stats' )
66
+ {
67
+ add_action('admin_footer', array($this, 'build_contacts_chart'));
68
+ }
69
  }
70
  }
71
 
83
 
84
  self::check_admin_action();
85
 
86
+ add_menu_page('LeadIn', 'LeadIn', 'manage_categories', 'leadin_stats', array($this, 'leadin_build_stats_page'), LEADIN_PATH . '/images/' . ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'leadin-icon-32x32.png' : 'leadin-svg-icon.svg'));
87
+
88
  foreach ( $this->admin_power_ups as $power_up )
89
  {
90
  if ( $power_up->activated )
92
  $power_up->admin_init();
93
 
94
  // Creates the menu icon for power-up if it's set. Overrides the main LeadIn menu to hit the contacts power-up
95
+ //if ( $power_up->menu_text == 'Contacts' )
96
+ if ( $power_up->menu_text )
97
+ add_submenu_page('leadin_stats', $power_up->menu_text, $power_up->menu_text, 'manage_categories', 'leadin_' . $power_up->menu_link, array($power_up, 'power_up_setup_callback'));
 
98
  }
99
  }
100
 
101
+ add_submenu_page('leadin_stats', 'Settings', 'Settings', 'manage_categories', 'leadin_settings', array(&$this, 'leadin_plugin_options'));
102
+ add_submenu_page('leadin_stats', 'Power-ups', 'Power-ups', 'manage_categories', 'leadin_power_ups', array(&$this, 'leadin_power_ups_page'));
103
+ $submenu['leadin_stats'][0][0] = 'Stats';
104
 
105
  if ( !isset($_GET['page']) || $_GET['page'] != 'leadin_settings' )
106
  {
128
  return $links;
129
  }
130
 
131
+ /**
132
+ * Creates the stats page
133
+ */
134
+ function leadin_build_stats_page ()
135
+ {
136
+ global $wp_version;
137
+ $this->stats_dashboard = new LI_StatsDashboard();
138
+
139
+ leadin_track_plugin_activity("Loaded Stats Page");
140
+
141
+ if ( !current_user_can( 'manage_categories' ) )
142
+ {
143
+ wp_die(__('You do not have sufficient permissions to access this page.'));
144
+ }
145
+
146
+ echo '<div id="leadin" class="li-stats wrap '. ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'pre-mp6' : ''). '">';
147
+
148
+ $this->leadin_header('LeadIn Stats: ' . date('F j Y, g:ia', current_time('timestamp')), 'leadin-stats__header');
149
+
150
+ echo '<div class="leadin-stats__top-container">';
151
+ echo $this->leadin_postbox('leadin-stats__chart', leadin_single_plural_label(number_format($this->stats_dashboard->total_contacts_last_30_days), 'new contact', 'new contacts') . ' last 30 days', $this->leadin_build_contacts_chart_stats());
152
+ echo '</div>';
153
+
154
+ echo '<div class="leadin-stats__postbox_containter">';
155
+ echo $this->leadin_postbox('leadin-stats__new-contacts', leadin_single_plural_label(number_format($this->stats_dashboard->total_new_contacts), 'new contact', 'new contacts') . ' today', $this->leadin_build_new_contacts_postbox());
156
+ echo $this->leadin_postbox('leadin-stats__returning-contacts', leadin_single_plural_label(number_format($this->stats_dashboard->total_returning_contacts), 'returning contact', 'returning contacts') . ' today', $this->leadin_build_returning_contacts_postbox());
157
+ echo '</div>';
158
+
159
+
160
+
161
+ echo '<div class="leadin-stats__postbox_containter">';
162
+ echo $this->leadin_postbox('leadin-stats__sources', 'New contact sources last 30 days', $this->leadin_build_sources_postbox());
163
+ echo '</div>';
164
+
165
+ }
166
+
167
+ /**
168
+ * Creates contacts chart content
169
+ */
170
+ function leadin_build_contacts_chart_stats ()
171
+ {
172
+ $contacts_chart = "";
173
+
174
+ $contacts_chart .= "<div class='leadin-stats__chart-container'>";
175
+ $contacts_chart .= "<div id='contacts_chart' style='width:100%; height:250px;'></div>";
176
+ $contacts_chart .= "</div>";
177
+ $contacts_chart .= "<div class='leadin-stats__big-numbers-container'>";
178
+ $contacts_chart .= "<div class='leadin-stats__big-number'>";
179
+ $contacts_chart .= "<label class='leadin-stats__big-number-top-label'>TODAY</label>";
180
+ $contacts_chart .= "<h1 class='leadin-stats__big-number-content'>" . number_format($this->stats_dashboard->total_new_contacts) . "</h1>";
181
+ $contacts_chart .= "<label class='leadin-stats__big-number-bottom-label'>new " . ( $this->stats_dashboard->total_new_contacts != 1 ? 'contacts' : 'contact' ) . "</label>";
182
+ $contacts_chart .= "</div>";
183
+ $contacts_chart .= "<div class='leadin-stats__big-number big-number--average'>";
184
+ $contacts_chart .= "<label class='leadin-stats__big-number-top-label'>AVG LAST 90 DAYS</label>";
185
+ $contacts_chart .= "<h1 class='leadin-stats__big-number-content'>" . number_format($this->stats_dashboard->avg_contacts_last_90_days) . "</h1>";
186
+ $contacts_chart .= "<label class='leadin-stats__big-number-bottom-label'>new " . ( $this->stats_dashboard->avg_contacts_last_90_days != 1 ? 'contacts' : 'contact' ) . "</label>";
187
+ $contacts_chart .= "</div>";
188
+ $contacts_chart .= "<div class='leadin-stats__big-number'>";
189
+ $contacts_chart .= "<label class='leadin-stats__big-number-top-label'>BEST DAY EVER</label>";
190
+ $contacts_chart .= "<h1 class='leadin-stats__big-number-content'>" . number_format($this->stats_dashboard->best_day_ever) . "</h1>";
191
+ $contacts_chart .= "<label class='leadin-stats__big-number-bottom-label'>new " . ( $this->stats_dashboard->best_day_ever != 1 ? 'contacts' : 'contact' ) . "</label>";
192
+ $contacts_chart .= "</div>";
193
+ $contacts_chart .= "<div class='leadin-stats__big-number'>";
194
+ $contacts_chart .= "<label class='leadin-stats__big-number-top-label'>ALL TIME</label>";
195
+ $contacts_chart .= "<h1 class='leadin-stats__big-number-content'>" . number_format($this->stats_dashboard->total_contacts) . "</h1>";
196
+ $contacts_chart .= "<label class='leadin-stats__big-number-bottom-label'>total " . ( $this->stats_dashboard->total_contacts != 1 ? 'contacts' : 'contact' ) . "</label>";
197
+ $contacts_chart .= "</div>";
198
+ $contacts_chart .= "</div>";
199
+
200
+ return $contacts_chart;
201
+ }
202
+
203
+ /**
204
+ * Creates contacts chart content
205
+ */
206
+ function leadin_build_new_contacts_postbox ()
207
+ {
208
+ $new_contacts_postbox = "";
209
+
210
+ if ( count($this->stats_dashboard->new_contacts) )
211
+ {
212
+ $new_contacts_postbox .= '<table class="leadin-postbox__table"><tbody>';
213
+ $new_contacts_postbox .= '<tr>';
214
+ $new_contacts_postbox .= '<th>contact</th>';
215
+ $new_contacts_postbox .= '<th>pageviews</th>';
216
+ $new_contacts_postbox .= '<th>original source</th>';
217
+ $new_contacts_postbox .= '</tr>';
218
+
219
+
220
+
221
+ foreach ( $this->stats_dashboard->new_contacts as $contact )
222
+ {
223
+ $new_contacts_postbox .= '<tr>';
224
+ $new_contacts_postbox .= '<td class="">';
225
+ $new_contacts_postbox .= '<a href="?page=leadin_contacts&action=view&lead=' . $contact->lead_id . '&stats_dashboard=1"><img class="lazy pull-left leadin-contact-avatar leadin-dynamic-avatar_' . substr($contact->lead_id, -1) .'" src="https://app.getsignals.com/avatar/image/?emails=' . $contact->lead_email . '" width="35" height="35"><b>' . $contact->lead_email . '</b></a>';
226
+ $new_contacts_postbox .= '</td>';
227
+ $new_contacts_postbox .= '<td class="">' . $contact->pageviews . '</td>';
228
+ $new_contacts_postbox .= '<td class="">' . $this->stats_dashboard->print_readable_source($this->stats_dashboard->check_lead_source($contact->lead_source)) . '</td>';
229
+ $new_contacts_postbox .= '</tr>';
230
+ }
231
+
232
+ $new_contacts_postbox .= '</tbody></table>';
233
+ }
234
+ else
235
+ $new_contacts_postbox .= '<i>No new contacts today...</i>';
236
+
237
+
238
+
239
+ return $new_contacts_postbox;
240
+ }
241
+
242
+ /**
243
+ * Creates contacts chart content
244
+ */
245
+ function leadin_build_returning_contacts_postbox ()
246
+ {
247
+ $returning_contacts_postbox = "";
248
+
249
+ if ( count($this->stats_dashboard->returning_contacts) )
250
+ {
251
+ $returning_contacts_postbox .= '<table class="leadin-postbox__table"><tbody>';
252
+ $returning_contacts_postbox .= '<tr>';
253
+ $returning_contacts_postbox .= '<th>contact</th>';
254
+ $returning_contacts_postbox .= '<th>pageviews</th>';
255
+ $returning_contacts_postbox .= '<th>original source</th>';
256
+ $returning_contacts_postbox .= '</tr>';
257
+
258
+ foreach ( $this->stats_dashboard->returning_contacts as $contact )
259
+ {
260
+ $returning_contacts_postbox .= '<tr>';
261
+ $returning_contacts_postbox .= '<td class="">';
262
+ $returning_contacts_postbox .= '<a href="?page=leadin_contacts&action=view&lead=' . $contact->lead_id . '&stats_dashboard=1"><img class="lazy pull-left leadin-contact-avatar leadin-dynamic-avatar_' . substr($contact->lead_id, -1) .'" src="https://app.getsignals.com/avatar/image/?emails=' . $contact->lead_email . '" width="35" height="35"><b>' . $contact->lead_email . '</b></a>';
263
+ $returning_contacts_postbox .= '</td>';
264
+ $returning_contacts_postbox .= '<td class="">' . $contact->pageviews . '</td>';
265
+ $returning_contacts_postbox .= '<td class="">' . $this->stats_dashboard->print_readable_source($this->stats_dashboard->check_lead_source($contact->lead_source)) . '</td>';
266
+ $returning_contacts_postbox .= '</tr>';
267
+ }
268
+
269
+ $returning_contacts_postbox .= '</tbody></table>';
270
+ }
271
+ else
272
+ $returning_contacts_postbox .= '<i>No returning contacts today...</i>';
273
+
274
+ return $returning_contacts_postbox;
275
+ }
276
+
277
+ /**
278
+ * Creates contacts chart content
279
+ */
280
+ function leadin_build_sources_postbox ()
281
+ {
282
+ $sources_postbox = "";
283
+
284
+ $sources_postbox .= '<table class="leadin-postbox__table"><tbody>';
285
+ $sources_postbox .= '<tr>';
286
+ $sources_postbox .= '<th width="150">source</th>';
287
+ $sources_postbox .= '<th width="20">Contacts</th>';
288
+ $sources_postbox .= '<th></th>';
289
+ $sources_postbox .= '</tr>';
290
+ $sources_postbox .= '<tr>';
291
+ $sources_postbox .= '<td class="">Direct Traffic</td>';
292
+ $sources_postbox .= '<td class="">' . $this->stats_dashboard->direct_count . '</td>';
293
+ $sources_postbox .= '<td>';
294
+ $sources_postbox .= '<div style="background: #f0f0f0; padding: 0px; height: 20px !important;"><div style="background: #f16b18; height: 100%; width: ' . ( $this->stats_dashboard->max_source ? (($this->stats_dashboard->direct_count/$this->stats_dashboard->max_source)*100) : '0' ) . '%;">&nbsp;</div></div>';
295
+ $sources_postbox .= '</td>';
296
+ $sources_postbox .= '</tr>';
297
+ $sources_postbox .= '<tr>';
298
+ $sources_postbox .= '<td class="">Organic Search</td>';
299
+ $sources_postbox .= '<td class="">' . $this->stats_dashboard->organic_count . '</td>';
300
+ $sources_postbox .= '<td>';
301
+ $sources_postbox .= '<div style="background: #f0f0f0; padding: 0px; height: 20px !important;"><div style="background: #f16b18; height: 100%; width: ' . ( $this->stats_dashboard->max_source ? (($this->stats_dashboard->organic_count/$this->stats_dashboard->max_source)*100) : '0' ) . '%;">&nbsp;</div></div>';
302
+ $sources_postbox .= '</td>';
303
+ $sources_postbox .= '</tr>';
304
+ $sources_postbox .= '<tr>';
305
+ $sources_postbox .= '<td class="">Referrals</td>';
306
+ $sources_postbox .= '<td class="">' . $this->stats_dashboard->referral_count . '</td>';
307
+ $sources_postbox .= '<td>';
308
+ $sources_postbox .= '<div style="background: #f0f0f0; padding: 0px; height: 20px !important;"><div style="background: #f16b18; height: 100%; width: ' . ( $this->stats_dashboard->max_source ? (($this->stats_dashboard->referral_count/$this->stats_dashboard->max_source)*100) : '0' ) . '%;">&nbsp;</div></div>';
309
+ $sources_postbox .= '</td>';
310
+ $sources_postbox .= '</tr>';
311
+ $sources_postbox .= '<tr>';
312
+ $sources_postbox .= '<td class="">Social Media</td>';
313
+ $sources_postbox .= '<td class="">' . $this->stats_dashboard->social_count . '</td>';
314
+ $sources_postbox .= '<td>';
315
+ $sources_postbox .= '<div style="background: #f0f0f0; padding: 0px; height: 20px !important;"><div style="background: #f16b18; height: 100%; width: ' . ( $this->stats_dashboard->max_source ? (($this->stats_dashboard->social_count/$this->stats_dashboard->max_source)*100) : '0' ). '%;">&nbsp;</div></div>';
316
+ $sources_postbox .= '</td>';
317
+ $sources_postbox .= '</tr>';
318
+ $sources_postbox .= '<tr>';
319
+ $sources_postbox .= '<td class="">Email Marketing</td>';
320
+ $sources_postbox .= '<td class="">' . $this->stats_dashboard->email_count . '</td>';
321
+ $sources_postbox .= '<td>';
322
+ $sources_postbox .= '<div style="background: #f0f0f0; padding: 0px; height: 20px !important;"><div style="background: #f16b18; height: 100%; width: ' . ( $this->stats_dashboard->max_source ? (($this->stats_dashboard->email_count/$this->stats_dashboard->max_source)*100) : '0' ) . '%;">&nbsp;</div></div>';
323
+ $sources_postbox .= '</td>';
324
+ $sources_postbox .= '</tr>';
325
+ $sources_postbox .= '<tr>';
326
+ $sources_postbox .= '<td class="">Paid Search</td>';
327
+ $sources_postbox .= '<td class="">' . $this->stats_dashboard->paid_count . '</td>';
328
+ $sources_postbox .= '<td>';
329
+ $sources_postbox .= '<div style="background: #f0f0f0; padding: 0px; height: 20px !important;"><div style="background: #f16b18; height: 100%; width: ' . ( $this->stats_dashboard->max_source ? (($this->stats_dashboard->paid_count/$this->stats_dashboard->max_source)*100) : '0' ) . '%;">&nbsp;</div></div>';
330
+ $sources_postbox .= '</td>';
331
+ $sources_postbox .= '</tr>';
332
+ $sources_postbox .= '</tbody></table>';
333
+
334
+ return $sources_postbox;
335
+ }
336
+
337
  /**
338
  * Creates settings options
339
  */
582
 
583
  <ul class="powerup-list">
584
 
585
+ <?php $power_up_count = 0; ?>
586
  <?php foreach ( $this->admin_power_ups as $power_up ) : ?>
587
  <?php
588
  // Skip displaying the power-up on the power-ups page if it's hidden
590
  continue;
591
  ?>
592
 
593
+ <?php if ( $power_up_count == 1 ) : ?>
594
+ <!-- static content stats power-up - not a real powerup and this is a hack to put it second in the order -->
595
+ <li class="powerup activated">
596
+ <h2>Content Stats</h2>
597
+ <img src="<?php echo LEADIN_PATH; ?>/images/powerup-icon-analytics@2x.png" height="80px" width="80px">
598
+ <p>See where all your conversions are coming from.</p>
599
+ <p><a href="http://leadin.com/content-analytics-plugin-wordpress/" target="_blank">Learn more</a></p>
600
+ <a href="<?php echo get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_stats'; ?>" class="button button-large">View Stats</a>
601
+ </li>
602
+ <?php $power_up_count++; ?>
603
+ <?php endif; ?>
604
+
605
  <li class="powerup <?php echo ( $power_up->activated ? 'activated' : ''); ?>">
606
  <h2><?php echo $power_up->power_up_name; ?></h2>
607
  <?php if ( strstr($power_up->icon, 'dashicons') ) : ?>
628
  <?php endif; ?>
629
  <?php endif; ?>
630
  </li>
631
+ <?php $power_up_count++; ?>
632
  <?php endforeach; ?>
633
 
 
 
 
 
 
 
 
 
634
  <li class="powerup">
635
  <h2>Your Idea</h2>
636
  <img src="<?php echo LEADIN_PATH; ?>/images/powerup-icon-ideas@2x.png" height="80px" width="80px">
638
  <p>&nbsp;</p>
639
  <a href="mailto:team@leadin.com" target="_blank" class="button button-primary button-large">Suggest an idea</a>
640
  </li>
641
+
642
  </ul>
643
 
644
  <?php
694
  {
695
  wp_register_style('leadin-admin-css', LEADIN_PATH . '/assets/css/build/leadin-admin.css');
696
  wp_enqueue_style('leadin-admin-css');
697
+
698
+ wp_register_style('select2', LEADIN_PATH . '/assets/css/select2.css');
699
+ wp_enqueue_style('select2');
700
  }
701
 
702
  //=============================================
705
 
706
  /**
707
  * Creates postbox for admin
708
+ *
709
  * @param string
710
  * @param string
711
  * @param string
712
  * @param bool
713
  * @return string HTML for postbox
714
  */
715
+ function leadin_postbox ( $css_class, $title, $content, $handle = TRUE )
716
  {
717
  $postbox_wrap = "";
718
+
719
+ $postbox_wrap .= '<div class="' . $css_class . ' leadin-postbox">';
720
+ $postbox_wrap .= '<h3 class="leadin-postbox__header">' . $title . '</h3>';
721
+ $postbox_wrap .= '<div class="leadin-postbox__content">' . $content . '</div>';
722
  $postbox_wrap .= '</div>';
723
+
724
  return $postbox_wrap;
725
  }
726
 
727
  /**
728
  * Prints the admin page title, icon and help notification
729
+ *
730
  * @param string
731
  */
732
+ function leadin_header ( $page_title = '', $css_class = '' )
733
  {
734
  ?>
735
  <?php screen_icon('leadin'); ?>
736
+ <h2 class="<?php echo $css_class ?>"><?php echo $page_title; ?></h2>
737
 
738
  <?php if ( isset($_GET['settings-updated']) ) : ?>
739
  <div id="message" class="updated">
854
  </tr>
855
  </tbody></table>
856
  <?php
857
+ }
858
+
859
+
860
+ function build_contacts_chart ( )
861
+ {
862
+ ?>
863
+ <script type="text/javascript">
864
+
865
+ function create_weekends ( $ )
866
+ {
867
+ var $ = jQuery;
868
+
869
+ series = chart.get('contacts');
870
+ var in_between = Math.floor(series.data[1].barX - (Math.floor(series.data[0].barX) + Math.floor(series.data[0].pointWidth)))*2;
871
+
872
+ $series = $('.highcharts-series').first();
873
+ $series.find('rect').each ( function ( e ) {
874
+ var $this = $(this);
875
+ $this.attr('width', (Math.floor(series.data[0].pointWidth) + Math.floor(in_between/2)));
876
+ $this.attr('x', $this.attr('x') - Math.floor(in_between/4));
877
+ $this.css('opacity', 100);
878
+ });
879
+ }
880
+
881
+ function hide_weekends ( $ )
882
+ {
883
+ var $ = jQuery;
884
+
885
+ series = chart.get('contacts');
886
+
887
+ $series = $('.highcharts-series').first();
888
+ $series.find('rect').each ( function ( e ) {
889
+ var $this = $(this);
890
+ $this.css('opacity', 0);
891
+ });
892
+ }
893
+
894
+ function create_chart ( $ )
895
+ {
896
+ var $ = jQuery;
897
+
898
+ $('#contacts_chart').highcharts({
899
+ chart: {
900
+ type: 'column',
901
+ style: {
902
+ fontFamily: "Open-Sans"
903
+ }
904
+ },
905
+ credits: {
906
+ enabled: false
907
+ },
908
+ title: {
909
+ text: ''
910
+ },
911
+ xAxis: {
912
+ categories: [ <?php echo $x_axis_labels; ?> ],
913
+ tickInterval: 2,
914
+ tickmarkPlacement: 'on',
915
+ labels: {
916
+ style: {
917
+ color: '#aaa',
918
+ fontFamily: 'Open Sans'
919
+ }
920
+ }
921
+ },
922
+ yAxis: {
923
+ min: 0,
924
+ title: {
925
+ text: ''
926
+ },
927
+ gridLineColor: '#ddd',
928
+ labels: {
929
+
930
+ style: {
931
+ color: '#aaa',
932
+ fontFamily: 'Open Sans'
933
+ }
934
+ },
935
+ minRange: 4
936
+ },
937
+ tooltip: {
938
+ enabled: true,
939
+ headerFormat: '<span style="font-size: 11px; font-weight: normal; text-transform: capitalize; font-family: \'Open Sans\'; color: #555;">{point.key}</span><br/>',
940
+ pointFormat: '<span style="font-size: 11px; font-weight: normal; font-family: \'Open Sans\'; color: #888;">Contacts: {point.y}</span>',
941
+ valueDecimals: 0,
942
+ borderColor: '#ccc',
943
+ borderRadius: 0,
944
+ shadow: false
945
+ },
946
+ plotOptions: {
947
+ column: {
948
+ borderWidth: 0,
949
+ borderColor: 'rgba(0,0,0,0)',
950
+ showInLegend: false,
951
+ colorByPoint: true,
952
+ states: {
953
+ brightness: 0
954
+ }
955
+ },
956
+ line: {
957
+ enableMouseTracking: false,
958
+ linkedTo: ':previous',
959
+ dashStyle: 'ShortDash',
960
+ dataLabels: {
961
+ enabled: false
962
+ },
963
+ marker: {
964
+ enabled: false
965
+ },
966
+ color: '#4CA6CF',
967
+ tooltip: {
968
+ enabled: false
969
+ },
970
+ showInLegend: false
971
+ }
972
+ },
973
+ colors: [
974
+ <?php echo $this->stats_dashboard->column_colors; ?>
975
+ ],
976
+ series: [{
977
+ type: 'column',
978
+ name: 'Contacts',
979
+ id: 'contacts',
980
+ data: [ <?php echo $this->stats_dashboard->column_data; ?> ],
981
+ zIndex: 3,
982
+ index: 3
983
+ }, {
984
+ type: 'line',
985
+ name: 'Average',
986
+ animation: false,
987
+ data: [ <?php echo $this->stats_dashboard->average_data; ?> ],
988
+ zIndex: 2,
989
+ index: 2
990
+ },
991
+ {
992
+ type: 'column',
993
+ name: 'Weekends',
994
+ animation: false,
995
+ minPointLength: 500,
996
+ grouping: false,
997
+ tooltip: {
998
+ enabled: true
999
+ },
1000
+ data: [ <?php echo $this->stats_dashboard->weekend_column_data; ?> ],
1001
+ zIndex: 1,
1002
+ index: 1,
1003
+ id: 'weekends',
1004
+ events: {
1005
+ mouseOut: function ( event ) { event.preventDefault(); },
1006
+ halo: false
1007
+ },
1008
+ states: {
1009
+ hover: {
1010
+ enabled: false
1011
+ }
1012
+ }
1013
+ }]
1014
+ });
1015
+ }
1016
+
1017
+ var $series;
1018
+ var chart;
1019
+ var $ = jQuery;
1020
+
1021
+ $(document).ready( function ( e ) {
1022
+
1023
+ create_chart();
1024
+
1025
+ chart = $('#contacts_chart').highcharts();
1026
+ create_weekends();
1027
+ });
1028
+
1029
+ var delay = (function(){
1030
+ var timer = 0;
1031
+ return function(callback, ms){
1032
+ clearTimeout (timer);
1033
+ timer = setTimeout(callback, ms);
1034
+ };
1035
+ })();
1036
+
1037
+ // Takes care of figuring out the weekend widths based on the new column widths
1038
+ $(window).resize(function() {
1039
+ hide_weekends();
1040
+ height = chart.height
1041
+ width = $("#contacts_chart").width();
1042
+ chart.setSize(width, height);
1043
+ delay(function(){
1044
+ create_weekends();
1045
+ }, 500);
1046
+ });
1047
+
1048
+ </script>
1049
+ <?php
1050
+ }
1051
  }
1052
 
1053
  ?>
assets/css/build/leadin-admin.css CHANGED
@@ -1,3 +1,5 @@
1
- #leadin{*zoom:1;max-width:1180px;max-width:73.75rem;_width:1180px;padding-left:20px;padding-left:1.25rem;padding-right:20px;padding-right:1.25rem;margin-left:auto;margin-right:auto;margin:10px 0 0;padding:0}#leadin:after{content:"";display:table;clear:both}@media (min-width: 782px){#leadin{*zoom:1;max-width:1180px;max-width:73.75rem;padding-left:20px;padding-left:1.25rem;padding-right:20px;padding-right:1.25rem;margin-left:auto;margin-right:auto}#leadin:after{content:"";display:table;clear:both}}#leadin *{box-sizing:border-box}@media (min-width: 782px){#leadin{margin:10px 0 0;padding:0}}
2
- #leadin .top_table_controls{border-bottom:2px solid #dedede;margin:0 0 18px 0;margin-bottom:16px;*zoom:1}#leadin .top_table_controls:after{content:"";display:table;clear:both}#leadin .table_segment_picker{float:left;margin:0}#leadin .table_segment_picker li{display:inline-block;margin:0}#leadin .table_segment_picker li+li{margin-left:2em}#leadin .table_segment_picker li a{display:block;padding:12px 0;line-height:24px;font-weight:300;font-size:16px;text-decoration:none}@media (min-width: 782px){#leadin .table_segment_picker li a{font-size:20px}}#leadin .table_segment_picker li a.current{margin-bottom:-2px;font-weight:400;border-bottom:2px solid #f66000}#leadin .table_segment_picker li a.current,#leadin .table_segment_picker li a:hover,#leadin .table_segment_picker li a:active{color:#f66000}#leadin .table_search{float:right;padding:10px 0;padding-bottom:9px}#leadin table .leadin-contact-avatar{float:left}#leadin table th,#leadin table td{display:none}#leadin table th:nth-child(-n+3),#leadin table td:nth-child(-n+3){display:table-cell}@media (min-width: 782px){#leadin table th,#leadin table td{display:table-cell}}#leadin.pre-mp6 .table_search{float:right;padding:12px 0;padding-bottom:11px}#leadin.pre-mp6 table{background-color:#fff;border-color:#dedede}#leadin.pre-mp6 table tr.alternate{background-color:#fff}#leadin.pre-mp6 table th,#leadin.pre-mp6 table td{border-top:0;padding:12px 6px 11px}#leadin.pre-mp6 table th a,#leadin.pre-mp6 table td a{padding:0}#leadin.pre-mp6 table th[scope="col"]{background:#eee;font-family:sans-serif;font-size:12px;text-shadow:none}#leadin.pre-mp6 table td{border-color:#dedede;line-height:18px;font-size:14px}#leadin.pre-mp6 table td .row-actions{float:left}#leadin{padding-right:20px}@media screen and (min-width: 500px){#leadin{padding-right:10px}}#leadin label{cursor:default}#leadin .col-wrap{padding:0 14px 0 0}#leadin .metabox-holder{*zoom:1}#leadin .metabox-holder:after{content:"";display:table;clear:both}#leadin #leadin-footer{*zoom:1;clear:both;margin-top:48px;color:#999;border-top:1px solid #dedede}#leadin #leadin-footer:after{content:"";display:table;clear:both}#leadin #leadin-footer .support .sharing{height:18px;text-align:left}@media screen and (min-width: 500px){#leadin #leadin-footer .support,#leadin #leadin-footer .version,#leadin #leadin-footer .sharing{width:50%;float:left}#leadin #leadin-footer .sharing{text-align:right}}
3
- #wp-admin-bar-leadin-admin-menu img{height:16px;width:16px;opacity:0.6}.leadin-dynamic-avatar_0{background-color:#f88e4b}.leadin-dynamic-avatar_1{background-color:#64aada}.leadin-dynamic-avatar_2{background-color:#64c2b6}.leadin-dynamic-avatar_3{background-color:#cf7baa}.leadin-dynamic-avatar_4{background-color:#e7c24b}.leadin-dynamic-avatar_5{background-color:#9387da}.leadin-dynamic-avatar_6{background-color:#d6dd99}.leadin-dynamic-avatar_7{background-color:#ff4c4c}.leadin-dynamic-avatar_8{background-color:#99583d}.leadin-dynamic-avatar_9{background-color:#54cc14}.li-settings h3{border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;margin-bottom:0px;background:#fff;padding:8px 12px;font-size:15px}.li-settings .form-table{margin-top:0px;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;background-color:#fff;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04)}.li-settings .form-table th{padding-left:12px}.li-settings .leadin-section{background-color:#fff;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;font-size:14px;padding:15px 12px 5px 12px}.li-settings .leadin-section p{margin:0;padding:0}.li-settings.pre-mp6 h3{font-family:Georgia}.li-settings.pre-mp6 select,.li-settings.pre-mp6 input{font-family:sans-serif;font-size:12px}.li-settings.pre-mp6 .form-table,.li-settings.pre-mp6 .leadin-section,.li-settings.pre-mp6 h3{background-color:#f9f9f9 !important}.li-settings.pre-mp6 .form-table{-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.li-settings.pre-mp6 h3{background-color:#f9f9f9 !important;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.li-settings.pre-mp6 .leadin-section{font-size:12px;padding-left:6px}.li-settings.pre-mp6 h3{padding-left:6px;font-weight:normal;color:#464646;text-shadow:#fff 0px 1px 0px}.li-settings.pre-mp6 label{font-size:12px}.li-settings.pre-mp6 input[type="checkbox"],.li-settings.pre-mp6 input[type="radio"]{margin-right:2px}#icon-leadin{background:url("../../images/leadin-icon-32x32.png") top center no-repeat}.help-notification{background:#d9edf7;border:1px solid #bce8f1;padding:10px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.toplevel_page_leadin_contacts .wp-menu-image img{width:16px;height:16px}.leadin-contact-avatar{margin-right:10px}.power-up-settings-icon{padding-right:10px;float:left;max-height:20px;margin-top:-1px}.dashicons{margin-right:10px;float:left;margin-top:-1px}.steps{margin:48px auto 0;text-align:center;max-width:600px}.steps h3,.steps p{margin:0}.steps .step-names{margin:0;*zoom:1}.steps .step-names:after{content:"";display:table;clear:both}.steps .step-names .step-name{color:#ccc;display:list-item;float:left;width:33%;margin:0;padding-bottom:18px;font-size:16px;list-style:decimal inside none}.steps .step-names .step-name.active{color:#1f7d71;background-image:url(../../images/triangle.png);background-position:bottom center;background-repeat:no-repeat}.steps .step-names .step-name.completed{list-style-image:url(../../images/checkmark.png)}.steps .step-content{margin:0}.steps .step-content .description{margin:10px 0 20px;display:block}.steps .step{display:none;padding:18px;background-color:#d3eeeb;border:2px solid #2a9;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;color:#1f7d71}.steps .step h2{color:#1f7d71;margin-top:0;margin-bottom:18px}.steps .step ol{text-align:left;margin-bottom:18px}.steps .step label{text-align:right}.steps .step.active{display:block}.steps .step .form-table th{display:none}.steps .step .form-table td{text-align:center;width:auto;display:block}.steps .step .form-table input{width:100%;font-size:16px;line-height:1.5;padding:7px 10px;display:block}#leadin-contacts th#source{width:20%}#leadin-contacts th#visits,#leadin-contacts th#submissions{width:8%}#leadin-contacts th#status,#leadin-contacts th#last_visit,#leadin-contacts th#date,#leadin-contacts th#pageviews{width:10%}#leadin .header-wrap{*zoom:1;padding:9px 15px 4px 0}#leadin .header-wrap:after{content:"";display:table;clear:both}#leadin .header-wrap h1,#leadin .header-wrap img{float:left}#leadin .header-wrap h1{padding:0 0 0 10px;margin:0}#leadin .contact-name{line-height:40px}#leadin .contact-info h3{margin:0}#leadin .contact-info label{font-weight:bold;line-height:1;cursor:default}#leadin .contact-history{padding-left:20px;margin-left:20px;border-left:2px solid #dedede}#leadin .contact-history .session+.session{margin-top:30px}#leadin .contact-history .session-date{position:relative}#leadin .contact-history .session-date:before{content:"\2022";font-size:32px;line-height:0;height:31px;width:31px;position:absolute;left:-27px;top:9px;color:#dedede}#leadin .contact-history .session-time-range{color:#999;font-weight:400}#leadin .contact-history .events{background-color:#fff;border:1px solid #dedede;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04)}#leadin .contact-history .event{margin:0;padding:10px 20px;border-bottom:1px solid #dedede;border-left:4px solid;*zoom:1}#leadin .contact-history .event:after{content:"";display:table;clear:both}#leadin .contact-history .event:first-child{border-top:0}#leadin .contact-history .event.pageview{border-left-color:#28c;color:#28c}#leadin .contact-history .event.form-submission{border-left-color:#f66000;color:#f66000}#leadin .contact-history .event.source{border-left-color:#99aa1f;color:#99aa1f}#leadin .contact-history .event-title{margin:0;font-size:13px;font-weight:600}#leadin .contact-history .event-time{float:left;font-weight:400;width:75px}#leadin .contact-history .event-content{margin-left:75px}#leadin .contact-history .event-detail{margin-top:20px;color:#444}#leadin .contact-history .event-detail li+li{padding-top:6px;border-top:1px solid #eee}#leadin .contact-history .event-detail.pageview-url{color:#ccc}#leadin .contact-history .visit-source p{margin:0;color:#1f6696}#leadin .contact-history .field-label{text-transform:uppercase;letter-spacing:0.05em;color:#999;margin-bottom:6px;font-size:0.9em}#leadin .contact-history .field-value{margin:0}#leadin.pre-mp6 .events{background-color:#f9f9f9}.powerup-list{margin:0}.powerup-list .powerup{border:2px solid;width:20%;min-width:250px;float:left;margin:20px;padding:15px;background-color:#f9f9f9;border-color:#ccc;text-align:center;-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}.powerup-list .powerup h2,.powerup-list .powerup p,.powerup-list .powerup img{margin:0;padding:0;color:#666;margin-bottom:15px}.powerup-list .powerup.activated{background-color:#d3eeeb;border-color:#1f7d71}.powerup-list .powerup.activated h2,.powerup-list .powerup.activated p{color:#1f7d71}#li_analytics-meta .li-analytics-link{float:left}#li_analytics-meta .li-analytics-link .li-analytics__face{height:35px;width:35px;margin-right:5px;margin-bottom:5px}#li_analytics-meta .hidden_face{display:none}#li_analytics-meta .show-all-faces-container{clear:both}
 
 
1
+ #leadin label{cursor:default}#leadin .col-wrap{padding:0}#leadin .col-left .col-wrap{padding-right:10px}#leadin .metabox-holder{*zoom:1}#leadin .metabox-holder:after{content:"";display:table;clear:both}#wp-admin-bar-leadin-admin-menu img{height:16px;width:16px;opacity:0.6}@media (min-width: 1200px){#leadin{*zoom:1;max-width:1420px;max-width:88.75rem;padding-left:20px;padding-left:1.25rem;padding-right:20px;padding-right:1.25rem;margin-left:auto;margin-right:auto;margin:10px 20px 0 0;padding:0}#leadin:after{content:"";display:table;clear:both}#leadin *{box-sizing:border-box}}
2
+ #li_analytics-meta .li-analytics-link{float:left}#li_analytics-meta .li-analytics-link .li-analytics__face{height:35px;width:35px;margin-right:5px;margin-bottom:5px}#li_analytics-meta .hidden_face{display:none}#li_analytics-meta .show-all-faces-container{clear:both}.leadin-postbox{background-color:#fff;border:1px solid #e5e5e5;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04)}.leadin-postbox__header{margin:0;padding:8px 12px;font-size:14px;border-bottom:1px solid #eee}.leadin-postbox__content{margin:11px 0;padding:0 12px;*zoom:1}.leadin-postbox__content:after{content:"";display:table;clear:both}.leadin-postbox__table{margin:0;width:100%}.leadin-postbox__table th{padding:6px 0;text-align:left;text-transform:uppercase;letter-spacing:0.05em}.leadin-postbox__table td{padding:6px 0}.leadin-postbox__table tr,.leadin-postbox__table td,.leadin-postbox__table th{vertical-align:middle !important}.leadin-dynamic-avatar_0{background-color:#f88e4b}.leadin-dynamic-avatar_1{background-color:#64aada}.leadin-dynamic-avatar_2{background-color:#64c2b6}.leadin-dynamic-avatar_3{background-color:#cf7baa}.leadin-dynamic-avatar_4{background-color:#e7c24b}.leadin-dynamic-avatar_5{background-color:#9387da}.leadin-dynamic-avatar_6{background-color:#d6dd99}.leadin-dynamic-avatar_7{background-color:#ff4c4c}.leadin-dynamic-avatar_8{background-color:#99583d}.leadin-dynamic-avatar_9{background-color:#54cc14}#leadin-footer{*zoom:1;clear:both;margin-top:48px;color:#999;border-top:1px solid #dedede}#leadin-footer:after{content:"";display:table;clear:both}#leadin-footer .support .sharing{height:18px;text-align:left}@media screen and (min-width: 500px){#leadin-footer .support,#leadin-footer .version,#leadin-footer .sharing{width:50%;float:left}#leadin-footer .sharing{text-align:right}}
3
+ .li-settings h3{border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;margin-bottom:0px;background:#fff;padding:8px 12px;font-size:15px}.li-settings .form-table{margin-top:0px;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;background-color:#fff;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04)}.li-settings .form-table th{padding-left:12px}.li-settings .leadin-section{background-color:#fff;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;font-size:14px;padding:15px 12px 5px 12px}.li-settings .leadin-section p{margin:0;padding:0}.li-settings.pre-mp6 h3{font-family:Georgia}.li-settings.pre-mp6 select,.li-settings.pre-mp6 input{font-family:sans-serif;font-size:12px}.li-settings.pre-mp6 .form-table,.li-settings.pre-mp6 .leadin-section,.li-settings.pre-mp6 h3{background-color:#f9f9f9 !important}.li-settings.pre-mp6 .form-table{-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.li-settings.pre-mp6 h3{background-color:#f9f9f9 !important;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.li-settings.pre-mp6 .leadin-section{font-size:12px;padding-left:6px}.li-settings.pre-mp6 h3{padding-left:6px;font-weight:normal;color:#464646;text-shadow:#fff 0px 1px 0px}.li-settings.pre-mp6 label{font-size:12px}.li-settings.pre-mp6 input[type="checkbox"],.li-settings.pre-mp6 input[type="radio"]{margin-right:2px}#icon-leadin{background:url("../../images/leadin-icon-32x32.png") top center no-repeat}.help-notification{background:#d9edf7;border:1px solid #bce8f1;padding:10px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.toplevel_page_leadin_stats .wp-menu-image img{width:16px;height:16px}.leadin-contact-avatar{margin-right:10px;float:left}.power-up-settings-icon{padding-right:10px;float:left;max-height:20px;margin-top:-1px}.dashicons{margin-right:10px;float:left;margin-top:-1px}.steps{margin:48px auto 0;text-align:center;max-width:600px}.steps h3,.steps p{margin:0}.steps .step-names{margin:0;*zoom:1}.steps .step-names:after{content:"";display:table;clear:both}.steps .step-names .step-name{color:#ccc;display:list-item;float:left;width:33%;margin:0;padding-bottom:18px;font-size:16px;list-style:decimal inside none}.steps .step-names .step-name.active{color:#1f7d71;background-image:url(../../images/triangle.png);background-position:bottom center;background-repeat:no-repeat}.steps .step-names .step-name.completed{list-style-image:url(../../images/checkmark.png)}.steps .step-content{margin:0}.steps .step-content .description{margin:10px 0 20px;display:block}.steps .step{display:none;padding:18px;background-color:#d3eeeb;border:2px solid #2a9;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;color:#1f7d71}.steps .step h2{color:#1f7d71;margin-top:0;margin-bottom:18px}.steps .step ol{text-align:left;margin-bottom:18px}.steps .step label{text-align:right}.steps .step.active{display:block}.steps .step .form-table th{display:none}.steps .step .form-table td{text-align:center;width:auto;display:block}.steps .step .form-table input{width:100%;font-size:16px;line-height:1.5;padding:7px 10px;display:block}.leadin-contacts .button{transition:background-color 0.2s}@media (min-width: 1200px){.leadin-contacts__nav{width:15.49296%;float:left;margin-right:1.40845%}.leadin-contacts__content{width:83.09859%;float:right;margin-right:0;margin-bottom:18px}.leadin-contacts__export-form{width:83.09859%;float:left;margin-right:1.40845%;padding-left:16.90141%;margin-bottom:18px}}h2.leadin-contacts__header{border-bottom:2px solid #dedede;padding-bottom:18px;margin-bottom:18px}.leadin-contacts__search{float:right;padding:10px 0;padding-bottom:9px}.leadin-contacts__type-picker{margin:0;*zoom:1}.leadin-contacts__type-picker:after{content:"";display:table;clear:both}.leadin-contacts__type-picker li{margin:0}.leadin-contacts__type-picker li a{display:block;padding:0 0 24px 0;line-height:24px;font-weight:300;font-size:16px;text-decoration:none;float:left;margin-right:20px}@media (min-width: 1200px){.leadin-contacts__type-picker li a{font-size:20px;float:none}}.leadin-contacts__type-picker li a.current{font-weight:bold}.leadin-contacts__type-picker li a.current,.leadin-contacts__type-picker li a:hover,.leadin-contacts__type-picker li a:active{color:#f66000}.leadin-contacts__filter-text{margin:0 0 6px}.leadin-contacts__filter-count{color:#f66000}#clear-filter{font-size:0.8em;margin-left:10px}.leadin-contacts__table table th#source{width:20%}.leadin-contacts__table table th#visits,.leadin-contacts__table table th#submissions{width:8%}.leadin-contacts__table table th#status,.leadin-contacts__table table th#last_visit,.leadin-contacts__table table th#date,.leadin-contacts__table table th#pageviews{width:10%}.leadin-contacts__table table th,.leadin-contacts__table table td{display:none}.leadin-contacts__table table th:nth-child(-n+3),.leadin-contacts__table table td:nth-child(-n+3){display:table-cell}@media (min-width: 1200px){.leadin-contacts__table table th,.leadin-contacts__table table td{display:table-cell}}
4
+ .leadin-contacts.pre-mp6 .table_search{float:right;padding:12px 0;padding-bottom:11px}.leadin-contacts.pre-mp6 table{background-color:#fff;border-color:#dedede}.leadin-contacts.pre-mp6 table tr.alternate{background-color:#fff}.leadin-contacts.pre-mp6 table th,.leadin-contacts.pre-mp6 table td{border-top:0;padding:12px 6px 11px}.leadin-contacts.pre-mp6 table th a,.leadin-contacts.pre-mp6 table td a{padding:0}.leadin-contacts.pre-mp6 table th[scope="col"]{background:#eee;font-family:sans-serif;font-size:12px;text-shadow:none}.leadin-contacts.pre-mp6 table td{border-color:#dedede;line-height:18px;font-size:14px}.leadin-contacts.pre-mp6 table td .row-actions{float:left}#leadin .contact-header-wrap{*zoom:1;padding:9px 0 4px}#leadin .contact-header-wrap:after{content:"";display:table;clear:both}#leadin .contact-header-wrap .contact-header-avatar,#leadin .contact-header-wrap .contact-header-info{float:left}#leadin .contact-header-info{padding-left:15px}#leadin .contact-name{line-height:30px;padding:0;margin:0}#leadin .contact-status{margin-top:10px}#leadin .contact-info h3{margin:0}#leadin .contact-info label{font-weight:bold;line-height:1;cursor:default}#leadin .contact-history{margin-left:20px}@media (min-width: 1200px){#leadin .contact-history{padding-left:20px;border-left:2px solid #dedede}}#leadin .contact-history .session+.session{margin-top:30px}#leadin .contact-history .session-date{position:relative}@media (min-width: 1200px){#leadin .contact-history .session-date:before{content:"\2022";font-size:32px;line-height:0;height:31px;width:31px;position:absolute;left:-27px;top:9px;color:#dedede}}#leadin .contact-history .session-time-range{color:#999;font-weight:400}#leadin .contact-history .events{background-color:#fff;border:1px solid #dedede;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04)}#leadin .contact-history .event{margin:0;padding:10px 20px;border-bottom:1px solid #dedede;border-left:4px solid;*zoom:1}#leadin .contact-history .event:after{content:"";display:table;clear:both}#leadin .contact-history .event:first-child{border-top:0}#leadin .contact-history .event.pageview{border-left-color:#28c;color:#28c}#leadin .contact-history .event.form-submission{border-left-color:#f66000;color:#f66000}#leadin .contact-history .event.source{border-left-color:#99aa1f;color:#99aa1f}#leadin .contact-history .event-title{margin:0;font-size:13px;font-weight:600}#leadin .contact-history .event-time{float:left;font-weight:400;width:75px}#leadin .contact-history .event-content{margin-left:75px}#leadin .contact-history .event-detail{margin-top:20px;color:#444}#leadin .contact-history .event-detail li+li{padding-top:6px;border-top:1px solid #eee}#leadin .contact-history .event-detail.pageview-url{color:#ccc}#leadin .contact-history .visit-source p{margin:0;color:#1f6696}#leadin .contact-history .field-label{text-transform:uppercase;letter-spacing:0.05em;color:#999;margin-bottom:6px;font-size:0.9em}#leadin .contact-history .field-value{margin:0}#leadin.pre-mp6 .events{background-color:#f9f9f9}.powerup-list{margin:0}.powerup-list .powerup{border:2px solid;width:20%;min-width:250px;float:left;margin:20px;padding:15px;background-color:#f9f9f9;border-color:#ccc;text-align:center;-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}.powerup-list .powerup h2,.powerup-list .powerup p,.powerup-list .powerup img{margin:0;padding:0;color:#666;margin-bottom:15px}.powerup-list .powerup.activated{background-color:#d3eeeb;border-color:#1f7d71}.powerup-list .powerup.activated h2,.powerup-list .powerup.activated p{color:#1f7d71}@media (min-width: 1200px){.leadin-stats__top-container,.leadin-stats__chart-container,.leadin-stats__big-numbers-container{width:100%;float:right;margin-right:0}.leadin-stats__postbox_containter{width:49.29577%;float:left;margin-right:1.40845%}.leadin-stats__postbox_containter:nth-child(2n+2){width:49.29577%;float:right;margin-right:0}}h2.leadin-stats__header{margin-bottom:12px}.leadin-stats__postbox_containter .leadin-postbox{margin-bottom:12px}.leadin-stats__big-number{text-align:center;width:42%;float:left;padding:4%}@media (min-width: 1200px){.leadin-stats__big-number{width:25%;padding:10px}}
5
+ .big-number--average .leadin-stats__big-number-top-label,.big-number--average .leadin-stats__big-number-content,.big-number--average .leadin-stats__big-number-bottom-label{color:#4ca6cf}.leadin-stats__top-container,.leadin-stats__big-number-top-label,.leadin-stats__big-number-content,.leadin-stats__big-number-bottom-label{color:#666;margin-bottom:12px}.leadin-stats__big-number-top-label{text-transform:uppercase;letter-spacing:0.05em}
assets/css/build/leadin-subscribe.css CHANGED
@@ -1 +1 @@
1
- @keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-webkit-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-moz-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-ms-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-o-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-webkit-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-moz-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-ms-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-o-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-webkit-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-moz-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-ms-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-o-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}.vex.vex-theme-default{padding-top:160px;padding-bottom:160px}.vex.vex-theme-default.vex-closing .vex-content{animation:vex-flyout 0.5s;-webkit-animation:vex-flyout 0.5s;-moz-animation:vex-flyout 0.5s;-ms-animation:vex-flyout 0.5s;-o-animation:vex-flyout 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-default .vex-content{animation:vex-flyin 0.5s;-webkit-animation:vex-flyin 0.5s;-moz-animation:vex-flyin 0.5s;-ms-animation:vex-flyin 0.5s;-o-animation:vex-flyin 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-default .vex-content{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;font-family:"Helvetica Neue",sans-serif;background:#f0f0f0;color:#444;padding:1em;position:relative;margin:0 auto;max-width:100%;width:450px;font-size:1.1em;line-height:1.5em}.vex.vex-theme-default .vex-content h1,.vex.vex-theme-default .vex-content h2,.vex.vex-theme-default .vex-content h3,.vex.vex-theme-default .vex-content h4,.vex.vex-theme-default .vex-content h5,.vex.vex-theme-default .vex-content h6,.vex.vex-theme-default .vex-content p,.vex.vex-theme-default .vex-content ul,.vex.vex-theme-default .vex-content li{color:inherit}.vex.vex-theme-default .vex-close{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;position:absolute;top:0;right:0;cursor:pointer}.vex.vex-theme-default .vex-close:before{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;position:absolute;content:"\00D7";font-size:26px;font-weight:normal;line-height:31px;height:30px;width:30px;text-align:center;top:3px;right:3px;color:#bbb;background:transparent}.vex.vex-theme-default .vex-close:hover:before,.vex.vex-theme-default .vex-close:active:before{color:#777;background:#e0e0e0}.vex.vex-theme-default .vex-dialog-form .vex-dialog-message{margin-bottom:0.5em}.vex.vex-theme-default .vex-dialog-form .vex-dialog-input{margin-bottom:1em}.vex.vex-theme-default .vex-dialog-form .vex-dialog-input textarea,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="date"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="datetime"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="datetime-local"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="email"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="month"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="number"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="password"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="search"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="tel"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="text"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="time"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="url"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="week"]{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#fff;width:100%;padding:0.25em 0.67em;border:0;font-family:inherit;font-weight:inherit;font-size:inherit;min-height:2.5em;margin:0 0 0.25em}.vex.vex-theme-default .vex-dialog-form .vex-dialog-input textarea:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="date"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="datetime"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="datetime-local"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="email"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="month"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="number"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="password"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="search"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="tel"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="text"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="time"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="url"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="week"]:focus{-moz-box-shadow:inset 0 0 0 2px #8dbdf1;-webkit-box-shadow:inset 0 0 0 2px #8dbdf1;box-shadow:inset 0 0 0 2px #8dbdf1;outline:none}.vex.vex-theme-default .vex-dialog-form .vex-dialog-buttons{*zoom:1}.vex.vex-theme-default .vex-dialog-form .vex-dialog-buttons:after{content:"";display:table;clear:both}.vex.vex-theme-default .vex-dialog-button{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:0;float:right;margin:0 0 0 0.5em;font-family:inherit;text-transform:uppercase;letter-spacing:0.1em;font-size:0.8em;line-height:1em;padding:0.75em 2em}.vex.vex-theme-default .vex-dialog-button.vex-last{margin-left:0}.vex.vex-theme-default .vex-dialog-button:focus{animation:vex-pulse 1.1s infinite;-webkit-animation:vex-pulse 1.1s infinite;-moz-animation:vex-pulse 1.1s infinite;-ms-animation:vex-pulse 1.1s infinite;-o-animation:vex-pulse 1.1s infinite;-webkit-backface-visibility:hidden;outline:none}@media (max-width: 568px){.vex.vex-theme-default .vex-dialog-button:focus{animation:none;-webkit-animation:none;-moz-animation:none;-ms-animation:none;-o-animation:none;-webkit-backface-visibility:hidden}}.vex.vex-theme-default .vex-dialog-button.vex-dialog-button-primary{background:#3288e6;color:#fff}.vex.vex-theme-default .vex-dialog-button.vex-dialog-button-secondary{background:#e0e0e0;color:#777}.vex-loading-spinner.vex-theme-default{-moz-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-webkit-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%;background:#f0f0f0;border:0.2em solid transparent;border-top-color:#bbb;top:-1.1em;bottom:auto}@keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-webkit-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-moz-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-ms-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-o-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-webkit-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-moz-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-ms-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-o-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-webkit-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-moz-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-ms-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-o-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}.vex.vex-theme-bottom-right-corner,.vex.vex-theme-bottom-left-corner{top:auto;bottom:0;right:0;overflow:visible}.vex.vex-theme-bottom-right-corner .vex-overlay,.vex.vex-theme-bottom-left-corner .vex-overlay{display:none}.vex.vex-theme-bottom-right-corner.vex-closing .vex-content,.vex.vex-theme-bottom-left-corner.vex-closing .vex-content{animation:vex-slidedown 0.5s;-webkit-animation:vex-slidedown 0.5s;-moz-animation:vex-slidedown 0.5s;-ms-animation:vex-slidedown 0.5s;-o-animation:vex-slidedown 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-bottom-right-corner .vex-content,.vex.vex-theme-bottom-left-corner .vex-content{animation:vex-slideup 0.5s;-webkit-animation:vex-slideup 0.5s;-moz-animation:vex-slideup 0.5s;-ms-animation:vex-slideup 0.5s;-o-animation:vex-slideup 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-bottom-right-corner .vex-content,.vex.vex-theme-bottom-left-corner .vex-content{font-family:"Helvetica Neue",sans-serif;background:#f0f0f0;color:#444;padding:1em;max-width:100%;width:450px;font-size:1.1em;line-height:1.5em;position:fixed;bottom:0}.vex.vex-theme-bottom-right-corner .vex-content h1,.vex.vex-theme-bottom-right-corner .vex-content h2,.vex.vex-theme-bottom-right-corner .vex-content h3,.vex.vex-theme-bottom-right-corner .vex-content h4,.vex.vex-theme-bottom-right-corner .vex-content h5,.vex.vex-theme-bottom-right-corner .vex-content h6,.vex.vex-theme-bottom-right-corner .vex-content p,.vex.vex-theme-bottom-right-corner .vex-content ul,.vex.vex-theme-bottom-right-corner .vex-content li,.vex.vex-theme-bottom-left-corner .vex-content h1,.vex.vex-theme-bottom-left-corner .vex-content h2,.vex.vex-theme-bottom-left-corner .vex-content h3,.vex.vex-theme-bottom-left-corner .vex-content h4,.vex.vex-theme-bottom-left-corner .vex-content h5,.vex.vex-theme-bottom-left-corner .vex-content h6,.vex.vex-theme-bottom-left-corner .vex-content p,.vex.vex-theme-bottom-left-corner .vex-content ul,.vex.vex-theme-bottom-left-corner .vex-content li{color:inherit}.vex.vex-theme-bottom-right-corner .vex-close,.vex.vex-theme-bottom-left-corner .vex-close{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;position:absolute;top:0;right:0;cursor:pointer}.vex.vex-theme-bottom-right-corner .vex-close:before,.vex.vex-theme-bottom-left-corner .vex-close:before{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;position:absolute;content:"\00D7";font-size:26px;font-weight:normal;line-height:31px;height:30px;width:30px;text-align:center;top:3px;right:3px;color:#bbb;background:transparent}.vex.vex-theme-bottom-right-corner .vex-close:hover:before,.vex.vex-theme-bottom-right-corner .vex-close:active:before,.vex.vex-theme-bottom-left-corner .vex-close:hover:before,.vex.vex-theme-bottom-left-corner .vex-close:active:before{color:#777;background:#e0e0e0}.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-message,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-message{margin-bottom:0.5em}.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input{margin-bottom:1em}.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input textarea,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="date"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="datetime"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="datetime-local"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="email"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="month"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="number"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="password"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="search"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="tel"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="text"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="time"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="url"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="week"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input textarea,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="date"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="datetime"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="datetime-local"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="email"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="month"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="number"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="password"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="search"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="tel"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="text"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="time"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="url"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="week"]{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#fff;width:100%;padding:0.25em 0.67em;border:0;font-family:inherit;font-weight:inherit;font-size:inherit;min-height:2.5em;margin:0 0 0.25em}.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input textarea:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="date"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="datetime"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="datetime-local"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="email"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="month"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="number"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="password"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="search"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="tel"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="text"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="time"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="url"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="week"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input textarea:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="date"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="datetime"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="datetime-local"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="email"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="month"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="number"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="password"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="search"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="tel"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="text"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="time"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="url"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="week"]:focus{-moz-box-shadow:inset 0 0 0 2px #8dbdf1;-webkit-box-shadow:inset 0 0 0 2px #8dbdf1;box-shadow:inset 0 0 0 2px #8dbdf1;outline:none}.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-buttons,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-buttons{*zoom:1}.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-buttons:after,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-buttons:after{content:"";display:table;clear:both}.vex.vex-theme-bottom-right-corner .vex-content{-moz-border-radius:5px 0 0 0;-webkit-border-radius:5px;border-radius:5px 0 0 0;right:0;left:auto}.vex.vex-theme-bottom-left-corner .vex-content{-moz-border-radius:0 5px 0 0;-webkit-border-radius:0;border-radius:0 5px 0 0;left:0;right:auto}.vex-loading-spinner.vex-theme-bottom-right-corner{-moz-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-webkit-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%;background:#f0f0f0;border:0.2em solid transparent;border-top-color:#bbb;top:-1.1em;bottom:auto}@keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-webkit-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-moz-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-ms-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-o-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-webkit-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-moz-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-ms-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-o-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-webkit-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-moz-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-ms-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-o-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}.vex.vex-theme-top{bottom:inherit}.vex.vex-theme-top .vex-overlay{display:none}.vex.vex-theme-top.vex-closing .vex-content{animation:vex-dropout 0.5s;-webkit-animation:vex-dropout 0.5s;-moz-animation:vex-dropout 0.5s;-ms-animation:vex-dropout 0.5s;-o-animation:vex-dropout 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-top .vex-content{animation:vex-dropin 0.5s;-webkit-animation:vex-dropin 0.5s;-moz-animation:vex-dropin 0.5s;-ms-animation:vex-dropin 0.5s;-o-animation:vex-dropin 0.5s;-webkit-backface-visibility:hidden;*zoom:1;font-family:"Helvetica Neue",sans-serif;background:#f0f0f0;color:#444;padding:0.5em 0.5em 0.25em;position:relative;margin:0 auto;max-width:100%;font-size:1.1em;line-height:1.5em}.vex.vex-theme-top .vex-content:after{content:"";display:table;clear:both}.vex.vex-theme-top .vex-content h1,.vex.vex-theme-top .vex-content h2,.vex.vex-theme-top .vex-content h3,.vex.vex-theme-top .vex-content h4,.vex.vex-theme-top .vex-content h5,.vex.vex-theme-top .vex-content h6,.vex.vex-theme-top .vex-content p,.vex.vex-theme-top .vex-content ul,.vex.vex-theme-top .vex-content li{color:inherit}.vex.vex-theme-top .vex-close{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;position:absolute;top:0;right:0;cursor:pointer}.vex.vex-theme-top .vex-close:before{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;position:absolute;content:"\00D7";font-size:26px;font-weight:normal;line-height:31px;height:30px;width:30px;text-align:center;top:3px;right:3px;color:#bbb;background:transparent}.vex.vex-theme-top .vex-close:hover:before,.vex.vex-theme-top .vex-close:active:before{color:#777;background:#e0e0e0}.vex.vex-theme-top .vex-dialog-form{text-align:center;margin:0 90px}@media only screen and (max-width: 760px){.vex.vex-theme-top .vex-dialog-form{margin:0 auto}}.vex.vex-theme-top .vex-dialog-form .vex-dialog-message,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input,.vex.vex-theme-top .vex-dialog-form .vex-dialog-buttons{display:inline-block}.vex.vex-theme-top .vex-dialog-form .vex-dialog-input{min-width:200px;margin:0 1em}.vex.vex-theme-top .vex-dialog-form .vex-dialog-input textarea,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="date"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="datetime"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="datetime-local"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="email"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="month"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="number"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="password"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="search"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="tel"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="text"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="time"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="url"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="week"]{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#fff;width:100%;padding:0.25em 0.67em;border:0;font-family:inherit;font-weight:inherit;font-size:inherit;min-height:2.5em;margin:0 0 0 0}.vex.vex-theme-top .vex-dialog-form .vex-dialog-input textarea:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="date"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="datetime"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="datetime-local"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="email"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="month"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="number"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="password"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="search"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="tel"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="text"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="time"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="url"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="week"]:focus{-moz-box-shadow:inset 0 0 0 2px #8dbdf1;-webkit-box-shadow:inset 0 0 0 2px #8dbdf1;box-shadow:inset 0 0 0 2px #8dbdf1;outline:none}.vex.vex-theme-top .vex-dialog-form .vex-dialog-buttons{*zoom:1}.vex.vex-theme-top .vex-dialog-form .vex-dialog-buttons:after{content:"";display:table;clear:both}.vex.vex-theme-top .vex-dialog-form .vex-dialog-buttons input{float:none}.vex.vex-theme-top .leadin-subscribe-powered-by{position:absolute;bottom:0.5em;right:0.5em}.vex.vex-theme-top .vex-dialog-button{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:0;float:right;margin:0 0 0 0.5em;font-family:inherit;text-transform:uppercase;letter-spacing:0.1em;font-size:0.8em;line-height:1em;padding:0.75em 2em}.vex.vex-theme-top .vex-dialog-button.vex-last{margin-left:0}.vex.vex-theme-top .vex-dialog-button:focus{animation:vex-pulse 1.1s infinite;-webkit-animation:vex-pulse 1.1s infinite;-moz-animation:vex-pulse 1.1s infinite;-ms-animation:vex-pulse 1.1s infinite;-o-animation:vex-pulse 1.1s infinite;-webkit-backface-visibility:hidden;outline:none}@media (max-width: 568px){.vex.vex-theme-top .vex-dialog-button:focus{animation:none;-webkit-animation:none;-moz-animation:none;-ms-animation:none;-o-animation:none;-webkit-backface-visibility:hidden}}.vex.vex-theme-top .vex-dialog-button.vex-dialog-button-primary{background:#3288e6;color:#fff}.vex.vex-theme-top .vex-dialog-button.vex-dialog-button-secondary{background:#e0e0e0;color:#777}.vex-loading-spinner.vex-theme-top{-moz-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-webkit-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%;background:#f0f0f0;border:0.2em solid transparent;border-top-color:#bbb;top:-1.1em;bottom:auto}@keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-moz-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-ms-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-o-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-moz-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-ms-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-o-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-webkit-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-moz-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-ms-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-o-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}.vex,.vex *,.vex *:before,.vex *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.vex{position:fixed;overflow:visible;-webkit-overflow-scrolling:touch;z-index:1111;top:0;right:0;bottom:0;left:0}.vex-overlay{background:#000;filter:alpha(opacity=40);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"}.vex-overlay{animation:vex-fadein 0.5s;-webkit-animation:vex-fadein 0.5s;-moz-animation:vex-fadein 0.5s;-ms-animation:vex-fadein 0.5s;-o-animation:vex-fadein 0.5s;-webkit-backface-visibility:hidden;position:fixed;background:rgba(0,0,0,0.4);top:0;right:0;bottom:0;left:0}.vex.vex-closing .vex-overlay{animation:vex-fadeout 0.5s;-webkit-animation:vex-fadeout 0.5s;-moz-animation:vex-fadeout 0.5s;-ms-animation:vex-fadeout 0.5s;-o-animation:vex-fadeout 0.5s;-webkit-backface-visibility:hidden}.vex-content{*zoom:1;animation:vex-fadein 0.5s;-webkit-animation:vex-fadein 0.5s;-moz-animation:vex-fadein 0.5s;-ms-animation:vex-fadein 0.5s;-o-animation:vex-fadein 0.5s;-webkit-backface-visibility:hidden;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.15);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.15);box-shadow:0px 1px 2px rgba(0,0,0,0.15);background:#fff}.vex-content:after{content:"";display:table;clear:both}.vex.vex-closing .vex-content{animation:vex-fadeout 0.5s;-webkit-animation:vex-fadeout 0.5s;-moz-animation:vex-fadeout 0.5s;-ms-animation:vex-fadeout 0.5s;-o-animation:vex-fadeout 0.5s;-webkit-backface-visibility:hidden}.vex-content .powered-by{display:block;font-size:11px;color:#888;padding:10px 0 0 0}.vex-content .vex-dialog-message,.vex-content .vex-dialog-input,.vex-content .vex-dialog-buttons{*zoom:1;font-size:16px}.vex-content .vex-dialog-message:after,.vex-content .vex-dialog-input:after,.vex-content .vex-dialog-buttons:after{content:"";display:table;clear:both}.vex-content .leadin-subscribe-powered-by{float:right;font-size:12px;font-weight:bold;color:#3288e6}.vex-close:before{font-family:Arial,sans-serif;content:"\00D7"}.vex-dialog-form{margin:0}.vex-dialog-form .vex-dialog-message{font-weight:bold}.vex-dialog-button{-webkit-appearance:none;cursor:pointer;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;float:right;margin:0 0 0 0.5em;font-family:inherit;text-transform:uppercase;letter-spacing:0.1em;font-size:0.8em;line-height:1em;padding:0.75em 2em}.vex-dialog-button.vex-last{margin-left:0}.vex-dialog-button:focus,.vex-dialog-button:hover{outline:none}.vex-dialog-button.vex-dialog-button-primary{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;border:0;background:#3288e6;color:#fff}.vex-dialog-button.vex-dialog-button-primary:hover{background:#5fa2ec}.vex-dialog-button.vex-dialog-button-secondary{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;border:0;background:#e0e0e0;color:#777}.vex-loading-spinner{animation:vex-rotation 0.7s linear infinite;-webkit-animation:vex-rotation 0.7s linear infinite;-moz-animation:vex-rotation 0.7s linear infinite;-ms-animation:vex-rotation 0.7s linear infinite;-o-animation:vex-rotation 0.7s linear infinite;-webkit-backface-visibility:hidden;-moz-box-shadow:0 0 1em rgba(0,0,0,0.1);-webkit-box-shadow:0 0 1em rgba(0,0,0,0.1);box-shadow:0 0 1em rgba(0,0,0,0.1);position:fixed;z-index:1112;margin:auto;top:0;right:0;bottom:0;left:0;height:2em;width:2em;background:#fff}@media only screen and (max-width: 760px){#leadin-subscribe-mobile-check,.leadin-subscribe-powered-by{display:none}}
1
+ @keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-webkit-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-moz-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-ms-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-o-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-webkit-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-moz-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-ms-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-o-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-webkit-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-moz-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-ms-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-o-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}.vex.vex-theme-default{padding-top:160px;padding-bottom:160px}.vex.vex-theme-default.vex-closing .vex-content{animation:vex-flyout 0.5s;-webkit-animation:vex-flyout 0.5s;-moz-animation:vex-flyout 0.5s;-ms-animation:vex-flyout 0.5s;-o-animation:vex-flyout 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-default .vex-content{animation:vex-flyin 0.5s;-webkit-animation:vex-flyin 0.5s;-moz-animation:vex-flyin 0.5s;-ms-animation:vex-flyin 0.5s;-o-animation:vex-flyin 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-default .vex-content{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;font-family:"Helvetica Neue",sans-serif;background:#f0f0f0;color:#444;padding:1em;position:relative;margin:0 auto;max-width:100%;width:450px;font-size:1.1em;line-height:1.5em}.vex.vex-theme-default .vex-content h1,.vex.vex-theme-default .vex-content h2,.vex.vex-theme-default .vex-content h3,.vex.vex-theme-default .vex-content h4,.vex.vex-theme-default .vex-content h5,.vex.vex-theme-default .vex-content h6,.vex.vex-theme-default .vex-content p,.vex.vex-theme-default .vex-content ul,.vex.vex-theme-default .vex-content li{color:inherit}.vex.vex-theme-default .vex-close{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;position:absolute;top:0;right:0;cursor:pointer}.vex.vex-theme-default .vex-close:before{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;position:absolute;content:"\00D7";font-size:26px;font-weight:normal;line-height:31px;height:30px;width:30px;text-align:center;top:3px;right:3px;color:#bbb;background:transparent}.vex.vex-theme-default .vex-close:hover:before,.vex.vex-theme-default .vex-close:active:before{color:#777;background:#e0e0e0}.vex.vex-theme-default .vex-dialog-form .vex-dialog-message{margin-bottom:0.5em}.vex.vex-theme-default .vex-dialog-form .vex-dialog-input{margin-bottom:1em}.vex.vex-theme-default .vex-dialog-form .vex-dialog-input textarea,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="date"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="datetime"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="datetime-local"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="email"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="month"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="number"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="password"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="search"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="tel"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="text"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="time"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="url"],.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="week"]{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#fff;width:100%;padding:0.25em 0.67em;border:0;font-family:inherit;font-weight:inherit;font-size:inherit;min-height:2.5em;margin:0 0 0.25em}.vex.vex-theme-default .vex-dialog-form .vex-dialog-input textarea:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="date"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="datetime"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="datetime-local"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="email"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="month"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="number"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="password"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="search"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="tel"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="text"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="time"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="url"]:focus,.vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="week"]:focus{-moz-box-shadow:inset 0 0 0 2px #8dbdf1;-webkit-box-shadow:inset 0 0 0 2px #8dbdf1;box-shadow:inset 0 0 0 2px #8dbdf1;outline:none}.vex.vex-theme-default .vex-dialog-form .vex-dialog-buttons{*zoom:1}.vex.vex-theme-default .vex-dialog-form .vex-dialog-buttons:after{content:"";display:table;clear:both}.vex.vex-theme-default .vex-dialog-button{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:0;float:right;margin:0 0 0 0.5em;font-family:inherit;text-transform:uppercase;letter-spacing:0.1em;font-size:0.8em;line-height:1em;padding:0.75em 2em}.vex.vex-theme-default .vex-dialog-button.vex-last{margin-left:0}.vex.vex-theme-default .vex-dialog-button:focus{animation:vex-pulse 1.1s infinite;-webkit-animation:vex-pulse 1.1s infinite;-moz-animation:vex-pulse 1.1s infinite;-ms-animation:vex-pulse 1.1s infinite;-o-animation:vex-pulse 1.1s infinite;-webkit-backface-visibility:hidden;outline:none}@media (max-width: 568px){.vex.vex-theme-default .vex-dialog-button:focus{animation:none;-webkit-animation:none;-moz-animation:none;-ms-animation:none;-o-animation:none;-webkit-backface-visibility:hidden}}.vex.vex-theme-default .vex-dialog-button.vex-dialog-button-primary{background:#3288e6;color:#fff}.vex.vex-theme-default .vex-dialog-button.vex-dialog-button-secondary{background:#e0e0e0;color:#777}.vex-loading-spinner.vex-theme-default{-moz-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-webkit-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%;background:#f0f0f0;border:0.2em solid transparent;border-top-color:#bbb;top:-1.1em;bottom:auto}@keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-webkit-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-moz-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-ms-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-o-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-webkit-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-moz-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-ms-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-o-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-webkit-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-moz-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-ms-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-o-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}.vex.vex-theme-bottom-right-corner,.vex.vex-theme-bottom-left-corner{top:auto;bottom:0;right:0;overflow:visible}.vex.vex-theme-bottom-right-corner .vex-overlay,.vex.vex-theme-bottom-left-corner .vex-overlay{display:none}.vex.vex-theme-bottom-right-corner.vex-closing .vex-content,.vex.vex-theme-bottom-left-corner.vex-closing .vex-content{animation:vex-slidedown 0.5s;-webkit-animation:vex-slidedown 0.5s;-moz-animation:vex-slidedown 0.5s;-ms-animation:vex-slidedown 0.5s;-o-animation:vex-slidedown 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-bottom-right-corner .vex-content,.vex.vex-theme-bottom-left-corner .vex-content{animation:vex-slideup 0.5s;-webkit-animation:vex-slideup 0.5s;-moz-animation:vex-slideup 0.5s;-ms-animation:vex-slideup 0.5s;-o-animation:vex-slideup 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-bottom-right-corner .vex-content,.vex.vex-theme-bottom-left-corner .vex-content{font-family:"Helvetica Neue",sans-serif;background:#f0f0f0;color:#444;padding:1em;max-width:100%;width:450px;font-size:1.1em;line-height:1.5em;position:fixed;bottom:0}.vex.vex-theme-bottom-right-corner .vex-content h1,.vex.vex-theme-bottom-right-corner .vex-content h2,.vex.vex-theme-bottom-right-corner .vex-content h3,.vex.vex-theme-bottom-right-corner .vex-content h4,.vex.vex-theme-bottom-right-corner .vex-content h5,.vex.vex-theme-bottom-right-corner .vex-content h6,.vex.vex-theme-bottom-right-corner .vex-content p,.vex.vex-theme-bottom-right-corner .vex-content ul,.vex.vex-theme-bottom-right-corner .vex-content li,.vex.vex-theme-bottom-left-corner .vex-content h1,.vex.vex-theme-bottom-left-corner .vex-content h2,.vex.vex-theme-bottom-left-corner .vex-content h3,.vex.vex-theme-bottom-left-corner .vex-content h4,.vex.vex-theme-bottom-left-corner .vex-content h5,.vex.vex-theme-bottom-left-corner .vex-content h6,.vex.vex-theme-bottom-left-corner .vex-content p,.vex.vex-theme-bottom-left-corner .vex-content ul,.vex.vex-theme-bottom-left-corner .vex-content li{color:inherit}.vex.vex-theme-bottom-right-corner .vex-close,.vex.vex-theme-bottom-left-corner .vex-close{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;position:absolute;top:0;right:0;cursor:pointer}.vex.vex-theme-bottom-right-corner .vex-close:before,.vex.vex-theme-bottom-left-corner .vex-close:before{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;position:absolute;content:"\00D7";font-size:26px;font-weight:normal;line-height:31px;height:30px;width:30px;text-align:center;top:3px;right:3px;color:#bbb;background:transparent}.vex.vex-theme-bottom-right-corner .vex-close:hover:before,.vex.vex-theme-bottom-right-corner .vex-close:active:before,.vex.vex-theme-bottom-left-corner .vex-close:hover:before,.vex.vex-theme-bottom-left-corner .vex-close:active:before{color:#777;background:#e0e0e0}.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-message,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-message{margin-bottom:0.5em}.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input{margin-bottom:1em}.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input textarea,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="date"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="datetime"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="datetime-local"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="email"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="month"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="number"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="password"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="search"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="tel"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="text"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="time"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="url"],.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="week"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input textarea,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="date"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="datetime"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="datetime-local"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="email"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="month"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="number"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="password"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="search"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="tel"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="text"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="time"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="url"],.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="week"]{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#fff;width:100%;padding:0.25em 0.67em;border:0;font-family:inherit;font-weight:inherit;font-size:inherit;min-height:2.5em;margin:0 0 0.25em}.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input textarea:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="date"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="datetime"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="datetime-local"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="email"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="month"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="number"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="password"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="search"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="tel"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="text"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="time"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="url"]:focus,.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-input input[type="week"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input textarea:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="date"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="datetime"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="datetime-local"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="email"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="month"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="number"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="password"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="search"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="tel"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="text"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="time"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="url"]:focus,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-input input[type="week"]:focus{-moz-box-shadow:inset 0 0 0 2px #8dbdf1;-webkit-box-shadow:inset 0 0 0 2px #8dbdf1;box-shadow:inset 0 0 0 2px #8dbdf1;outline:none}.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-buttons,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-buttons{*zoom:1}.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-buttons:after,.vex.vex-theme-bottom-left-corner .vex-dialog-form .vex-dialog-buttons:after{content:"";display:table;clear:both}.vex.vex-theme-bottom-right-corner .vex-content{-moz-border-radius:5px 0 0 0;-webkit-border-radius:5px;border-radius:5px 0 0 0;right:0;left:auto}.vex.vex-theme-bottom-left-corner .vex-content{-moz-border-radius:0 5px 0 0;-webkit-border-radius:0;border-radius:0 5px 0 0;left:0;right:auto}.vex-loading-spinner.vex-theme-bottom-right-corner{-moz-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-webkit-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%;background:#f0f0f0;border:0.2em solid transparent;border-top-color:#bbb;top:-1.1em;bottom:auto}@keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-webkit-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-moz-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-ms-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-o-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-webkit-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-moz-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-ms-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-o-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-webkit-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-moz-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-ms-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-o-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}.vex.vex-theme-top{bottom:inherit}.vex.vex-theme-top .vex-overlay{display:none}.vex.vex-theme-top.vex-closing .vex-content{animation:vex-dropout 0.5s;-webkit-animation:vex-dropout 0.5s;-moz-animation:vex-dropout 0.5s;-ms-animation:vex-dropout 0.5s;-o-animation:vex-dropout 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-top .vex-content{animation:vex-dropin 0.5s;-webkit-animation:vex-dropin 0.5s;-moz-animation:vex-dropin 0.5s;-ms-animation:vex-dropin 0.5s;-o-animation:vex-dropin 0.5s;-webkit-backface-visibility:hidden;*zoom:1;font-family:"Helvetica Neue",sans-serif;background:#f0f0f0;color:#444;padding:0.5em 0.5em 0.25em;position:relative;margin:0 auto;max-width:100%;font-size:1.1em;line-height:1.5em}.vex.vex-theme-top .vex-content:after{content:"";display:table;clear:both}.vex.vex-theme-top .vex-content h1,.vex.vex-theme-top .vex-content h2,.vex.vex-theme-top .vex-content h3,.vex.vex-theme-top .vex-content h4,.vex.vex-theme-top .vex-content h5,.vex.vex-theme-top .vex-content h6,.vex.vex-theme-top .vex-content p,.vex.vex-theme-top .vex-content ul,.vex.vex-theme-top .vex-content li{color:inherit}.vex.vex-theme-top .vex-close{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;position:absolute;top:0;right:0;cursor:pointer}.vex.vex-theme-top .vex-close:before{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;position:absolute;content:"\00D7";font-size:26px;font-weight:normal;line-height:31px;height:30px;width:30px;text-align:center;top:3px;right:3px;color:#bbb;background:transparent}.vex.vex-theme-top .vex-close:hover:before,.vex.vex-theme-top .vex-close:active:before{color:#777;background:#e0e0e0}.vex.vex-theme-top .vex-dialog-form{text-align:center;margin:0 90px}@media only screen and (max-width: 760px){.vex.vex-theme-top .vex-dialog-form{margin:0 auto}}.vex.vex-theme-top .vex-dialog-form .vex-dialog-message,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input,.vex.vex-theme-top .vex-dialog-form .vex-dialog-buttons{display:inline-block}.vex.vex-theme-top .vex-dialog-form .vex-dialog-input{min-width:200px;margin:0 1em}.vex.vex-theme-top .vex-dialog-form .vex-dialog-input textarea,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="date"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="datetime"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="datetime-local"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="email"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="month"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="number"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="password"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="search"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="tel"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="text"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="time"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="url"],.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="week"]{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#fff;width:100%;padding:0.25em 0.67em;border:0;font-family:inherit;font-weight:inherit;font-size:inherit;min-height:2.5em;margin:0 0 0 0}.vex.vex-theme-top .vex-dialog-form .vex-dialog-input textarea:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="date"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="datetime"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="datetime-local"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="email"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="month"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="number"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="password"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="search"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="tel"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="text"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="time"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="url"]:focus,.vex.vex-theme-top .vex-dialog-form .vex-dialog-input input[type="week"]:focus{-moz-box-shadow:inset 0 0 0 2px #8dbdf1;-webkit-box-shadow:inset 0 0 0 2px #8dbdf1;box-shadow:inset 0 0 0 2px #8dbdf1;outline:none}.vex.vex-theme-top .vex-dialog-form .vex-dialog-buttons{*zoom:1}.vex.vex-theme-top .vex-dialog-form .vex-dialog-buttons:after{content:"";display:table;clear:both}.vex.vex-theme-top .vex-dialog-form .vex-dialog-buttons input{float:none}.vex.vex-theme-top .leadin-subscribe-powered-by{position:absolute;bottom:0.5em;right:0.5em}.vex.vex-theme-top .vex-dialog-button{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:0;float:right;margin:0 0 0 0.5em;font-family:inherit;text-transform:uppercase;letter-spacing:0.1em;font-size:0.8em;line-height:1em;padding:0.75em 2em}.vex.vex-theme-top .vex-dialog-button.vex-last{margin-left:0}.vex.vex-theme-top .vex-dialog-button:focus{animation:vex-pulse 1.1s infinite;-webkit-animation:vex-pulse 1.1s infinite;-moz-animation:vex-pulse 1.1s infinite;-ms-animation:vex-pulse 1.1s infinite;-o-animation:vex-pulse 1.1s infinite;-webkit-backface-visibility:hidden;outline:none}@media (max-width: 568px){.vex.vex-theme-top .vex-dialog-button:focus{animation:none;-webkit-animation:none;-moz-animation:none;-ms-animation:none;-o-animation:none;-webkit-backface-visibility:hidden}}.vex.vex-theme-top .vex-dialog-button.vex-dialog-button-primary{background:#3288e6;color:#fff}.vex.vex-theme-top .vex-dialog-button.vex-dialog-button-secondary{background:#e0e0e0;color:#777}.vex-loading-spinner.vex-theme-top{-moz-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-webkit-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%;background:#f0f0f0;border:0.2em solid transparent;border-top-color:#bbb;top:-1.1em;bottom:auto}@keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-moz-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-ms-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-o-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-moz-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-ms-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-o-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-webkit-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-moz-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-ms-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-o-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}.vex,.vex *,.vex *:before,.vex *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.vex{position:fixed;overflow:visible;-webkit-overflow-scrolling:touch;z-index:1111;top:0;right:0;bottom:0;left:0}.vex-overlay{background:#000;filter:alpha(opacity=40);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"}.vex-overlay{animation:vex-fadein 0.5s;-webkit-animation:vex-fadein 0.5s;-moz-animation:vex-fadein 0.5s;-ms-animation:vex-fadein 0.5s;-o-animation:vex-fadein 0.5s;-webkit-backface-visibility:hidden;position:fixed;background:rgba(0,0,0,0.4);top:0;right:0;bottom:0;left:0}.vex.vex-closing .vex-overlay{animation:vex-fadeout 0.5s;-webkit-animation:vex-fadeout 0.5s;-moz-animation:vex-fadeout 0.5s;-ms-animation:vex-fadeout 0.5s;-o-animation:vex-fadeout 0.5s;-webkit-backface-visibility:hidden}.vex-content{*zoom:1;animation:vex-fadein 0.5s;-webkit-animation:vex-fadein 0.5s;-moz-animation:vex-fadein 0.5s;-ms-animation:vex-fadein 0.5s;-o-animation:vex-fadein 0.5s;-webkit-backface-visibility:hidden;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.15);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.15);box-shadow:0px 1px 2px rgba(0,0,0,0.15);background:#fff}.vex-content:after{content:"";display:table;clear:both}.vex.vex-closing .vex-content{animation:vex-fadeout 0.5s;-webkit-animation:vex-fadeout 0.5s;-moz-animation:vex-fadeout 0.5s;-ms-animation:vex-fadeout 0.5s;-o-animation:vex-fadeout 0.5s;-webkit-backface-visibility:hidden}.vex-content .powered-by{display:block;font-size:11px;color:#888;padding:10px 0 0 0}.vex-content .vex-dialog-message,.vex-content .vex-dialog-input,.vex-content .vex-dialog-buttons{*zoom:1;font-size:16px}.vex-content .vex-dialog-message:after,.vex-content .vex-dialog-input:after,.vex-content .vex-dialog-buttons:after{content:"";display:table;clear:both}.vex-content .leadin-subscribe-powered-by{float:right;font-size:12px;font-weight:bold;color:#3288e6}.vex-close:before{font-family:Arial,sans-serif;content:"\00D7"}.vex-dialog-form{margin:0}.vex-dialog-form .vex-dialog-message{font-weight:bold}.vex-dialog-input .error{-moz-box-shadow:inset 0 0 0 2px #f33f33;-webkit-box-shadow:inset 0 0 0 2px #f33f33;box-shadow:inset 0 0 0 2px #f33f33}.vex-dialog-button{-webkit-appearance:none;cursor:pointer;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;float:right;margin:0 0 0 0.5em;font-family:inherit;text-transform:uppercase;letter-spacing:0.1em;font-size:0.8em;line-height:1em;padding:0.75em 2em}.vex-dialog-button.vex-last{margin-left:0}.vex-dialog-button:focus,.vex-dialog-button:hover{outline:none}.vex-dialog-button.vex-dialog-button-primary{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;border:0;background:#3288e6;color:#fff}.vex-dialog-button.vex-dialog-button-primary:hover{background:#5fa2ec}.vex-dialog-button.vex-dialog-button-secondary{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;border:0;background:#e0e0e0;color:#777}.vex-loading-spinner{animation:vex-rotation 0.7s linear infinite;-webkit-animation:vex-rotation 0.7s linear infinite;-moz-animation:vex-rotation 0.7s linear infinite;-ms-animation:vex-rotation 0.7s linear infinite;-o-animation:vex-rotation 0.7s linear infinite;-webkit-backface-visibility:hidden;-moz-box-shadow:0 0 1em rgba(0,0,0,0.1);-webkit-box-shadow:0 0 1em rgba(0,0,0,0.1);box-shadow:0 0 1em rgba(0,0,0,0.1);position:fixed;z-index:1112;margin:auto;top:0;right:0;bottom:0;left:0;height:2em;width:2em;background:#fff}@media only screen and (max-width: 760px){#leadin-subscribe-mobile-check,.leadin-subscribe-powered-by{display:none}}
assets/css/select2.css ADDED
@@ -0,0 +1,601 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Version: 3.4.8 Timestamp: Thu May 1 09:50:32 EDT 2014
3
+ */
4
+ .select2-container {
5
+ margin: 0;
6
+ position: relative;
7
+ display: inline-block;
8
+ /* inline-block for ie7 */
9
+ zoom: 1;
10
+ *display: inline;
11
+ vertical-align: middle;
12
+ }
13
+
14
+ .select2-container,
15
+ .select2-drop,
16
+ .select2-search,
17
+ .select2-search input {
18
+ /*
19
+ Force border-box so that % widths fit the parent
20
+ container without overlap because of margin/padding.
21
+ More Info : http://www.quirksmode.org/css/box.html
22
+ */
23
+ -webkit-box-sizing: border-box; /* webkit */
24
+ -moz-box-sizing: border-box; /* firefox */
25
+ box-sizing: border-box; /* css3 */
26
+ }
27
+
28
+ .select2-container .select2-choice {
29
+ display: block;
30
+ height: 28px;
31
+ padding: 0 0 0 8px;
32
+ overflow: hidden;
33
+ position: relative;
34
+
35
+ border: 1px solid #ddd;
36
+ white-space: nowrap;
37
+ line-height: 28px;
38
+ color: #444;
39
+ text-decoration: none;
40
+
41
+ border-radius: 4px;
42
+
43
+ background-clip: padding-box;
44
+
45
+ -webkit-touch-callout: none;
46
+ -webkit-user-select: none;
47
+ -moz-user-select: none;
48
+ -ms-user-select: none;
49
+ user-select: none;
50
+
51
+ background-color: #fff;
52
+ }
53
+
54
+ .select2-container.select2-drop-above .select2-choice {
55
+ border-bottom-color: #ddd;
56
+
57
+ border-radius: 0 0 4px 4px;
58
+ }
59
+
60
+ .select2-container.select2-allowclear .select2-choice .select2-chosen {
61
+ margin-right: 42px;
62
+ }
63
+
64
+ .select2-container .select2-choice > .select2-chosen {
65
+ margin-right: 28px;
66
+ display: block;
67
+ overflow: hidden;
68
+ line-height: 28px;
69
+ font-size: 0.8em;
70
+
71
+ white-space: nowrap;
72
+
73
+ text-overflow: ellipsis;
74
+ float: none;
75
+ width: auto;
76
+ }
77
+
78
+ .select2-container .select2-choice abbr {
79
+ display: none;
80
+ width: 12px;
81
+ height: 12px;
82
+ position: absolute;
83
+ right: 24px;
84
+ top: 8px;
85
+
86
+ font-size: 1px;
87
+ text-decoration: none;
88
+
89
+ border: 0;
90
+ background: url('../../images/select2.png') right top no-repeat;
91
+ cursor: pointer;
92
+ outline: 0;
93
+ }
94
+
95
+ .select2-container.select2-allowclear .select2-choice abbr {
96
+ display: inline-block;
97
+ }
98
+
99
+ .select2-container .select2-choice abbr:hover {
100
+ background-position: right -11px;
101
+ cursor: pointer;
102
+ }
103
+
104
+ .select2-drop-mask {
105
+ border: 0;
106
+ margin: 0;
107
+ padding: 0;
108
+ position: fixed;
109
+ left: 0;
110
+ top: 0;
111
+ min-height: 100%;
112
+ min-width: 100%;
113
+ height: auto;
114
+ width: auto;
115
+ opacity: 0;
116
+ z-index: 9998;
117
+ /* styles required for IE to work */
118
+ background-color: #fff;
119
+ filter: alpha(opacity=0);
120
+ }
121
+
122
+ .select2-drop {
123
+ width: 100%;
124
+ margin-top: -1px;
125
+ position: absolute;
126
+ z-index: 9999;
127
+ top: 100%;
128
+
129
+ background: #fff;
130
+ color: #000;
131
+ border: 1px solid #ddd;
132
+ border-top: 0;
133
+
134
+ border-radius: 0 0 4px 4px;
135
+
136
+ -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
137
+ box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
138
+ }
139
+
140
+ .select2-drop.select2-drop-above {
141
+ margin-top: 1px;
142
+ border-top: 1px solid #ddd;
143
+ border-bottom: 0;
144
+
145
+ border-radius: 4px 4px 0 0;
146
+
147
+ -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
148
+ box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
149
+ }
150
+
151
+ .select2-drop-active {
152
+ border: 1px solid #5897fb;
153
+ border-top: none;
154
+ }
155
+
156
+ .select2-drop.select2-drop-above.select2-drop-active {
157
+ border-top: 1px solid #5897fb;
158
+ }
159
+
160
+ .select2-drop-auto-width {
161
+ border-top: 1px solid #ddd;
162
+ width: auto;
163
+ }
164
+
165
+ .select2-drop-auto-width .select2-search {
166
+ padding-top: 4px;
167
+ }
168
+
169
+ .select2-container .select2-choice .select2-arrow {
170
+ display: inline-block;
171
+ width: 18px;
172
+ height: 100%;
173
+ position: absolute;
174
+ right: 0;
175
+ top: 0;
176
+
177
+ border-radius: 0 4px 4px 0;
178
+
179
+ background-clip: padding-box;
180
+
181
+ }
182
+
183
+ .select2-container .select2-choice .select2-arrow b {
184
+ display: block;
185
+ width: 100%;
186
+ height: 100%;
187
+ background: url('../../images/select2.png') no-repeat 0 1px;
188
+ }
189
+
190
+ .select2-search {
191
+ display: inline-block;
192
+ width: 100%;
193
+ min-height: 28px;
194
+ margin: 0;
195
+ padding-left: 4px;
196
+ padding-right: 4px;
197
+
198
+ position: relative;
199
+ z-index: 10000;
200
+
201
+ white-space: nowrap;
202
+ }
203
+
204
+ .select2-search input {
205
+ width: 100%;
206
+ height: auto !important;
207
+ min-height: 28px;
208
+ padding: 4px 20px 4px 5px;
209
+ margin: 0;
210
+
211
+ outline: 0;
212
+ font-family: sans-serif;
213
+ font-size: 1em;
214
+
215
+ border: 1px solid #ddd;
216
+ border-radius: 0;
217
+
218
+ -webkit-box-shadow: none;
219
+ box-shadow: none;
220
+
221
+ background: #fff
222
+ }
223
+
224
+ .select2-drop.select2-drop-above .select2-search input {
225
+ margin-top: 4px;
226
+ }
227
+
228
+ .select2-search input.select2-active {
229
+
230
+ }
231
+
232
+ .select2-container-active .select2-choice,
233
+ .select2-container-active .select2-choices {
234
+ border: 1px solid #5897fb;
235
+ outline: none;
236
+
237
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
238
+ box-shadow: 0 0 5px rgba(0, 0, 0, .3);
239
+ }
240
+
241
+ .select2-dropdown-open .select2-choice {
242
+ border-bottom-color: transparent;
243
+ -webkit-box-shadow: 0 1px 0 #fff inset;
244
+ box-shadow: 0 1px 0 #fff inset;
245
+
246
+ border-bottom-left-radius: 0;
247
+ border-bottom-right-radius: 0;
248
+
249
+ }
250
+
251
+ .select2-dropdown-open.select2-drop-above .select2-choice,
252
+ .select2-dropdown-open.select2-drop-above .select2-choices {
253
+ border: 1px solid #5897fb;
254
+ border-top-color: transparent;
255
+ }
256
+
257
+ .select2-dropdown-open .select2-choice .select2-arrow {
258
+ background: transparent;
259
+ border-left: none;
260
+ filter: none;
261
+ }
262
+ .select2-dropdown-open .select2-choice .select2-arrow b {
263
+ background-position: -18px 1px;
264
+ }
265
+
266
+ .select2-hidden-accessible {
267
+ border: 0;
268
+ clip: rect(0 0 0 0);
269
+ height: 1px;
270
+ margin: -1px;
271
+ overflow: hidden;
272
+ padding: 0;
273
+ position: absolute;
274
+ width: 1px;
275
+ }
276
+
277
+ /* results */
278
+ .select2-results {
279
+ max-height: 200px;
280
+ padding: 0 0 0 4px;
281
+ margin: 4px 4px 4px 0;
282
+ position: relative;
283
+ overflow-x: hidden;
284
+ overflow-y: auto;
285
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
286
+ }
287
+
288
+ .select2-results ul.select2-result-sub {
289
+ margin: 0;
290
+ padding-left: 0;
291
+ }
292
+
293
+ .select2-results li {
294
+ list-style: none;
295
+ display: list-item;
296
+ background-image: none;
297
+ }
298
+
299
+ .select2-results li.select2-result-with-children > .select2-result-label {
300
+ font-weight: bold;
301
+ }
302
+
303
+ .select2-results .select2-result-label {
304
+ padding: 3px 7px 4px;
305
+ margin: 0;
306
+ cursor: pointer;
307
+
308
+ min-height: 1em;
309
+
310
+ -webkit-touch-callout: none;
311
+ -webkit-user-select: none;
312
+ -moz-user-select: none;
313
+ -ms-user-select: none;
314
+ user-select: none;
315
+ }
316
+
317
+ .select2-results-dept-1 .select2-result-label { padding-left: 20px }
318
+ .select2-results-dept-2 .select2-result-label { padding-left: 40px }
319
+ .select2-results-dept-3 .select2-result-label { padding-left: 60px }
320
+ .select2-results-dept-4 .select2-result-label { padding-left: 80px }
321
+ .select2-results-dept-5 .select2-result-label { padding-left: 100px }
322
+ .select2-results-dept-6 .select2-result-label { padding-left: 110px }
323
+ .select2-results-dept-7 .select2-result-label { padding-left: 120px }
324
+
325
+ .select2-results .select2-highlighted {
326
+ background: #3875d7;
327
+ color: #fff;
328
+ }
329
+
330
+ .select2-results li em {
331
+ background: #feffde;
332
+ font-style: normal;
333
+ }
334
+
335
+ .select2-results .select2-highlighted em {
336
+ background: transparent;
337
+ }
338
+
339
+ .select2-results .select2-highlighted ul {
340
+ background: #fff;
341
+ color: #000;
342
+ }
343
+
344
+
345
+ .select2-results .select2-no-results,
346
+ .select2-results .select2-searching,
347
+ .select2-results .select2-selection-limit {
348
+ background: #f4f4f4;
349
+ display: list-item;
350
+ padding-left: 5px;
351
+ }
352
+
353
+ /*
354
+ disabled look for disabled choices in the results dropdown
355
+ */
356
+ .select2-results .select2-disabled.select2-highlighted {
357
+ color: #666;
358
+ background: #f4f4f4;
359
+ display: list-item;
360
+ cursor: default;
361
+ }
362
+ .select2-results .select2-disabled {
363
+ background: #f4f4f4;
364
+ display: list-item;
365
+ cursor: default;
366
+ }
367
+
368
+ .select2-results .select2-selected {
369
+ display: none;
370
+ }
371
+
372
+ .select2-more-results.select2-active {
373
+ background: #f4f4f4 url('../../images/select2-spinner.gif') no-repeat 100%;
374
+ }
375
+
376
+ .select2-more-results {
377
+ background: #f4f4f4;
378
+ display: list-item;
379
+ }
380
+
381
+ /* disabled styles */
382
+
383
+ .select2-container.select2-container-disabled .select2-choice {
384
+ background-color: #f4f4f4;
385
+ background-image: none;
386
+ border: 1px solid #ddd;
387
+ cursor: default;
388
+ }
389
+
390
+ .select2-container.select2-container-disabled .select2-choice .select2-arrow {
391
+ background-color: #f4f4f4;
392
+ background-image: none;
393
+ border-left: 0;
394
+ }
395
+
396
+ .select2-container.select2-container-disabled .select2-choice abbr {
397
+ display: none;
398
+ }
399
+
400
+
401
+ /* multiselect */
402
+
403
+ .select2-container-multi .select2-choices {
404
+ height: auto !important;
405
+ height: 1%;
406
+ margin: 0;
407
+ padding: 0;
408
+ position: relative;
409
+
410
+ border: 1px solid #ddd;
411
+ cursor: text;
412
+ overflow: hidden;
413
+
414
+ background-color: #fff;
415
+ }
416
+
417
+ .select2-locked {
418
+ padding: 3px 5px 3px 5px !important;
419
+ }
420
+
421
+ .select2-container-multi .select2-choices {
422
+ min-height: 28px;
423
+ }
424
+
425
+ .select2-container-multi.select2-container-active .select2-choices {
426
+ border: 1px solid #5897fb;
427
+ outline: none;
428
+
429
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
430
+ box-shadow: 0 0 5px rgba(0, 0, 0, .3);
431
+ }
432
+ .select2-container-multi .select2-choices li {
433
+ float: left;
434
+ list-style: none;
435
+ }
436
+ html[dir="rtl"] .select2-container-multi .select2-choices li
437
+ {
438
+ float: right;
439
+ }
440
+ .select2-container-multi .select2-choices .select2-search-field {
441
+ margin: 0;
442
+ padding: 0;
443
+ white-space: nowrap;
444
+ }
445
+
446
+ .select2-container-multi .select2-choices .select2-search-field input {
447
+ padding: 5px;
448
+ margin: 1px 0;
449
+
450
+ font-family: sans-serif;
451
+ font-size: 100%;
452
+ color: #666;
453
+ outline: 0;
454
+ border: 0;
455
+ -webkit-box-shadow: none;
456
+ box-shadow: none;
457
+ background: transparent !important;
458
+ }
459
+
460
+ .select2-container-multi .select2-choices .select2-search-field input.select2-active {
461
+ background: #fff url('../../images/select2-spinner.gif') no-repeat 100% !important;
462
+ }
463
+
464
+ .select2-default {
465
+ color: #999 !important;
466
+ }
467
+
468
+ .select2-container-multi .select2-choices .select2-search-choice {
469
+ padding: 3px 5px 3px 18px;
470
+ margin: 3px 0 3px 5px;
471
+ position: relative;
472
+
473
+ line-height: 13px;
474
+ color: #333;
475
+ cursor: default;
476
+ border: 1px solid #ddd;
477
+
478
+ border-radius: 3px;
479
+
480
+ -webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
481
+ box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
482
+
483
+ background-clip: padding-box;
484
+
485
+ -webkit-touch-callout: none;
486
+ -webkit-user-select: none;
487
+ -moz-user-select: none;
488
+ -ms-user-select: none;
489
+ user-select: none;
490
+
491
+ background-color: #e4e4e4;
492
+ }
493
+ html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice
494
+ {
495
+ margin-left: 0;
496
+ margin-right: 5px;
497
+ }
498
+ .select2-container-multi .select2-choices .select2-search-choice .select2-chosen {
499
+ cursor: default;
500
+ }
501
+ .select2-container-multi .select2-choices .select2-search-choice-focus {
502
+ background: #d4d4d4;
503
+ }
504
+
505
+ .select2-search-choice-close {
506
+ display: block;
507
+ width: 12px;
508
+ height: 13px;
509
+ position: absolute;
510
+ right: 3px;
511
+ top: 4px;
512
+
513
+ font-size: 1px;
514
+ outline: none;
515
+ background: url('../../images/select2.png') right top no-repeat;
516
+ }
517
+ html[dir="rtl"] .select2-search-choice-close {
518
+ right: auto;
519
+ left: 3px;
520
+ }
521
+
522
+ .select2-container-multi .select2-search-choice-close {
523
+ left: 3px;
524
+ }
525
+
526
+ .select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
527
+ background-position: right -11px;
528
+ }
529
+ .select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
530
+ background-position: right -11px;
531
+ }
532
+
533
+ /* disabled styles */
534
+ .select2-container-multi.select2-container-disabled .select2-choices {
535
+ background-color: #f4f4f4;
536
+ background-image: none;
537
+ border: 1px solid #ddd;
538
+ cursor: default;
539
+ }
540
+
541
+ .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
542
+ padding: 3px 5px 3px 5px;
543
+ border: 1px solid #ddd;
544
+ background-image: none;
545
+ background-color: #f4f4f4;
546
+ }
547
+
548
+ .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none;
549
+ background: none;
550
+ }
551
+ /* end multiselect */
552
+
553
+
554
+ .select2-result-selectable .select2-match,
555
+ .select2-result-unselectable .select2-match {
556
+ text-decoration: underline;
557
+ }
558
+
559
+ .select2-offscreen, .select2-offscreen:focus {
560
+ clip: rect(0 0 0 0) !important;
561
+ width: 1px !important;
562
+ height: 1px !important;
563
+ border: 0 !important;
564
+ margin: 0 !important;
565
+ padding: 0 !important;
566
+ overflow: hidden !important;
567
+ position: absolute !important;
568
+ outline: 0 !important;
569
+ left: 0px !important;
570
+ top: 0px !important;
571
+ }
572
+
573
+ .select2-display-none {
574
+ display: none;
575
+ }
576
+
577
+ .select2-measure-scrollbar {
578
+ position: absolute;
579
+ top: -10000px;
580
+ left: -10000px;
581
+ width: 100px;
582
+ height: 100px;
583
+ overflow: scroll;
584
+ }
585
+
586
+ /* Retina-ize icons */
587
+
588
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 2dppx) {
589
+ .select2-search input,
590
+ .select2-search-choice-close,
591
+ .select2-container .select2-choice abbr,
592
+ .select2-container .select2-choice .select2-arrow b {
593
+ background-image: url('../../images/select2x2.png') !important;
594
+ background-repeat: no-repeat !important;
595
+ background-size: 60px 40px !important;
596
+ }
597
+
598
+ .select2-search input {
599
+ background-position: 100% -21px !important;
600
+ }
601
+ }
assets/js/admin/leadin-admin.js DELETED
@@ -1,12 +0,0 @@
1
- jQuery(document).ready( function ( $ ) {
2
- $('.show_all_faces').on('click', function ( e ) {
3
- var $this = $(this);
4
- $this.closest('td').find('.hidden_face').removeClass('hidden_face');
5
- $this.remove();
6
- $("html,body").trigger("scroll");
7
- });
8
-
9
- $("img.lazy").lazyload({
10
- effect : "fadeIn"
11
- });
12
- });
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/admin/leadin-contacts-admin.js DELETED
@@ -1,72 +0,0 @@
1
- jQuery(document).ready( function ( $ ) {
2
- $('#leadin-contacts input:checkbox').not('thead input:checkbox, tfoot input:checkbox').bind('change', function ( e ){
3
- var cb_count = 0;
4
- var selected_vals = '';
5
- var $btn_selected = $('#leadin-export-selected-leads');
6
- var $input_selected_vals = $('#leadin-selected-contacts');
7
- var $cb_selected = $('#leadin-contacts input:checkbox:checked').not('thead input:checkbox, tfoot input:checkbox');
8
-
9
- if ( $cb_selected.length > 0 )
10
- {
11
- $btn_selected.attr('disabled', false);
12
- }
13
- else
14
- {
15
- $btn_selected.attr('disabled', true);
16
- }
17
-
18
- $cb_selected.each( function ( e ) {
19
- selected_vals += $(this).val();
20
-
21
- if ( cb_count != ($cb_selected.length-1) )
22
- selected_vals += ',';
23
-
24
- cb_count++;
25
- });
26
-
27
- $input_selected_vals.val(selected_vals);
28
- });
29
-
30
- $('#cb-select-all-1, #cb-select-all-2').bind('change', function ( e ) {
31
- var cb_count = 0;
32
- var selected_vals = '';
33
- var $this = $(this);
34
- var $btn_selected = $('#leadin-export-selected-leads');
35
- var $cb_selected = $('#leadin-contacts input:checkbox').not('thead input:checkbox, tfoot input:checkbox');
36
- var $input_selected_vals = $('#leadin-selected-contacts');
37
-
38
- $cb_selected.each( function ( e ) {
39
- selected_vals += $(this).val();
40
-
41
- if ( cb_count != ($cb_selected.length-1) )
42
- selected_vals += ',';
43
-
44
- cb_count++;
45
- });
46
-
47
- $input_selected_vals.val(selected_vals);
48
-
49
- if ( !$this.is(':checked') )
50
- {
51
- $btn_selected.attr('disabled', true);
52
- }
53
- else
54
- {
55
- $btn_selected.attr('disabled', false);
56
- }
57
- });
58
-
59
- $('.postbox .handlediv').bind('click', function ( e ) {
60
- var $postbox = $(this).parent();
61
-
62
- if ( $postbox.hasClass('closed') )
63
- {
64
- $postbox.removeClass('closed');
65
- }
66
- else
67
- {
68
- $postbox.addClass('closed');
69
- }
70
-
71
- });
72
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/build/leadin-admin.js CHANGED
@@ -1,16 +1,351 @@
1
- /*! Lazy Load 1.9.3 - MIT license - Copyright 2010-2013 Mika Tuupola */
2
- !function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("<img />").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document);
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  jQuery(document).ready( function ( $ ) {
5
- $('.show_all_faces').on('click', function ( e ) {
6
- var $this = $(this);
7
- $this.closest('td').find('.hidden_face').removeClass('hidden_face');
8
- $this.remove();
9
- $("html,body").trigger("scroll");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  });
11
 
12
- $("img.lazy").lazyload({
13
- effect : "fadeIn"
14
  });
15
  });
16
  jQuery(document).ready( function ( $ ) {
@@ -84,4 +419,3458 @@ jQuery(document).ready( function ( $ ) {
84
  }
85
 
86
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  });
1
+ /*
2
+ Highcharts JS v4.0.1 (2014-04-24)
3
 
4
+ (c) 2009-2014 Torstein Honsi
5
+
6
+ License: www.highcharts.com/license
7
+ */
8
+ (function(){function q(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function w(){var a,b=arguments,c,d={},e=function(a,b){var c,d;typeof a!=="object"&&(a={});for(d in b)b.hasOwnProperty(d)&&(c=b[d],a[d]=c&&typeof c==="object"&&Object.prototype.toString.call(c)!=="[object Array]"&&d!=="renderTo"&&typeof c.nodeType!=="number"?e(a[d]||{},c):b[d]);return a};b[0]===!0&&(d=b[1],b=Array.prototype.slice.call(b,2));c=b.length;for(a=0;a<c;a++)d=e(d,b[a]);return d}function z(a,b){return parseInt(a,b||
9
+ 10)}function Fa(a){return typeof a==="string"}function ca(a){return typeof a==="object"}function La(a){return Object.prototype.toString.call(a)==="[object Array]"}function ha(a){return typeof a==="number"}function za(a){return U.log(a)/U.LN10}function ia(a){return U.pow(10,a)}function ja(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function r(a){return a!==t&&a!==null}function H(a,b,c){var d,e;if(Fa(b))r(c)?a.setAttribute(b,c):a&&a.getAttribute&&(e=a.getAttribute(b));else if(r(b)&&
10
+ ca(b))for(d in b)a.setAttribute(d,b[d]);return e}function qa(a){return La(a)?a:[a]}function m(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++)if(c=a[b],typeof c!=="undefined"&&c!==null)return c}function G(a,b){if(Aa&&!aa&&b&&b.opacity!==t)b.filter="alpha(opacity="+b.opacity*100+")";q(a.style,b)}function Y(a,b,c,d,e){a=y.createElement(a);b&&q(a,b);e&&G(a,{padding:0,border:Q,margin:0});c&&G(a,c);d&&d.appendChild(a);return a}function ka(a,b){var c=function(){};c.prototype=new a;q(c.prototype,b);return c}
11
+ function Ga(a,b,c,d){var e=E.lang,a=+a||0,f=b===-1?(a.toString().split(".")[1]||"").length:isNaN(b=M(b))?2:b,b=c===void 0?e.decimalPoint:c,d=d===void 0?e.thousandsSep:d,e=a<0?"-":"",c=String(z(a=M(a).toFixed(f))),g=c.length>3?c.length%3:0;return e+(g?c.substr(0,g)+d:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?b+M(a-c).toFixed(f).slice(2):"")}function Ha(a,b){return Array((b||2)+1-String(a).length).join(0)+a}function Ma(a,b,c){var d=a[b];a[b]=function(){var a=Array.prototype.slice.call(arguments);
12
+ a.unshift(d);return c.apply(this,a)}}function Ia(a,b){for(var c="{",d=!1,e,f,g,h,i,j=[];(c=a.indexOf(c))!==-1;){e=a.slice(0,c);if(d){f=e.split(":");g=f.shift().split(".");i=g.length;e=b;for(h=0;h<i;h++)e=e[g[h]];if(f.length)f=f.join(":"),g=/\.([0-9])/,h=E.lang,i=void 0,/f$/.test(f)?(i=(i=f.match(g))?i[1]:-1,e!==null&&(e=Ga(e,i,h.decimalPoint,f.indexOf(",")>-1?h.thousandsSep:""))):e=cb(f,e)}j.push(e);a=a.slice(c+1);c=(d=!d)?"}":"{"}j.push(a);return j.join("")}function mb(a){return U.pow(10,T(U.log(a)/
13
+ U.LN10))}function nb(a,b,c,d){var e,c=m(c,1);e=a/c;b||(b=[1,2,2.5,5,10],d&&d.allowDecimals===!1&&(c===1?b=[1,2,5,10]:c<=0.1&&(b=[1/c])));for(d=0;d<b.length;d++)if(a=b[d],e<=(b[d]+(b[d+1]||b[d]))/2)break;a*=c;return a}function Bb(){this.symbol=this.color=0}function ob(a,b){var c=a.length,d,e;for(e=0;e<c;e++)a[e].ss_i=e;a.sort(function(a,c){d=b(a,c);return d===0?a.ss_i-c.ss_i:d});for(e=0;e<c;e++)delete a[e].ss_i}function Na(a){for(var b=a.length,c=a[0];b--;)a[b]<c&&(c=a[b]);return c}function Ba(a){for(var b=
14
+ a.length,c=a[0];b--;)a[b]>c&&(c=a[b]);return c}function Oa(a,b){for(var c in a)a[c]&&a[c]!==b&&a[c].destroy&&a[c].destroy(),delete a[c]}function Pa(a){db||(db=Y(Ja));a&&db.appendChild(a);db.innerHTML=""}function ra(a,b){var c="Highcharts error #"+a+": www.highcharts.com/errors/"+a;if(b)throw c;else I.console&&console.log(c)}function da(a){return parseFloat(a.toPrecision(14))}function Qa(a,b){va=m(a,b.animation)}function Cb(){var a=E.global.useUTC,b=a?"getUTC":"get",c=a?"setUTC":"set";Ra=(a&&E.global.timezoneOffset||
15
+ 0)*6E4;eb=a?Date.UTC:function(a,b,c,g,h,i){return(new Date(a,b,m(c,1),m(g,0),m(h,0),m(i,0))).getTime()};pb=b+"Minutes";qb=b+"Hours";rb=b+"Day";Xa=b+"Date";fb=b+"Month";gb=b+"FullYear";Db=c+"Minutes";Eb=c+"Hours";sb=c+"Date";Fb=c+"Month";Gb=c+"FullYear"}function P(){}function Sa(a,b,c,d){this.axis=a;this.pos=b;this.type=c||"";this.isNew=!0;!c&&!d&&this.addLabel()}function la(){this.init.apply(this,arguments)}function Ya(){this.init.apply(this,arguments)}function Hb(a,b,c,d,e){var f=a.chart.inverted;
16
+ this.axis=a;this.isNegative=c;this.options=b;this.x=d;this.total=null;this.points={};this.stack=e;this.alignOptions={align:b.align||(f?c?"left":"right":"center"),verticalAlign:b.verticalAlign||(f?"middle":c?"bottom":"top"),y:m(b.y,f?4:c?14:-6),x:m(b.x,f?c?-6:6:0)};this.textAlign=b.textAlign||(f?c?"right":"left":"center")}var t,y=document,I=window,U=Math,u=U.round,T=U.floor,Ka=U.ceil,v=U.max,C=U.min,M=U.abs,Z=U.cos,ea=U.sin,ma=U.PI,Ca=ma*2/360,wa=navigator.userAgent,Ib=I.opera,Aa=/msie/i.test(wa)&&
17
+ !Ib,hb=y.documentMode===8,ib=/AppleWebKit/.test(wa),Ta=/Firefox/.test(wa),Jb=/(Mobile|Android|Windows Phone)/.test(wa),xa="http://www.w3.org/2000/svg",aa=!!y.createElementNS&&!!y.createElementNS(xa,"svg").createSVGRect,Nb=Ta&&parseInt(wa.split("Firefox/")[1],10)<4,fa=!aa&&!Aa&&!!y.createElement("canvas").getContext,Za,$a,Kb={},tb=0,db,E,cb,va,ub,A,sa=function(){},V=[],ab=0,Ja="div",Q="none",Ob=/^[0-9]+$/,Pb="stroke-width",eb,Ra,pb,qb,rb,Xa,fb,gb,Db,Eb,sb,Fb,Gb,F={},R=I.Highcharts=I.Highcharts?ra(16,
18
+ !0):{};cb=function(a,b,c){if(!r(b)||isNaN(b))return"Invalid date";var a=m(a,"%Y-%m-%d %H:%M:%S"),d=new Date(b-Ra),e,f=d[qb](),g=d[rb](),h=d[Xa](),i=d[fb](),j=d[gb](),k=E.lang,l=k.weekdays,d=q({a:l[g].substr(0,3),A:l[g],d:Ha(h),e:h,b:k.shortMonths[i],B:k.months[i],m:Ha(i+1),y:j.toString().substr(2,2),Y:j,H:Ha(f),I:Ha(f%12||12),l:f%12||12,M:Ha(d[pb]()),p:f<12?"AM":"PM",P:f<12?"am":"pm",S:Ha(d.getSeconds()),L:Ha(u(b%1E3),3)},R.dateFormats);for(e in d)for(;a.indexOf("%"+e)!==-1;)a=a.replace("%"+e,typeof d[e]===
19
+ "function"?d[e](b):d[e]);return c?a.substr(0,1).toUpperCase()+a.substr(1):a};Bb.prototype={wrapColor:function(a){if(this.color>=a)this.color=0},wrapSymbol:function(a){if(this.symbol>=a)this.symbol=0}};A=function(){for(var a=0,b=arguments,c=b.length,d={};a<c;a++)d[b[a++]]=b[a];return d}("millisecond",1,"second",1E3,"minute",6E4,"hour",36E5,"day",864E5,"week",6048E5,"month",26784E5,"year",31556952E3);ub={init:function(a,b,c){var b=b||"",d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,g,b=b.split(" "),c=[].concat(c),
20
+ h,i,j=function(a){for(g=a.length;g--;)a[g]==="M"&&a.splice(g+1,0,a[g+1],a[g+2],a[g+1],a[g+2])};e&&(j(b),j(c));a.isArea&&(h=b.splice(b.length-6,6),i=c.splice(c.length-6,6));if(d<=c.length/f&&b.length===c.length)for(;d--;)c=[].concat(c).splice(0,f).concat(c);a.shift=0;if(b.length)for(a=c.length;b.length<a;)d=[].concat(b).splice(b.length-f,f),e&&(d[f-6]=d[f-2],d[f-5]=d[f-1]),b=b.concat(d);h&&(b=b.concat(h),c=c.concat(i));return[b,c]},step:function(a,b,c,d){var e=[],f=a.length;if(c===1)e=d;else if(f===
21
+ b.length&&c<1)for(;f--;)d=parseFloat(a[f]),e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d;else e=b;return e}};(function(a){I.HighchartsAdapter=I.HighchartsAdapter||a&&{init:function(b){var c=a.fx,d=c.step,e,f=a.Tween,g=f&&f.propHooks;e=a.cssHooks.opacity;a.extend(a.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}});a.each(["cur","_default","width","height","opacity"],function(a,b){var e=d,k;b==="cur"?e=c.prototype:b==="_default"&&f&&(e=g[b],b="set");(k=e[b])&&(e[b]=function(c){var d,c=
22
+ a?c:this;if(c.prop!=="align")return d=c.elem,d.attr?d.attr(c.prop,b==="cur"?t:c.now):k.apply(this,arguments)})});Ma(e,"get",function(a,b,c){return b.attr?b.opacity||0:a.call(this,b,c)});e=function(a){var c=a.elem,d;if(!a.started)d=b.init(c,c.d,c.toD),a.start=d[0],a.end=d[1],a.started=!0;c.attr("d",b.step(a.start,a.end,a.pos,c.toD))};f?g.d={set:e}:d.d=e;this.each=Array.prototype.forEach?function(a,b){return Array.prototype.forEach.call(a,b)}:function(a,b){for(var c=0,d=a.length;c<d;c++)if(b.call(a[c],
23
+ a[c],c,a)===!1)return c};a.fn.highcharts=function(){var a="Chart",b=arguments,c,d;if(this[0]){Fa(b[0])&&(a=b[0],b=Array.prototype.slice.call(b,1));c=b[0];if(c!==t)c.chart=c.chart||{},c.chart.renderTo=this[0],new R[a](c,b[1]),d=this;c===t&&(d=V[H(this[0],"data-highcharts-chart")])}return d}},getScript:a.getScript,inArray:a.inArray,adapterRun:function(b,c){return a(b)[c]()},grep:a.grep,map:function(a,c){for(var d=[],e=0,f=a.length;e<f;e++)d[e]=c.call(a[e],a[e],e,a);return d},offset:function(b){return a(b).offset()},
24
+ addEvent:function(b,c,d){a(b).bind(c,d)},removeEvent:function(b,c,d){var e=y.removeEventListener?"removeEventListener":"detachEvent";y[e]&&b&&!b[e]&&(b[e]=function(){});a(b).unbind(c,d)},fireEvent:function(b,c,d,e){var f=a.Event(c),g="detached"+c,h;!Aa&&d&&(delete d.layerX,delete d.layerY,delete d.returnValue);q(f,d);b[c]&&(b[g]=b[c],b[c]=null);a.each(["preventDefault","stopPropagation"],function(a,b){var c=f[b];f[b]=function(){try{c.call(f)}catch(a){b==="preventDefault"&&(h=!0)}}});a(b).trigger(f);
25
+ b[g]&&(b[c]=b[g],b[g]=null);e&&!f.isDefaultPrevented()&&!h&&e(f)},washMouseEvent:function(a){var c=a.originalEvent||a;if(c.pageX===t)c.pageX=a.pageX,c.pageY=a.pageY;return c},animate:function(b,c,d){var e=a(b);if(!b.style)b.style={};if(c.d)b.toD=c.d,c.d=1;e.stop();c.opacity!==t&&b.attr&&(c.opacity+="px");e.animate(c,d)},stop:function(b){a(b).stop()}}})(I.jQuery);var S=I.HighchartsAdapter,N=S||{};S&&S.init.call(S,ub);var jb=N.adapterRun,Qb=N.getScript,Da=N.inArray,p=N.each,vb=N.grep,Rb=N.offset,Ua=
26
+ N.map,K=N.addEvent,W=N.removeEvent,D=N.fireEvent,Sb=N.washMouseEvent,kb=N.animate,bb=N.stop,N={enabled:!0,x:0,y:15,style:{color:"#606060",cursor:"default",fontSize:"11px"}};E={colors:"#7cb5ec,#434348,#90ed7d,#f7a35c,#8085e9,#f15c80,#e4d354,#8085e8,#8d4653,#91e8e1".split(","),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),shortMonths:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),
27
+ weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),decimalPoint:".",numericSymbols:"k,M,G,T,P,E".split(","),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:!0,canvasToolsURL:"http://code.highcharts.com/4.0.1/modules/canvas-tools.js",VMLRadialGradientURL:"http://code.highcharts.com/4.0.1/gfx/vml-radial-gradient.png"},chart:{borderColor:"#4572A7",borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,
28
+ 10],backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0",resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}}},title:{text:"Chart title",align:"center",margin:15,style:{color:"#333333",fontSize:"18px"}},subtitle:{text:"",align:"center",style:{color:"#555555"}},plotOptions:{line:{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},lineWidth:2,marker:{lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{enabled:!0},select:{fillColor:"#FFFFFF",lineColor:"#000000",
29
+ lineWidth:2}}},point:{events:{}},dataLabels:w(N,{align:"center",enabled:!1,formatter:function(){return this.y===null?"":Ga(this.y,-1)},verticalAlign:"bottom",y:0}),cropThreshold:300,pointRange:0,states:{hover:{marker:{},halo:{size:10,opacity:0.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1E3}},labels:{style:{position:"absolute",color:"#3E576F"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#909090",borderRadius:0,navigation:{activeColor:"#274b6d",
30
+ inactiveColor:"#CCC"},shadow:!1,itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},itemHoverStyle:{color:"#000"},itemHiddenStyle:{color:"#CCC"},itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"1em"},style:{position:"absolute",backgroundColor:"white",opacity:0.5,textAlign:"center"}},tooltip:{enabled:!0,animation:aa,backgroundColor:"rgba(249, 249, 249, .85)",
31
+ borderWidth:1,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{series.color}">●</span> {series.name}: <b>{point.y}</b><br/>',shadow:!0,snap:Jb?25:10,style:{color:"#333333",cursor:"default",fontSize:"12px",padding:"8px",
32
+ whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"9px"}}};var ba=E.plotOptions,S=ba.line;Cb();var Tb=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,Ub=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,Vb=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,ya=function(a){var b=[],c,
33
+ d;(function(a){a&&a.stops?d=Ua(a.stops,function(a){return ya(a[1])}):(c=Tb.exec(a))?b=[z(c[1]),z(c[2]),z(c[3]),parseFloat(c[4],10)]:(c=Ub.exec(a))?b=[z(c[1],16),z(c[2],16),z(c[3],16),1]:(c=Vb.exec(a))&&(b=[z(c[1]),z(c[2]),z(c[3]),1])})(a);return{get:function(c){var f;d?(f=w(a),f.stops=[].concat(f.stops),p(d,function(a,b){f.stops[b]=[f.stops[b][0],a.get(c)]})):f=b&&!isNaN(b[0])?c==="rgb"?"rgb("+b[0]+","+b[1]+","+b[2]+")":c==="a"?b[3]:"rgba("+b.join(",")+")":a;return f},brighten:function(a){if(d)p(d,
34
+ function(b){b.brighten(a)});else if(ha(a)&&a!==0){var c;for(c=0;c<3;c++)b[c]+=z(a*255),b[c]<0&&(b[c]=0),b[c]>255&&(b[c]=255)}return this},rgba:b,setOpacity:function(a){b[3]=a;return this}}};P.prototype={init:function(a,b){this.element=b==="span"?Y(b):y.createElementNS(xa,b);this.renderer=a},opacity:1,animate:function(a,b,c){b=m(b,va,!0);bb(this);if(b){b=w(b,{});if(c)b.complete=c;kb(this,a,b)}else this.attr(a),c&&c()},colorGradient:function(a,b,c){var d=this.renderer,e,f,g,h,i,j,k,l,o,n,s=[];a.linearGradient?
35
+ f="linearGradient":a.radialGradient&&(f="radialGradient");if(f){g=a[f];h=d.gradients;j=a.stops;o=c.radialReference;La(g)&&(a[f]=g={x1:g[0],y1:g[1],x2:g[2],y2:g[3],gradientUnits:"userSpaceOnUse"});f==="radialGradient"&&o&&!r(g.gradientUnits)&&(g=w(g,{cx:o[0]-o[2]/2+g.cx*o[2],cy:o[1]-o[2]/2+g.cy*o[2],r:g.r*o[2],gradientUnits:"userSpaceOnUse"}));for(n in g)n!=="id"&&s.push(n,g[n]);for(n in j)s.push(j[n]);s=s.join(",");h[s]?a=h[s].attr("id"):(g.id=a="highcharts-"+tb++,h[s]=i=d.createElement(f).attr(g).add(d.defs),
36
+ i.stops=[],p(j,function(a){a[1].indexOf("rgba")===0?(e=ya(a[1]),k=e.get("rgb"),l=e.get("a")):(k=a[1],l=1);a=d.createElement("stop").attr({offset:a[0],"stop-color":k,"stop-opacity":l}).add(i);i.stops.push(a)}));c.setAttribute(b,"url("+d.url+"#"+a+")")}},attr:function(a,b){var c,d,e=this.element,f,g=this,h;typeof a==="string"&&b!==t&&(c=a,a={},a[c]=b);if(typeof a==="string")g=(this[a+"Getter"]||this._defaultGetter).call(this,a,e);else{for(c in a){d=a[c];h=!1;this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(c)&&
37
+ (f||(this.symbolAttr(a),f=!0),h=!0);if(this.rotation&&(c==="x"||c==="y"))this.doTransform=!0;h||(this[c+"Setter"]||this._defaultSetter).call(this,d,c,e);this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(c)&&this.updateShadows(c,d)}if(this.doTransform)this.updateTransform(),this.doTransform=!1}return g},updateShadows:function(a,b){for(var c=this.shadows,d=c.length;d--;)c[d].setAttribute(a,a==="height"?v(b-(c[d].cutHeight||0),0):a==="d"?this.d:b)},addClass:function(a){var b=this.element,
38
+ c=H(b,"class")||"";c.indexOf(a)===-1&&H(b,"class",c+" "+a);return this},symbolAttr:function(a){var b=this;p("x,y,r,start,end,width,height,innerR,anchorX,anchorY".split(","),function(c){b[c]=m(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](b.x,b.y,b.width,b.height,b)})},clip:function(a){return this.attr("clip-path",a?"url("+this.renderer.url+"#"+a.id+")":Q)},crisp:function(a){var b,c={},d,e=a.strokeWidth||this.strokeWidth||this.attr&&this.attr("stroke-width")||0;d=u(e)%2/2;a.x=T(a.x||this.x||
39
+ 0)+d;a.y=T(a.y||this.y||0)+d;a.width=T((a.width||this.width||0)-2*d);a.height=T((a.height||this.height||0)-2*d);a.strokeWidth=e;for(b in a)this[b]!==a[b]&&(this[b]=c[b]=a[b]);return c},css:function(a){var b=this.styles,c={},d=this.element,e,f,g="";e=!b;if(a&&a.color)a.fill=a.color;if(b)for(f in a)a[f]!==b[f]&&(c[f]=a[f],e=!0);if(e){e=this.textWidth=a&&a.width&&d.nodeName.toLowerCase()==="text"&&z(a.width);b&&(a=q(b,c));this.styles=a;e&&(fa||!aa&&this.renderer.forExport)&&delete a.width;if(Aa&&!aa)G(this.element,
40
+ a);else{b=function(a,b){return"-"+b.toLowerCase()};for(f in a)g+=f.replace(/([A-Z])/g,b)+":"+a[f]+";";H(d,"style",g)}e&&this.added&&this.renderer.buildText(this)}return this},on:function(a,b){var c=this,d=c.element;$a&&a==="click"?(d.ontouchstart=function(a){c.touchEventFired=Date.now();a.preventDefault();b.call(d,a)},d.onclick=function(a){(wa.indexOf("Android")===-1||Date.now()-(c.touchEventFired||0)>1100)&&b.call(d,a)}):d["on"+a]=b;return this},setRadialReference:function(a){this.element.radialReference=
41
+ a;return this},translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(){this.inverted=!0;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.scaleX,d=this.scaleY,e=this.inverted,f=this.rotation,g=this.element;e&&(a+=this.attr("width"),b+=this.attr("height"));a=["translate("+a+","+b+")"];e?a.push("rotate(90) scale(-1,1)"):f&&a.push("rotate("+f+" "+(g.getAttribute("x")||0)+" "+(g.getAttribute("y")||0)+")");
42
+ (r(c)||r(d))&&a.push("scale("+m(c,1)+" "+m(d,1)+")");a.length&&g.setAttribute("transform",a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){var d,e,f,g,h={};e=this.renderer;f=e.alignedObjects;if(a){if(this.alignOptions=a,this.alignByTranslate=b,!c||Fa(c))this.alignTo=d=c||"renderer",ja(f,this),f.push(this),c=null}else a=this.alignOptions,b=this.alignByTranslate,d=this.alignTo;c=m(c,e[d],e);d=a.align;e=a.verticalAlign;f=(c.x||0)+(a.x||
43
+ 0);g=(c.y||0)+(a.y||0);if(d==="right"||d==="center")f+=(c.width-(a.width||0))/{right:1,center:2}[d];h[b?"translateX":"x"]=u(f);if(e==="bottom"||e==="middle")g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||1);h[b?"translateY":"y"]=u(g);this[this.placed?"animate":"attr"](h);this.placed=!0;this.alignAttr=h;return this},getBBox:function(){var a=this.bBox,b=this.renderer,c,d,e=this.rotation;c=this.element;var f=this.styles,g=e*Ca;d=this.textStr;var h;if(d===""||Ob.test(d))h="num."+d.toString().length+
44
+ (f?"|"+f.fontSize+"|"+f.fontFamily:"");h&&(a=b.cache[h]);if(!a){if(c.namespaceURI===xa||b.forExport){try{a=c.getBBox?q({},c.getBBox()):{width:c.offsetWidth,height:c.offsetHeight}}catch(i){}if(!a||a.width<0)a={width:0,height:0}}else a=this.htmlGetBBox();if(b.isSVG){c=a.width;d=a.height;if(Aa&&f&&f.fontSize==="11px"&&d.toPrecision(3)==="16.9")a.height=d=14;if(e)a.width=M(d*ea(g))+M(c*Z(g)),a.height=M(d*Z(g))+M(c*ea(g))}this.bBox=a;h&&(b.cache[h]=a)}return a},show:function(a){return a&&this.element.namespaceURI===
45
+ xa?(this.element.removeAttribute("visibility"),this):this.attr({visibility:a?"inherit":"visible"})},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var b=this;b.animate({opacity:0},{duration:a||150,complete:function(){b.hide()}})},add:function(a){var b=this.renderer,c=a||b,d=c.element||b.box,e=this.element,f=this.zIndex,g,h;if(a)this.parentGroup=a;this.parentInverted=a&&a.inverted;this.textStr!==void 0&&b.buildText(this);if(f)c.handleZ=!0,f=z(f);if(c.handleZ){a=d.childNodes;
46
+ for(g=0;g<a.length;g++)if(b=a[g],c=H(b,"zIndex"),b!==e&&(z(c)>f||!r(f)&&r(c))){d.insertBefore(e,b);h=!0;break}}h||d.appendChild(e);this.added=!0;if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(a){var b=a.parentNode;b&&b.removeChild(a)},destroy:function(){var a=this,b=a.element||{},c=a.shadows,d=a.renderer.isSVG&&b.nodeName==="SPAN"&&a.parentGroup,e,f;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=b.point=null;bb(a);if(a.clipPath)a.clipPath=a.clipPath.destroy();if(a.stops){for(f=
47
+ 0;f<a.stops.length;f++)a.stops[f]=a.stops[f].destroy();a.stops=null}a.safeRemoveChild(b);for(c&&p(c,function(b){a.safeRemoveChild(b)});d&&d.div.childNodes.length===0;)b=d.parentGroup,a.safeRemoveChild(d.div),delete d.div,d=b;a.alignTo&&ja(a.renderer.alignedObjects,a);for(e in a)delete a[e];return null},shadow:function(a,b,c){var d=[],e,f,g=this.element,h,i,j,k;if(a){i=m(a.width,3);j=(a.opacity||0.15)/i;k=this.parentInverted?"(-1,-1)":"("+m(a.offsetX,1)+", "+m(a.offsetY,1)+")";for(e=1;e<=i;e++){f=
48
+ g.cloneNode(0);h=i*2+1-2*e;H(f,{isShadow:"true",stroke:a.color||"black","stroke-opacity":j*e,"stroke-width":h,transform:"translate"+k,fill:Q});if(c)H(f,"height",v(H(f,"height")-h,0)),f.cutHeight=h;b?b.element.appendChild(f):g.parentNode.insertBefore(f,g);d.push(f)}this.shadows=d}return this},xGetter:function(a){this.element.nodeName==="circle"&&(a={x:"cx",y:"cy"}[a]||a);return this._defaultGetter(a)},_defaultGetter:function(a){a=m(this[a],this.element?this.element.getAttribute(a):null,0);/^[0-9\.]+$/.test(a)&&
49
+ (a=parseFloat(a));return a},dSetter:function(a,b,c){a&&a.join&&(a=a.join(" "));/(NaN| {2}|^$)/.test(a)&&(a="M 0 0");c.setAttribute(b,a);this[b]=a},dashstyleSetter:function(a){var b;if(a=a&&a.toLowerCase()){a=a.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(b=a.length;b--;)a[b]=z(a[b])*this.element.getAttribute("stroke-width");
50
+ a=a.join(",");this.element.setAttribute("stroke-dasharray",a)}},alignSetter:function(a){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[a])},opacitySetter:function(a,b,c){this[b]=a;c.setAttribute(b,a)},"stroke-widthSetter":function(a,b,c){a===0&&(a=1.0E-5);this.strokeWidth=a;c.setAttribute(b,a)},titleSetter:function(a){var b=this.element.getElementsByTagName("title")[0];b||(b=y.createElementNS(xa,"title"),this.element.appendChild(b));b.textContent=a},textSetter:function(a){if(a!==
51
+ this.textStr)delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this)},fillSetter:function(a,b,c){typeof a==="string"?c.setAttribute(b,a):a&&this.colorGradient(a,b,c)},zIndexSetter:function(a,b,c){c.setAttribute(b,a);this[b]=a},_defaultSetter:function(a,b,c){c.setAttribute(b,a)}};P.prototype.yGetter=P.prototype.xGetter;P.prototype.translateXSetter=P.prototype.translateYSetter=P.prototype.rotationSetter=P.prototype.verticalAlignSetter=P.prototype.scaleXSetter=P.prototype.scaleYSetter=
52
+ function(a,b){this[b]=a;this.doTransform=!0};P.prototype.strokeSetter=P.prototype.fillSetter;var ta=function(){this.init.apply(this,arguments)};ta.prototype={Element:P,init:function(a,b,c,d,e){var f=location,g,d=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(d));g=d.element;a.appendChild(g);a.innerHTML.indexOf("xmlns")===-1&&H(g,"xmlns",xa);this.isSVG=!0;this.box=g;this.boxWrapper=d;this.alignedObjects=[];this.url=(Ta||ib)&&y.getElementsByTagName("base").length?f.href.replace(/#.*?$/,
53
+ "").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(y.createTextNode("Created with Highcharts 4.0.1"));this.defs=this.createElement("defs").add();this.forExport=e;this.gradients={};this.cache={};this.setSize(b,c,!1);var h;if(Ta&&a.getBoundingClientRect)this.subPixelFix=b=function(){G(a,{left:0,top:0});h=a.getBoundingClientRect();G(a,{left:Ka(h.left)-h.left+"px",top:Ka(h.top)-h.top+"px"})},b(),K(I,"resize",b)},getStyle:function(a){return this.style=
54
+ q({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},a)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();Oa(this.gradients||{});this.gradients=null;if(a)this.defs=a.destroy();this.subPixelFix&&W(I,"resize",this.subPixelFix);return this.alignedObjects=null},createElement:function(a){var b=new this.Element;b.init(this,a);return b},draw:function(){},
55
+ buildText:function(a){for(var b=a.element,c=this,d=c.forExport,e=m(a.textStr,"").toString(),f=e.indexOf("<")!==-1,g=b.childNodes,h,i,j=H(b,"x"),k=a.styles,l=a.textWidth,o=k&&k.lineHeight,n=g.length,s=function(a){return o?z(o):c.fontMetrics(/(px|em)$/.test(a&&a.style.fontSize)?a.style.fontSize:k&&k.fontSize||c.style.fontSize||12).h};n--;)b.removeChild(g[n]);!f&&e.indexOf(" ")===-1?b.appendChild(y.createTextNode(e)):(h=/<.*style="([^"]+)".*>/,i=/<.*href="(http[^"]+)".*>/,l&&!a.added&&this.box.appendChild(b),
56
+ e=f?e.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g):[e],e[e.length-1]===""&&e.pop(),p(e,function(e,f){var g,n=0,e=e.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");g=e.split("|||");p(g,function(e){if(e!==""||g.length===1){var o={},m=y.createElementNS(xa,"tspan"),p;h.test(e)&&(p=e.match(h)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),
57
+ H(m,"style",p));i.test(e)&&!d&&(H(m,"onclick",'location.href="'+e.match(i)[1]+'"'),G(m,{cursor:"pointer"}));e=(e.replace(/<(.|\n)*?>/g,"")||" ").replace(/&lt;/g,"<").replace(/&gt;/g,">");if(e!==" "){m.appendChild(y.createTextNode(e));if(n)o.dx=0;else if(f&&j!==null)o.x=j;H(m,o);!n&&f&&(!aa&&d&&G(m,{display:"block"}),H(m,"dy",s(m),ib&&m.offsetHeight));b.appendChild(m);n++;if(l)for(var e=e.replace(/([^\^])-/g,"$1- ").split(" "),o=e.length>1&&k.whiteSpace!=="nowrap",$,r,B=a._clipHeight,q=[],v=s(),t=
58
+ 1;o&&(e.length||q.length);)delete a.bBox,$=a.getBBox(),r=$.width,!aa&&c.forExport&&(r=c.measureSpanWidth(m.firstChild.data,a.styles)),$=r>l,!$||e.length===1?(e=q,q=[],e.length&&(t++,B&&t*v>B?(e=["..."],a.attr("title",a.textStr)):(m=y.createElementNS(xa,"tspan"),H(m,{dy:v,x:j}),p&&H(m,"style",p),b.appendChild(m),r>l&&(l=r)))):(m.removeChild(m.firstChild),q.unshift(e.pop())),e.length&&m.appendChild(y.createTextNode(e.join(" ").replace(/- /g,"-")))}}})}))},button:function(a,b,c,d,e,f,g,h,i){var j=this.label(a,
59
+ b,c,i,null,null,null,null,"button"),k=0,l,o,n,s,m,p,a={x1:0,y1:0,x2:0,y2:1},e=w({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:a,stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},r:2,padding:5,style:{color:"black"}},e);n=e.style;delete e.style;f=w(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#FFF"],[1,"#ACF"]]}},f);s=f.style;delete f.style;g=w(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#9BD"],[1,"#CDF"]]}},g);m=g.style;delete g.style;h=w(e,{style:{color:"#CCC"}},h);p=h.style;delete h.style;
60
+ K(j.element,Aa?"mouseover":"mouseenter",function(){k!==3&&j.attr(f).css(s)});K(j.element,Aa?"mouseout":"mouseleave",function(){k!==3&&(l=[e,f,g][k],o=[n,s,m][k],j.attr(l).css(o))});j.setState=function(a){(j.state=k=a)?a===2?j.attr(g).css(m):a===3&&j.attr(h).css(p):j.attr(e).css(n)};return j.on("click",function(){k!==3&&d.call(j)}).attr(e).css(q({cursor:"default"},n))},crispLine:function(a,b){a[1]===a[4]&&(a[1]=a[4]=u(a[1])-b%2/2);a[2]===a[5]&&(a[2]=a[5]=u(a[2])+b%2/2);return a},path:function(a){var b=
61
+ {fill:Q};La(a)?b.d=a:ca(a)&&q(b,a);return this.createElement("path").attr(b)},circle:function(a,b,c){a=ca(a)?a:{x:a,y:b,r:c};b=this.createElement("circle");b.xSetter=function(a){this.element.setAttribute("cx",a)};b.ySetter=function(a){this.element.setAttribute("cy",a)};return b.attr(a)},arc:function(a,b,c,d,e,f){if(ca(a))b=a.y,c=a.r,d=a.innerR,e=a.start,f=a.end,a=a.x;a=this.symbol("arc",a||0,b||0,c||0,c||0,{innerR:d||0,start:e||0,end:f||0});a.r=c;return a},rect:function(a,b,c,d,e,f){var e=ca(a)?a.r:
62
+ e,g=this.createElement("rect"),a=ca(a)?a:a===t?{}:{x:a,y:b,width:v(c,0),height:v(d,0)};if(f!==t)a.strokeWidth=f,a=g.crisp(a);if(e)a.r=e;g.rSetter=function(a){H(this.element,{rx:a,ry:a})};return g.attr(a)},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;this.width=a;this.height=b;for(this.boxWrapper[m(c,!0)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){var b=this.createElement("g");return r(a)?b.attr({"class":"highcharts-"+a}):b},image:function(a,b,c,d,e){var f=
63
+ {preserveAspectRatio:Q};arguments.length>1&&q(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,b,c,d,e,f){var g,h=this.symbols[a],h=h&&h(u(b),u(c),d,e,f),i=/^url\((.*?)\)$/,j,k;if(h)g=this.path(h),q(g,{symbolName:a,x:b,y:c,width:d,height:e}),f&&q(g,f);else if(i.test(a))k=function(a,b){a.element&&(a.attr({width:b[0],height:b[1]}),
64
+ a.alignByTranslate||a.translate(u((d-b[0])/2),u((e-b[1])/2)))},j=a.match(i)[1],a=Kb[j],g=this.image(j).attr({x:b,y:c}),g.isImg=!0,a?k(g,a):(g.attr({width:0,height:0}),Y("img",{onload:function(){k(g,Kb[j]=[this.width,this.height])},src:j}));return g},symbols:{circle:function(a,b,c,d){var e=0.166*c;return["M",a+c/2,b,"C",a+c+e,b,a+c+e,b+d,a+c/2,b+d,"C",a-e,b+d,a-e,b,a+c/2,b,"Z"]},square:function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c,b+d,a,b+d,"Z"]},triangle:function(a,b,c,d){return["M",a+c/2,b,"L",
65
+ a+c,b+d,a,b+d,"Z"]},"triangle-down":function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c/2,b+d,"Z"]},diamond:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d/2,a+c/2,b+d,a,b+d/2,"Z"]},arc:function(a,b,c,d,e){var f=e.start,c=e.r||c||d,g=e.end-0.001,d=e.innerR,h=e.open,i=Z(f),j=ea(f),k=Z(g),g=ea(g),e=e.end-f<ma?0:1;return["M",a+c*i,b+c*j,"A",c,c,0,e,1,a+c*k,b+c*g,h?"M":"L",a+d*k,b+d*g,"A",d,d,0,e,0,a+d*i,b+d*j,h?"":"Z"]},callout:function(a,b,c,d,e){var f=C(e&&e.r||0,c,d),g=f+6,h=e&&e.anchorX,i=e&&e.anchorY,
66
+ e=u(e.strokeWidth||0)%2/2;a+=e;b+=e;e=["M",a+f,b,"L",a+c-f,b,"C",a+c,b,a+c,b,a+c,b+f,"L",a+c,b+d-f,"C",a+c,b+d,a+c,b+d,a+c-f,b+d,"L",a+f,b+d,"C",a,b+d,a,b+d,a,b+d-f,"L",a,b+f,"C",a,b,a,b,a+f,b];h&&h>c&&i>b+g&&i<b+d-g?e.splice(13,3,"L",a+c,i-6,a+c+6,i,a+c,i+6,a+c,b+d-f):h&&h<0&&i>b+g&&i<b+d-g?e.splice(33,3,"L",a,i+6,a-6,i,a,i-6,a,b+f):i&&i>d&&h>a+g&&h<a+c-g?e.splice(23,3,"L",h+6,b+d,h,b+d+6,h-6,b+d,a+f,b+d):i&&i<0&&h>a+g&&h<a+c-g&&e.splice(3,3,"L",h-6,b,h,b-6,h+6,b,c-f,b);return e}},clipRect:function(a,
67
+ b,c,d){var e="highcharts-"+tb++,f=this.createElement("clipPath").attr({id:e}).add(this.defs),a=this.rect(a,b,c,d,0).add(f);a.id=e;a.clipPath=f;return a},text:function(a,b,c,d){var e=fa||!aa&&this.forExport,f={};if(d&&!this.forExport)return this.html(a,b,c);f.x=Math.round(b||0);if(c)f.y=Math.round(c);if(a||a===0)f.text=a;a=this.createElement("text").attr(f);e&&a.css({position:"absolute"});if(!d)a.xSetter=function(a,b,c){var d=c.childNodes,e,f;for(f=1;f<d.length;f++)e=d[f],e.getAttribute("x")===c.getAttribute("x")&&
68
+ e.setAttribute("x",a);c.setAttribute(b,a)};return a},fontMetrics:function(a){var a=a||this.style.fontSize,a=/px/.test(a)?z(a):/em/.test(a)?parseFloat(a)*12:12,a=a<24?a+4:u(a*1.2),b=u(a*0.8);return{h:a,b:b}},label:function(a,b,c,d,e,f,g,h,i){function j(){var a,b;a=s.element.style;J=(Va===void 0||wb===void 0||n.styles.textAlign)&&s.textStr&&s.getBBox();n.width=(Va||J.width||0)+2*x+v;n.height=(wb||J.height||0)+2*x;na=x+o.fontMetrics(a&&a.fontSize).b;if(z){if(!m)a=u(-L*x),b=h?-na:0,n.box=m=d?o.symbol(d,
69
+ a,b,n.width,n.height,B):o.rect(a,b,n.width,n.height,0,B[Pb]),m.attr("fill",Q).add(n);m.isImg||m.attr(q({width:u(n.width),height:u(n.height)},B));B=null}}function k(){var a=n.styles,a=a&&a.textAlign,b=v+x*(1-L),c;c=h?0:na;if(r(Va)&&J&&(a==="center"||a==="right"))b+={center:0.5,right:1}[a]*(Va-J.width);if(b!==s.x||c!==s.y)s.attr("x",b),c!==t&&s.attr("y",c);s.x=b;s.y=c}function l(a,b){m?m.attr(a,b):B[a]=b}var o=this,n=o.g(i),s=o.text("",0,0,g).attr({zIndex:1}),m,J,L=0,x=3,v=0,Va,wb,xb,yb,y=0,B={},na,
70
+ z;n.onAdd=function(){s.add(n);n.attr({text:a||"",x:b,y:c});m&&r(e)&&n.attr({anchorX:e,anchorY:f})};n.widthSetter=function(a){Va=a};n.heightSetter=function(a){wb=a};n.paddingSetter=function(a){r(a)&&a!==x&&(x=a,k())};n.paddingLeftSetter=function(a){r(a)&&a!==v&&(v=a,k())};n.alignSetter=function(a){L={left:0,center:0.5,right:1}[a]};n.textSetter=function(a){a!==t&&s.textSetter(a);j();k()};n["stroke-widthSetter"]=function(a,b){a&&(z=!0);y=a%2/2;l(b,a)};n.strokeSetter=n.fillSetter=n.rSetter=function(a,
71
+ b){b==="fill"&&a&&(z=!0);l(b,a)};n.anchorXSetter=function(a,b){e=a;l(b,a+y-xb)};n.anchorYSetter=function(a,b){f=a;l(b,a-yb)};n.xSetter=function(a){n.x=a;L&&(a-=L*((Va||J.width)+x));xb=u(a);n.attr("translateX",xb)};n.ySetter=function(a){yb=n.y=u(a);n.attr("translateY",yb)};var A=n.css;return q(n,{css:function(a){if(a){var b={},a=w(a);p("fontSize,fontWeight,fontFamily,color,lineHeight,width,textDecoration,textShadow".split(","),function(c){a[c]!==t&&(b[c]=a[c],delete a[c])});s.css(b)}return A.call(n,
72
+ a)},getBBox:function(){return{width:J.width+2*x,height:J.height+2*x,x:J.x-x,y:J.y-x}},shadow:function(a){m&&m.shadow(a);return n},destroy:function(){W(n.element,"mouseenter");W(n.element,"mouseleave");s&&(s=s.destroy());m&&(m=m.destroy());P.prototype.destroy.call(n);n=o=j=k=l=null}})}};Za=ta;q(P.prototype,{htmlCss:function(a){var b=this.element;if(b=a&&b.tagName==="SPAN"&&a.width)delete a.width,this.textWidth=b,this.updateTransform();this.styles=q(this.styles,a);G(this.element,a);return this},htmlGetBBox:function(){var a=
73
+ this.element,b=this.bBox;if(!b){if(a.nodeName==="text")a.style.position="absolute";b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}}return b},htmlUpdateTransform:function(){if(this.added){var a=this.renderer,b=this.element,c=this.translateX||0,d=this.translateY||0,e=this.x||0,f=this.y||0,g=this.textAlign||"left",h={left:0,center:0.5,right:1}[g],i=this.shadows;G(b,{marginLeft:c,marginTop:d});i&&p(i,function(a){G(a,{marginLeft:c+1,marginTop:d+1})});this.inverted&&
74
+ p(b.childNodes,function(c){a.invertChild(c,b)});if(b.tagName==="SPAN"){var j=this.rotation,k,l=z(this.textWidth),o=[j,g,b.innerHTML,this.textWidth].join(",");if(o!==this.cTT){k=a.fontMetrics(b.style.fontSize).b;r(j)&&this.setSpanRotation(j,h,k);i=m(this.elemWidth,b.offsetWidth);if(i>l&&/[ \-]/.test(b.textContent||b.innerText))G(b,{width:l+"px",display:"block",whiteSpace:"normal"}),i=l;this.getSpanCorrection(i,k,h,j,g)}G(b,{left:e+(this.xCorr||0)+"px",top:f+(this.yCorr||0)+"px"});if(ib)k=b.offsetHeight;
75
+ this.cTT=o}}else this.alignOnAdd=!0},setSpanRotation:function(a,b,c){var d={},e=Aa?"-ms-transform":ib?"-webkit-transform":Ta?"MozTransform":Ib?"-o-transform":"";d[e]=d.transform="rotate("+a+"deg)";d[e+(Ta?"Origin":"-origin")]=d.transformOrigin=b*100+"% "+c+"px";G(this.element,d)},getSpanCorrection:function(a,b,c){this.xCorr=-a*c;this.yCorr=-b}});q(ta.prototype,{html:function(a,b,c){var d=this.createElement("span"),e=d.element,f=d.renderer;d.textSetter=function(a){a!==e.innerHTML&&delete this.bBox;
76
+ e.innerHTML=this.textStr=a};d.xSetter=d.ySetter=d.alignSetter=d.rotationSetter=function(a,b){b==="align"&&(b="textAlign");d[b]=a;d.htmlUpdateTransform()};d.attr({text:a,x:u(b),y:u(c)}).css({position:"absolute",whiteSpace:"nowrap",fontFamily:this.style.fontFamily,fontSize:this.style.fontSize});d.css=d.htmlCss;if(f.isSVG)d.add=function(a){var b,c=f.box.parentNode,j=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)j.push(a),a=a.parentGroup;p(j.reverse(),function(a){var d;b=a.div=a.div||Y(Ja,{className:H(a.element,
77
+ "class")},{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px"},b||c);d=b.style;q(a,{translateXSetter:function(b,c){d.left=b+"px";a[c]=b;a.doTransform=!0},translateYSetter:function(b,c){d.top=b+"px";a[c]=b;a.doTransform=!0},visibilitySetter:function(a,b){d[b]=a}})})}}else b=c;b.appendChild(e);d.added=!0;d.alignOnAdd&&d.htmlUpdateTransform();return d};return d}});var X;if(!aa&&!fa){R.VMLElement=X={init:function(a,b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ","absolute",
78
+ ";"],e=b===Ja;(b==="shape"||e)&&d.push("left:0;top:0;width:1px;height:1px;");d.push("visibility: ",e?"hidden":"visible");c.push(' style="',d.join(""),'"/>');if(b)c=e||b==="span"||b==="img"?c.join(""):a.prepVML(c),this.element=Y(c);this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box,d=a?a.element||a:d;a&&a.inverted&&b.invertChild(c,d);d.appendChild(c);this.added=!0;this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform();if(this.onAdd)this.onAdd();return this},updateTransform:P.prototype.htmlUpdateTransform,
79
+ setSpanRotation:function(){var a=this.rotation,b=Z(a*Ca),c=ea(a*Ca);G(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11=",b,", M12=",-c,", M21=",c,", M22=",b,", sizingMethod='auto expand')"].join(""):Q})},getSpanCorrection:function(a,b,c,d,e){var f=d?Z(d*Ca):1,g=d?ea(d*Ca):0,h=m(this.elemHeight,this.element.offsetHeight),i;this.xCorr=f<0&&-a;this.yCorr=g<0&&-h;i=f*g<0;this.xCorr+=g*b*(i?1-c:c);this.yCorr-=f*b*(d?i?c:1-c:1);e&&e!=="left"&&(this.xCorr-=a*c*(f<0?-1:1),d&&(this.yCorr-=
80
+ h*c*(g<0?-1:1)),G(this.element,{textAlign:e}))},pathToVML:function(a){for(var b=a.length,c=[];b--;)if(ha(a[b]))c[b]=u(a[b]*10)-5;else if(a[b]==="Z")c[b]="x";else if(c[b]=a[b],a.isArc&&(a[b]==="wa"||a[b]==="at"))c[b+5]===c[b+7]&&(c[b+7]+=a[b+7]>a[b+5]?1:-1),c[b+6]===c[b+8]&&(c[b+8]+=a[b+8]>a[b+6]?1:-1);return c.join(" ")||"x"},clip:function(a){var b=this,c;a?(c=a.members,ja(c,b),c.push(b),b.destroyClip=function(){ja(c,b)},a=a.getCSS(b)):(b.destroyClip&&b.destroyClip(),a={clip:hb?"inherit":"rect(auto)"});
81
+ return b.css(a)},css:P.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&Pa(a)},destroy:function(){this.destroyClip&&this.destroyClip();return P.prototype.destroy.apply(this)},on:function(a,b){this.element["on"+a]=function(){var a=I.event;a.target=a.srcElement;b(a)};return this},cutOffPath:function(a,b){var c,a=a.split(/[ ,]/);c=a.length;if(c===9||c===11)a[c-4]=a[c-2]=z(a[c-2])-10*b;return a.join(" ")},shadow:function(a,b,c){var d=[],e,f=this.element,g=this.renderer,h,i=f.style,j,k=f.path,
82
+ l,o,n,s;k&&typeof k.value!=="string"&&(k="x");o=k;if(a){n=m(a.width,3);s=(a.opacity||0.15)/n;for(e=1;e<=3;e++){l=n*2+1-2*e;c&&(o=this.cutOffPath(k.value,l+0.5));j=['<shape isShadow="true" strokeweight="',l,'" filled="false" path="',o,'" coordsize="10 10" style="',f.style.cssText,'" />'];h=Y(g.prepVML(j),null,{left:z(i.left)+m(a.offsetX,1),top:z(i.top)+m(a.offsetY,1)});if(c)h.cutOff=l+1;j=['<stroke color="',a.color||"black",'" opacity="',s*e,'"/>'];Y(g.prepVML(j),null,null,h);b?b.element.appendChild(h):
83
+ f.parentNode.insertBefore(h,f);d.push(h)}this.shadows=d}return this},updateShadows:sa,setAttr:function(a,b){hb?this.element[a]=b:this.element.setAttribute(a,b)},classSetter:function(a){this.element.className=a},dashstyleSetter:function(a,b,c){(c.getElementsByTagName("stroke")[0]||Y(this.renderer.prepVML(["<stroke/>"]),null,null,c))[b]=a||"solid";this[b]=a},dSetter:function(a,b,c){var d=this.shadows,a=a||[];this.d=a.join(" ");c.path=a=this.pathToVML(a);if(d)for(c=d.length;c--;)d[c].path=d[c].cutOff?
84
+ this.cutOffPath(a,d[c].cutOff):a;this.setAttr(b,a)},fillSetter:function(a,b,c){var d=c.nodeName;if(d==="SPAN")c.style.color=a;else if(d!=="IMG")c.filled=a!==Q,this.setAttr("fillcolor",this.renderer.color(a,c,b,this))},opacitySetter:sa,rotationSetter:function(a,b,c){c=c.style;this[b]=c[b]=a;c.left=-u(ea(a*Ca)+1)+"px";c.top=u(Z(a*Ca))+"px"},strokeSetter:function(a,b,c){this.setAttr("strokecolor",this.renderer.color(a,c,b))},"stroke-widthSetter":function(a,b,c){c.stroked=!!a;this[b]=a;ha(a)&&(a+="px");
85
+ this.setAttr("strokeweight",a)},titleSetter:function(a,b){this.setAttr(b,a)},visibilitySetter:function(a,b,c){a==="inherit"&&(a="visible");this.shadows&&p(this.shadows,function(c){c.style[b]=a});c.nodeName==="DIV"&&(a=a==="hidden"?"-999em":0,hb||(c.style[b]=a?"visible":"hidden"),b="top");c.style[b]=a},xSetter:function(a,b,c){this[b]=a;b==="x"?b="left":b==="y"&&(b="top");this.updateClipping?(this[b]=a,this.updateClipping()):c.style[b]=a},zIndexSetter:function(a,b,c){c.style[b]=a}};X=ka(P,X);X.prototype.ySetter=
86
+ X.prototype.widthSetter=X.prototype.heightSetter=X.prototype.xSetter;var ga={Element:X,isIE8:wa.indexOf("MSIE 8.0")>-1,init:function(a,b,c,d){var e;this.alignedObjects=[];d=this.createElement(Ja).css(q(this.getStyle(d),{position:"relative"}));e=d.element;a.appendChild(d.element);this.isVML=!0;this.box=e;this.boxWrapper=d;this.cache={};this.setSize(b,c,!1);if(!y.namespaces.hcv){y.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{y.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(f){y.styleSheets[0].cssText+=
87
+ "hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}},isHidden:function(){return!this.box.offsetWidth},clipRect:function(a,b,c,d){var e=this.createElement(),f=ca(a);return q(e,{members:[],left:(f?a.x:a)+1,top:(f?a.y:b)+1,width:(f?a.width:c)-1,height:(f?a.height:d)-1,getCSS:function(a){var b=a.element,c=b.nodeName,a=a.inverted,d=this.top-(c==="shape"?b.offsetTop:0),e=this.left,b=e+this.width,f=d+this.height,d={clip:"rect("+u(a?e:d)+"px,"+u(a?
88
+ f:b)+"px,"+u(a?b:f)+"px,"+u(a?d:e)+"px)"};!a&&hb&&c==="DIV"&&q(d,{width:b+"px",height:f+"px"});return d},updateClipping:function(){p(e.members,function(a){a.element&&a.css(e.getCSS(a))})}})},color:function(a,b,c,d){var e=this,f,g=/^rgba/,h,i,j=Q;a&&a.linearGradient?i="gradient":a&&a.radialGradient&&(i="pattern");if(i){var k,l,o=a.linearGradient||a.radialGradient,n,s,m,J,L,x="",a=a.stops,r,v=[],q=function(){h=['<fill colors="'+v.join(",")+'" opacity="',m,'" o:opacity2="',s,'" type="',i,'" ',x,'focus="100%" method="any" />'];
89
+ Y(e.prepVML(h),null,null,b)};n=a[0];r=a[a.length-1];n[0]>0&&a.unshift([0,n[1]]);r[0]<1&&a.push([1,r[1]]);p(a,function(a,b){g.test(a[1])?(f=ya(a[1]),k=f.get("rgb"),l=f.get("a")):(k=a[1],l=1);v.push(a[0]*100+"% "+k);b?(m=l,J=k):(s=l,L=k)});if(c==="fill")if(i==="gradient")c=o.x1||o[0]||0,a=o.y1||o[1]||0,n=o.x2||o[2]||0,o=o.y2||o[3]||0,x='angle="'+(90-U.atan((o-a)/(n-c))*180/ma)+'"',q();else{var j=o.r,t=j*2,u=j*2,y=o.cx,B=o.cy,na=b.radialReference,w,j=function(){na&&(w=d.getBBox(),y+=(na[0]-w.x)/w.width-
90
+ 0.5,B+=(na[1]-w.y)/w.height-0.5,t*=na[2]/w.width,u*=na[2]/w.height);x='src="'+E.global.VMLRadialGradientURL+'" size="'+t+","+u+'" origin="0.5,0.5" position="'+y+","+B+'" color2="'+L+'" ';q()};d.added?j():d.onAdd=j;j=J}else j=k}else if(g.test(a)&&b.tagName!=="IMG")f=ya(a),h=["<",c,' opacity="',f.get("a"),'"/>'],Y(this.prepVML(h),null,null,b),j=f.get("rgb");else{j=b.getElementsByTagName(c);if(j.length)j[0].opacity=1,j[0].type="solid";j=a}return j},prepVML:function(a){var b=this.isIE8,a=a.join("");b?
91
+ (a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):a=a.replace("<","<hcv:");return a},text:ta.prototype.html,path:function(a){var b={coordsize:"10 10"};La(a)?b.d=a:ca(a)&&q(b,a);return this.createElement("shape").attr(b)},circle:function(a,b,c){var d=this.symbol("circle");if(ca(a))c=a.r,b=a.y,a=a.x;d.isCircle=
92
+ !0;d.r=c;return d.attr({x:a,y:b})},g:function(a){var b;a&&(b={className:"highcharts-"+a,"class":"highcharts-"+a});return this.createElement(Ja).attr(b)},image:function(a,b,c,d,e){var f=this.createElement("img").attr({src:a});arguments.length>1&&f.attr({x:b,y:c,width:d,height:e});return f},createElement:function(a){return a==="rect"?this.symbol(a):ta.prototype.createElement.call(this,a)},invertChild:function(a,b){var c=this,d=b.style,e=a.tagName==="IMG"&&a.style;G(a,{flip:"x",left:z(d.width)-(e?z(e.top):
93
+ 1),top:z(d.height)-(e?z(e.left):1),rotation:-90});p(a.childNodes,function(b){c.invertChild(b,a)})},symbols:{arc:function(a,b,c,d,e){var f=e.start,g=e.end,h=e.r||c||d,c=e.innerR,d=Z(f),i=ea(f),j=Z(g),k=ea(g);if(g-f===0)return["x"];f=["wa",a-h,b-h,a+h,b+h,a+h*d,b+h*i,a+h*j,b+h*k];e.open&&!c&&f.push("e","M",a,b);f.push("at",a-c,b-c,a+c,b+c,a+c*j,b+c*k,a+c*d,b+c*i,"x","e");f.isArc=!0;return f},circle:function(a,b,c,d,e){e&&(c=d=2*e.r);e&&e.isCircle&&(a-=c/2,b-=d/2);return["wa",a,b,a+c,b+d,a+c,b+d/2,a+
94
+ c,b+d/2,"e"]},rect:function(a,b,c,d,e){return ta.prototype.symbols[!r(e)||!e.r?"square":"callout"].call(0,a,b,c,d,e)}}};R.VMLRenderer=X=function(){this.init.apply(this,arguments)};X.prototype=w(ta.prototype,ga);Za=X}ta.prototype.measureSpanWidth=function(a,b){var c=y.createElement("span"),d;d=y.createTextNode(a);c.appendChild(d);G(c,b);this.box.appendChild(c);d=c.offsetWidth;Pa(c);return d};var Lb;if(fa)R.CanVGRenderer=X=function(){xa="http://www.w3.org/1999/xhtml"},X.prototype.symbols={},Lb=function(){function a(){var a=
95
+ b.length,d;for(d=0;d<a;d++)b[d]();b=[]}var b=[];return{push:function(c,d){b.length===0&&Qb(d,a);b.push(c)}}}(),Za=X;Sa.prototype={addLabel:function(){var a=this.axis,b=a.options,c=a.chart,d=a.horiz,e=a.categories,f=a.names,g=this.pos,h=b.labels,i=a.tickPositions,d=d&&e&&!h.step&&!h.staggerLines&&!h.rotation&&c.plotWidth/i.length||!d&&(c.margin[3]||c.chartWidth*0.33),j=g===i[0],k=g===i[i.length-1],l,f=e?m(e[g],f[g],g):g,e=this.label,o=i.info;a.isDatetimeAxis&&o&&(l=b.dateTimeLabelFormats[o.higherRanks[g]||
96
+ o.unitName]);this.isFirst=j;this.isLast=k;b=a.labelFormatter.call({axis:a,chart:c,isFirst:j,isLast:k,dateTimeLabelFormat:l,value:a.isLog?da(ia(f)):f});g=d&&{width:v(1,u(d-2*(h.padding||10)))+"px"};g=q(g,h.style);if(r(e))e&&e.attr({text:b}).css(g);else{l={align:a.labelAlign};if(ha(h.rotation))l.rotation=h.rotation;if(d&&h.ellipsis)l._clipHeight=a.len/i.length;this.label=r(b)&&h.enabled?c.renderer.text(b,0,0,h.useHTML).attr(l).css(g).add(a.labelGroup):null}},getLabelSize:function(){var a=this.label,
97
+ b=this.axis;return a?a.getBBox()[b.horiz?"height":"width"]:0},getLabelSides:function(){var a=this.label.getBBox(),b=this.axis,c=b.horiz,d=b.options.labels,a=c?a.width:a.height,b=c?d.x-a*{left:0,center:0.5,right:1}[b.labelAlign]:0;return[b,c?a+b:a]},handleOverflow:function(a,b){var c=!0,d=this.axis,e=this.isFirst,f=this.isLast,g=d.horiz?b.x:b.y,h=d.reversed,i=d.tickPositions,j=this.getLabelSides(),k=j[0],j=j[1],l,o,n,s=this.label.line||0;l=d.labelEdge;o=d.justifyLabels&&(e||f);l[s]===t||g+k>l[s]?l[s]=
98
+ g+j:o||(c=!1);if(o){l=(o=d.justifyToPlot)?d.pos:0;o=o?l+d.len:d.chart.chartWidth;do a+=e?1:-1,n=d.ticks[i[a]];while(i[a]&&(!n||n.label.line!==s));d=n&&n.label.xy&&n.label.xy.x+n.getLabelSides()[e?0:1];e&&!h||f&&h?g+k<l&&(g=l-k,n&&g+j>d&&(c=!1)):g+j>o&&(g=o-j,n&&g+k<d&&(c=!1));b.x=g}return c},getPosition:function(a,b,c,d){var e=this.axis,f=e.chart,g=d&&f.oldChartHeight||f.chartHeight;return{x:a?e.translate(b+c,null,null,d)+e.transB:e.left+e.offset+(e.opposite?(d&&f.oldChartWidth||f.chartWidth)-e.right-
99
+ e.left:0),y:a?g-e.bottom+e.offset-(e.opposite?e.height:0):g-e.translate(b+c,null,null,d)-e.transB}},getLabelPosition:function(a,b,c,d,e,f,g,h){var i=this.axis,j=i.transA,k=i.reversed,l=i.staggerLines,o=i.chart.renderer.fontMetrics(e.style.fontSize).b,n=e.rotation,a=a+e.x-(f&&d?f*j*(k?-1:1):0),b=b+e.y-(f&&!d?f*j*(k?1:-1):0);n&&i.side===2&&(b-=o-o*Z(n*Ca));!r(e.y)&&!n&&(b+=o-c.getBBox().height/2);if(l)c.line=g/(h||1)%l,b+=c.line*(i.labelOffset/l);return{x:a,y:b}},getMarkPath:function(a,b,c,d,e,f){return f.crispLine(["M",
100
+ a,b,"L",a+(e?0:-c),b+(e?c:0)],d)},render:function(a,b,c){var d=this.axis,e=d.options,f=d.chart.renderer,g=d.horiz,h=this.type,i=this.label,j=this.pos,k=e.labels,l=this.gridLine,o=h?h+"Grid":"grid",n=h?h+"Tick":"tick",s=e[o+"LineWidth"],p=e[o+"LineColor"],J=e[o+"LineDashStyle"],L=e[n+"Length"],o=e[n+"Width"]||0,x=e[n+"Color"],r=e[n+"Position"],n=this.mark,v=k.step,q=!0,u=d.tickmarkOffset,w=this.getPosition(g,j,u,b),y=w.x,w=w.y,B=g&&y===d.pos+d.len||!g&&w===d.pos?-1:1;this.isActive=!0;if(s){j=d.getPlotLinePath(j+
101
+ u,s*B,b,!0);if(l===t){l={stroke:p,"stroke-width":s};if(J)l.dashstyle=J;if(!h)l.zIndex=1;if(b)l.opacity=0;this.gridLine=l=s?f.path(j).attr(l).add(d.gridGroup):null}if(!b&&l&&j)l[this.isNew?"attr":"animate"]({d:j,opacity:c})}if(o&&L)r==="inside"&&(L=-L),d.opposite&&(L=-L),h=this.getMarkPath(y,w,L,o*B,g,f),n?n.animate({d:h,opacity:c}):this.mark=f.path(h).attr({stroke:x,"stroke-width":o,opacity:c}).add(d.axisGroup);if(i&&!isNaN(y))i.xy=w=this.getLabelPosition(y,w,i,g,k,u,a,v),this.isFirst&&!this.isLast&&
102
+ !m(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!m(e.showLastLabel,1)?q=!1:!d.isRadial&&!k.step&&!k.rotation&&!b&&c!==0&&(q=this.handleOverflow(a,w)),v&&a%v&&(q=!1),q&&!isNaN(w.y)?(w.opacity=c,i[this.isNew?"attr":"animate"](w),this.isNew=!1):i.attr("y",-9999)},destroy:function(){Oa(this,this.axis)}};R.PlotLineOrBand=function(a,b){this.axis=a;if(b)this.options=b,this.id=b.id};R.PlotLineOrBand.prototype={render:function(){var a=this,b=a.axis,c=b.horiz,d=(b.pointRange||0)/2,e=a.options,f=e.label,
103
+ g=a.label,h=e.width,i=e.to,j=e.from,k=r(j)&&r(i),l=e.value,o=e.dashStyle,n=a.svgElem,s=[],p,J=e.color,L=e.zIndex,x=e.events,q={},t=b.chart.renderer;b.isLog&&(j=za(j),i=za(i),l=za(l));if(h){if(s=b.getPlotLinePath(l,h),q={stroke:J,"stroke-width":h},o)q.dashstyle=o}else if(k){j=v(j,b.min-d);i=C(i,b.max+d);s=b.getPlotBandPath(j,i,e);if(J)q.fill=J;if(e.borderWidth)q.stroke=e.borderColor,q["stroke-width"]=e.borderWidth}else return;if(r(L))q.zIndex=L;if(n)if(s)n.animate({d:s},null,n.onGetPath);else{if(n.hide(),
104
+ n.onGetPath=function(){n.show()},g)a.label=g=g.destroy()}else if(s&&s.length&&(a.svgElem=n=t.path(s).attr(q).add(),x))for(p in d=function(b){n.on(b,function(c){x[b].apply(a,[c])})},x)d(p);if(f&&r(f.text)&&s&&s.length&&b.width>0&&b.height>0){f=w({align:c&&k&&"center",x:c?!k&&4:10,verticalAlign:!c&&k&&"middle",y:c?k?16:10:k?6:-4,rotation:c&&!k&&90},f);if(!g){q={align:f.textAlign||f.align,rotation:f.rotation};if(r(L))q.zIndex=L;a.label=g=t.text(f.text,0,0,f.useHTML).attr(q).css(f.style).add()}b=[s[1],
105
+ s[4],m(s[6],s[1])];s=[s[2],s[5],m(s[7],s[2])];c=Na(b);k=Na(s);g.align(f,!1,{x:c,y:k,width:Ba(b)-c,height:Ba(s)-k});g.show()}else g&&g.hide();return a},destroy:function(){ja(this.axis.plotLinesAndBands,this);delete this.axis;Oa(this)}};la.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#C0C0C0",labels:N,lineColor:"#C0D0E0",lineWidth:1,minPadding:0.01,
106
+ maxPadding:0.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:!0,
107
+ tickWidth:0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return Ga(this.total,-1)},style:N.style}},defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{x:0,y:20},title:{rotation:0}},defaultTopAxisOptions:{labels:{x:0,y:-15},title:{rotation:0}},init:function(a,b){var c=b.isX;this.horiz=a.inverted?!c:c;this.coll=(this.isXAxis=c)?"xAxis":"yAxis";this.opposite=
108
+ b.opposite;this.side=b.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(b);var d=this.options,e=d.type;this.labelFormatter=d.labels.formatter||this.defaultLabelFormatter;this.userOptions=b;this.minPixelPadding=0;this.chart=a;this.reversed=d.reversed;this.zoomEnabled=d.zoomEnabled!==!1;this.categories=d.categories||e==="category";this.names=[];this.isLog=e==="logarithmic";this.isDatetimeAxis=e==="datetime";this.isLinked=r(d.linkedTo);this.tickmarkOffset=this.categories&&d.tickmarkPlacement===
109
+ "between"?0.5:0;this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=d.minRange||d.maxZoom;this.range=d.range;this.offset=d.offset||0;this.stacks={};this.oldStacks={};this.min=this.max=null;this.crosshair=m(d.crosshair,qa(a.options.tooltip.crosshairs)[c?0:1],!1);var f,d=this.options.events;Da(this,a.axes)===-1&&(c&&!this.isColorAxis?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));
110
+ this.series=this.series||[];if(a.inverted&&c&&this.reversed===t)this.reversed=!0;this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(f in d)K(this,f,d[f]);if(this.isLog)this.val2lin=za,this.lin2val=ia},setOptions:function(a){this.options=w(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],w(E[this.coll],a))},defaultLabelFormatter:function(){var a=
111
+ this.axis,b=this.value,c=a.categories,d=this.dateTimeLabelFormat,e=E.lang.numericSymbols,f=e&&e.length,g,h=a.options.labels.format,a=a.isLog?b:a.tickInterval;if(h)g=Ia(h,this);else if(c)g=b;else if(d)g=cb(d,b);else if(f&&a>=1E3)for(;f--&&g===t;)c=Math.pow(1E3,f+1),a>=c&&e[f]!==null&&(g=Ga(b/c,-1)+e[f]);g===t&&(g=M(b)>=1E4?Ga(b,0):Ga(b,-1,t,""));return g},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=null;a.buildStacks&&a.buildStacks();p(a.series,function(c){if(c.visible||
112
+ !b.options.chart.ignoreHiddenSeries){var d;d=c.options.threshold;var e;a.hasVisibleSeries=!0;a.isLog&&d<=0&&(d=null);if(a.isXAxis){if(d=c.xData,d.length)a.dataMin=C(m(a.dataMin,d[0]),Na(d)),a.dataMax=v(m(a.dataMax,d[0]),Ba(d))}else{c.getExtremes();e=c.dataMax;c=c.dataMin;if(r(c)&&r(e))a.dataMin=C(m(a.dataMin,c),c),a.dataMax=v(m(a.dataMax,e),e);if(r(d))if(a.dataMin>=d)a.dataMin=d,a.ignoreMinPadding=!0;else if(a.dataMax<d)a.dataMax=d,a.ignoreMaxPadding=!0}}})},translate:function(a,b,c,d,e,f){var g=
113
+ 1,h=0,i=d?this.oldTransA:this.transA,d=d?this.oldMin:this.min,j=this.minPixelPadding,e=(this.options.ordinal||this.isLog&&e)&&this.lin2val;if(!i)i=this.transA;if(c)g*=-1,h=this.len;this.reversed&&(g*=-1,h-=g*(this.sector||this.len));b?(a=a*g+h,a-=j,a=a/i+d,e&&(a=this.lin2val(a))):(e&&(a=this.val2lin(a)),f==="between"&&(f=0.5),a=g*(a-d)*i+h+g*j+(ha(f)?i*f*this.pointRange:0));return a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,b){return this.translate(a-
114
+ (b?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,b,c,d,e){var f=this.chart,g=this.left,h=this.top,i,j,k=c&&f.oldChartHeight||f.chartHeight,l=c&&f.oldChartWidth||f.chartWidth,o;i=this.transB;e=m(e,this.translate(a,null,null,c));a=c=u(e+i);i=j=u(k-e-i);if(isNaN(e))o=!0;else if(this.horiz){if(i=h,j=k-this.bottom,a<g||a>g+this.width)o=!0}else if(a=g,c=l-this.right,i<h||i>h+this.height)o=!0;return o&&!d?null:f.renderer.crispLine(["M",a,i,"L",c,j],b||1)},getLinearTickPositions:function(a,
115
+ b,c){var d,e=da(T(b/a)*a),f=da(Ka(c/a)*a),g=[];if(b===c&&ha(b))return[b];for(b=e;b<=f;){g.push(b);b=da(b+a);if(b===d)break;d=b}return g},getMinorTickPositions:function(){var a=this.options,b=this.tickPositions,c=this.minorTickInterval,d=[],e;if(this.isLog){e=b.length;for(a=1;a<e;a++)d=d.concat(this.getLogTickPositions(c,b[a-1],b[a],!0))}else if(this.isDatetimeAxis&&a.minorTickInterval==="auto")d=d.concat(this.getTimeTicks(this.normalizeTimeTickInterval(c),this.min,this.max,a.startOfWeek)),d[0]<this.min&&
116
+ d.shift();else for(b=this.min+(b[0]-this.min)%c;b<=this.max;b+=c)d.push(b);return d},adjustForMinRange:function(){var a=this.options,b=this.min,c=this.max,d,e=this.dataMax-this.dataMin>=this.minRange,f,g,h,i,j;if(this.isXAxis&&this.minRange===t&&!this.isLog)r(a.min)||r(a.max)?this.minRange=null:(p(this.series,function(a){i=a.xData;for(g=j=a.xIncrement?1:i.length-1;g>0;g--)if(h=i[g]-i[g-1],f===t||h<f)f=h}),this.minRange=C(f*5,this.dataMax-this.dataMin));if(c-b<this.minRange){var k=this.minRange;d=
117
+ (k-c+b)/2;d=[b-d,m(a.min,b-d)];if(e)d[2]=this.dataMin;b=Ba(d);c=[b+k,m(a.max,b+k)];if(e)c[2]=this.dataMax;c=Na(c);c-b<k&&(d[0]=c-k,d[1]=m(a.min,c-k),b=Ba(d))}this.min=b;this.max=c},setAxisTranslation:function(a){var b=this,c=b.max-b.min,d=b.axisPointRange||0,e,f=0,g=0,h=b.linkedParent,i=!!b.categories,j=b.transA;if(b.isXAxis||i||d)h?(f=h.minPointOffset,g=h.pointRangePadding):p(b.series,function(a){var h=i?1:b.isXAxis?a.pointRange:b.axisPointRange||0,j=a.options.pointPlacement,n=a.closestPointRange;
118
+ h>c&&(h=0);d=v(d,h);f=v(f,Fa(j)?0:h/2);g=v(g,j==="on"?0:h);!a.noSharedTooltip&&r(n)&&(e=r(e)?C(e,n):n)}),h=b.ordinalSlope&&e?b.ordinalSlope/e:1,b.minPointOffset=f*=h,b.pointRangePadding=g*=h,b.pointRange=C(d,c),b.closestPointRange=e;if(a)b.oldTransA=j;b.translationSlope=b.transA=j=b.len/(c+g||1);b.transB=b.horiz?b.left:b.bottom;b.minPixelPadding=j*f},setTickPositions:function(a){var b=this,c=b.chart,d=b.options,e=b.isLog,f=b.isDatetimeAxis,g=b.isXAxis,h=b.isLinked,i=b.options.tickPositioner,j=d.maxPadding,
119
+ k=d.minPadding,l=d.tickInterval,o=d.minTickInterval,n=d.tickPixelInterval,s,$=b.categories;h?(b.linkedParent=c[b.coll][d.linkedTo],c=b.linkedParent.getExtremes(),b.min=m(c.min,c.dataMin),b.max=m(c.max,c.dataMax),d.type!==b.linkedParent.options.type&&ra(11,1)):(b.min=m(b.userMin,d.min,b.dataMin),b.max=m(b.userMax,d.max,b.dataMax));if(e)!a&&C(b.min,m(b.dataMin,b.min))<=0&&ra(10,1),b.min=da(za(b.min)),b.max=da(za(b.max));if(b.range&&r(b.max))b.userMin=b.min=v(b.min,b.max-b.range),b.userMax=b.max,b.range=
120
+ null;b.beforePadding&&b.beforePadding();b.adjustForMinRange();if(!$&&!b.axisPointRange&&!b.usePercentage&&!h&&r(b.min)&&r(b.max)&&(c=b.max-b.min)){if(!r(d.min)&&!r(b.userMin)&&k&&(b.dataMin<0||!b.ignoreMinPadding))b.min-=c*k;if(!r(d.max)&&!r(b.userMax)&&j&&(b.dataMax>0||!b.ignoreMaxPadding))b.max+=c*j}if(ha(d.floor))b.min=v(b.min,d.floor);if(ha(d.ceiling))b.max=C(b.max,d.ceiling);b.min===b.max||b.min===void 0||b.max===void 0?b.tickInterval=1:h&&!l&&n===b.linkedParent.options.tickPixelInterval?b.tickInterval=
121
+ b.linkedParent.tickInterval:(b.tickInterval=m(l,$?1:(b.max-b.min)*n/v(b.len,n)),!r(l)&&b.len<n&&!this.isRadial&&!this.isLog&&!$&&d.startOnTick&&d.endOnTick&&(s=!0,b.tickInterval/=4));g&&!a&&p(b.series,function(a){a.processData(b.min!==b.oldMin||b.max!==b.oldMax)});b.setAxisTranslation(!0);b.beforeSetTickPositions&&b.beforeSetTickPositions();if(b.postProcessTickInterval)b.tickInterval=b.postProcessTickInterval(b.tickInterval);if(b.pointRange)b.tickInterval=v(b.pointRange,b.tickInterval);if(!l&&b.tickInterval<
122
+ o)b.tickInterval=o;if(!f&&!e&&!l)b.tickInterval=nb(b.tickInterval,null,mb(b.tickInterval),d);b.minorTickInterval=d.minorTickInterval==="auto"&&b.tickInterval?b.tickInterval/5:d.minorTickInterval;b.tickPositions=a=d.tickPositions?[].concat(d.tickPositions):i&&i.apply(b,[b.min,b.max]);if(!a)!b.ordinalPositions&&(b.max-b.min)/b.tickInterval>v(2*b.len,200)&&ra(19,!0),a=f?b.getTimeTicks(b.normalizeTimeTickInterval(b.tickInterval,d.units),b.min,b.max,d.startOfWeek,b.ordinalPositions,b.closestPointRange,
123
+ !0):e?b.getLogTickPositions(b.tickInterval,b.min,b.max):b.getLinearTickPositions(b.tickInterval,b.min,b.max),s&&a.splice(1,a.length-2),b.tickPositions=a;if(!h)e=a[0],f=a[a.length-1],h=b.minPointOffset||0,d.startOnTick?b.min=e:b.min-h>e&&a.shift(),d.endOnTick?b.max=f:b.max+h<f&&a.pop(),a.length===1&&(d=M(b.max)>1E13?1:0.001,b.min-=d,b.max+=d)},setMaxTicks:function(){var a=this.chart,b=a.maxTicks||{},c=this.tickPositions,d=this._maxTicksKey=[this.coll,this.pos,this.len].join("-");if(!this.isLinked&&
124
+ !this.isDatetimeAxis&&c&&c.length>(b[d]||0)&&this.options.alignTicks!==!1)b[d]=c.length;a.maxTicks=b},adjustTickAmount:function(){var a=this._maxTicksKey,b=this.tickPositions,c=this.chart.maxTicks;if(c&&c[a]&&!this.isDatetimeAxis&&!this.categories&&!this.isLinked&&this.options.alignTicks!==!1&&this.min!==t){var d=this.tickAmount,e=b.length;this.tickAmount=a=c[a];if(e<a){for(;b.length<a;)b.push(da(b[b.length-1]+this.tickInterval));this.transA*=(e-1)/(a-1);this.max=b[b.length-1]}if(r(d)&&a!==d)this.isDirty=
125
+ !0}},setScale:function(){var a=this.stacks,b,c,d,e;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();e=this.len!==this.oldAxisLength;p(this.series,function(a){if(a.isDirtyData||a.isDirty||a.xAxis.isDirty)d=!0});if(e||d||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax){if(!this.isXAxis)for(b in a)for(c in a[b])a[b][c].total=null,a[b][c].cum=0;this.forceRedraw=!1;this.getSeriesExtremes();this.setTickPositions();this.oldUserMin=
126
+ this.userMin;this.oldUserMax=this.userMax;if(!this.isDirty)this.isDirty=e||this.min!==this.oldMin||this.max!==this.oldMax}else if(!this.isXAxis){if(this.oldStacks)a=this.stacks=this.oldStacks;for(b in a)for(c in a[b])a[b][c].cum=a[b][c].total}this.setMaxTicks()},setExtremes:function(a,b,c,d,e){var f=this,g=f.chart,c=m(c,!0),e=q(e,{min:a,max:b});D(f,"setExtremes",e,function(){f.userMin=a;f.userMax=b;f.eventArgs=e;f.isDirtyExtremes=!0;c&&g.redraw(d)})},zoom:function(a,b){var c=this.dataMin,d=this.dataMax,
127
+ e=this.options;this.allowZoomOutside||(r(c)&&a<=C(c,m(e.min,c))&&(a=t),r(d)&&b>=v(d,m(e.max,d))&&(b=t));this.displayBtn=a!==t||b!==t;this.setExtremes(a,b,!1,t,{trigger:"zoom"});return!0},setAxisSize:function(){var a=this.chart,b=this.options,c=b.offsetLeft||0,d=this.horiz,e=m(b.width,a.plotWidth-c+(b.offsetRight||0)),f=m(b.height,a.plotHeight),g=m(b.top,a.plotTop),b=m(b.left,a.plotLeft+c),c=/%$/;c.test(f)&&(f=parseInt(f,10)/100*a.plotHeight);c.test(g)&&(g=parseInt(g,10)/100*a.plotHeight+a.plotTop);
128
+ this.left=b;this.top=g;this.width=e;this.height=f;this.bottom=a.chartHeight-f-g;this.right=a.chartWidth-e-b;this.len=v(d?e:f,0);this.pos=d?b:g},getExtremes:function(){var a=this.isLog;return{min:a?da(ia(this.min)):this.min,max:a?da(ia(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,c=b?ia(this.min):this.min,b=b?ia(this.max):this.max;c>a||a===null?a=c:b<a&&(a=b);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){a=
129
+ (m(a,0)-this.side*90+720)%360;return a>15&&a<165?"right":a>195&&a<345?"left":"center"},getOffset:function(){var a=this,b=a.chart,c=b.renderer,d=a.options,e=a.tickPositions,f=a.ticks,g=a.horiz,h=a.side,i=b.inverted?[1,0,3,2][h]:h,j,k=0,l,o=0,n=d.title,s=d.labels,$=0,J=b.axisOffset,L=b.clipOffset,x=[-1,1,1,-1][h],q,u=1,w=m(s.maxStaggerLines,5),y,z,A,B,na=h===2?c.fontMetrics(s.style.fontSize).b:0;a.hasData=j=a.hasVisibleSeries||r(a.min)&&r(a.max)&&!!e;a.showAxis=b=j||m(d.showEmpty,!0);a.staggerLines=
130
+ a.horiz&&s.staggerLines;if(!a.axisGroup)a.gridGroup=c.g("grid").attr({zIndex:d.gridZIndex||1}).add(),a.axisGroup=c.g("axis").attr({zIndex:d.zIndex||2}).add(),a.labelGroup=c.g("axis-labels").attr({zIndex:s.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels").add();if(j||a.isLinked){a.labelAlign=m(s.align||a.autoLabelAlign(s.rotation));p(e,function(b){f[b]?f[b].addLabel():f[b]=new Sa(a,b)});if(a.horiz&&!a.staggerLines&&w&&!s.rotation){for(q=a.reversed?[].concat(e).reverse():e;u<w;){j=
131
+ [];y=!1;for(s=0;s<q.length;s++)z=q[s],A=(A=f[z].label&&f[z].label.getBBox())?A.width:0,B=s%u,A&&(z=a.translate(z),j[B]!==t&&z<j[B]&&(y=!0),j[B]=z+A);if(y)u++;else break}if(u>1)a.staggerLines=u}p(e,function(b){if(h===0||h===2||{1:"left",3:"right"}[h]===a.labelAlign)$=v(f[b].getLabelSize(),$)});if(a.staggerLines)$*=a.staggerLines,a.labelOffset=$}else for(q in f)f[q].destroy(),delete f[q];if(n&&n.text&&n.enabled!==!1){if(!a.axisTitle)a.axisTitle=c.text(n.text,0,0,n.useHTML).attr({zIndex:7,rotation:n.rotation||
132
+ 0,align:n.textAlign||{low:"left",middle:"center",high:"right"}[n.align]}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(n.style).add(a.axisGroup),a.axisTitle.isNew=!0;if(b)k=a.axisTitle.getBBox()[g?"height":"width"],o=m(n.margin,g?5:10),l=n.offset;a.axisTitle[b?"show":"hide"]()}a.offset=x*m(d.offset,J[h]);a.axisTitleMargin=m(l,$+o+($&&x*d.labels[g?"y":"x"]-na));J[h]=v(J[h],a.axisTitleMargin+k+x*a.offset);L[i]=v(L[i],T(d.lineWidth/2)*2)},getLinePath:function(a){var b=this.chart,c=this.opposite,
133
+ d=this.offset,e=this.horiz,f=this.left+(c?this.width:0)+d,d=b.chartHeight-this.bottom-(c?this.height:0)+d;c&&(a*=-1);return b.renderer.crispLine(["M",e?this.left:f,e?d:this.top,"L",e?b.chartWidth-this.right:f,e?d:b.chartHeight-this.bottom],a)},getTitlePosition:function(){var a=this.horiz,b=this.left,c=this.top,d=this.len,e=this.options.title,f=a?b:c,g=this.opposite,h=this.offset,i=z(e.style.fontSize||12),d={low:f+(a?0:d),middle:f+d/2,high:f+(a?d:0)}[e.align],b=(a?c+this.height:b)+(a?1:-1)*(g?-1:1)*
134
+ this.axisTitleMargin+(this.side===2?i:0);return{x:a?d:b+(g?this.width:0)+h+(e.x||0),y:a?b-(g?this.height:0)+h:d+(e.y||0)}},render:function(){var a=this,b=a.horiz,c=a.reversed,d=a.chart,e=d.renderer,f=a.options,g=a.isLog,h=a.isLinked,i=a.tickPositions,j,k=a.axisTitle,l=a.ticks,o=a.minorTicks,n=a.alternateBands,s=f.stackLabels,m=f.alternateGridColor,J=a.tickmarkOffset,L=f.lineWidth,x=d.hasRendered&&r(a.oldMin)&&!isNaN(a.oldMin),q=a.hasData,v=a.showAxis,u,w=f.labels.overflow,y=a.justifyLabels=b&&w!==
135
+ !1,z;a.labelEdge.length=0;a.justifyToPlot=w==="justify";p([l,o,n],function(a){for(var b in a)a[b].isActive=!1});if(q||h)if(a.minorTickInterval&&!a.categories&&p(a.getMinorTickPositions(),function(b){o[b]||(o[b]=new Sa(a,b,"minor"));x&&o[b].isNew&&o[b].render(null,!0);o[b].render(null,!1,1)}),i.length&&(j=i.slice(),(b&&c||!b&&!c)&&j.reverse(),y&&(j=j.slice(1).concat([j[0]])),p(j,function(b,c){y&&(c=c===j.length-1?0:c+1);if(!h||b>=a.min&&b<=a.max)l[b]||(l[b]=new Sa(a,b)),x&&l[b].isNew&&l[b].render(c,
136
+ !0,0.1),l[b].render(c,!1,1)}),J&&a.min===0&&(l[-1]||(l[-1]=new Sa(a,-1,null,!0)),l[-1].render(-1))),m&&p(i,function(b,c){if(c%2===0&&b<a.max)n[b]||(n[b]=new R.PlotLineOrBand(a)),u=b+J,z=i[c+1]!==t?i[c+1]+J:a.max,n[b].options={from:g?ia(u):u,to:g?ia(z):z,color:m},n[b].render(),n[b].isActive=!0}),!a._addedPlotLB)p((f.plotLines||[]).concat(f.plotBands||[]),function(b){a.addPlotBandOrLine(b)}),a._addedPlotLB=!0;p([l,o,n],function(a){var b,c,e=[],f=va?va.duration||500:0,g=function(){for(c=e.length;c--;)a[e[c]]&&
137
+ !a[e[c]].isActive&&(a[e[c]].destroy(),delete a[e[c]])};for(b in a)if(!a[b].isActive)a[b].render(b,!1,0),a[b].isActive=!1,e.push(b);a===n||!d.hasRendered||!f?g():f&&setTimeout(g,f)});if(L)b=a.getLinePath(L),a.axisLine?a.axisLine.animate({d:b}):a.axisLine=e.path(b).attr({stroke:f.lineColor,"stroke-width":L,zIndex:7}).add(a.axisGroup),a.axisLine[v?"show":"hide"]();if(k&&v)k[k.isNew?"attr":"animate"](a.getTitlePosition()),k.isNew=!1;s&&s.enabled&&a.renderStackTotals();a.isDirty=!1},redraw:function(){var a=
138
+ this.chart.pointer;a&&a.reset(!0);this.render();p(this.plotLinesAndBands,function(a){a.render()});p(this.series,function(a){a.isDirty=!0})},destroy:function(a){var b=this,c=b.stacks,d,e=b.plotLinesAndBands;a||W(b);for(d in c)Oa(c[d]),c[d]=null;p([b.ticks,b.minorTicks,b.alternateBands],function(a){Oa(a)});for(a=e.length;a--;)e[a].destroy();p("stackTotalGroup,axisLine,axisTitle,axisGroup,cross,gridGroup,labelGroup".split(","),function(a){b[a]&&(b[a]=b[a].destroy())});this.cross&&this.cross.destroy()},
139
+ drawCrosshair:function(a,b){if(this.crosshair)if((r(b)||!m(this.crosshair.snap,!0))===!1)this.hideCrosshair();else{var c,d=this.crosshair,e=d.animation;m(d.snap,!0)?r(b)&&(c=this.chart.inverted!=this.horiz?b.plotX:this.len-b.plotY):c=this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos;c=this.isRadial?this.getPlotLinePath(this.isXAxis?b.x:m(b.stackY,b.y)):this.getPlotLinePath(null,null,null,null,c);if(c===null)this.hideCrosshair();else if(this.cross)this.cross.attr({visibility:"visible"})[e?"animate":
140
+ "attr"]({d:c},e);else{e={"stroke-width":d.width||1,stroke:d.color||"#C0C0C0",zIndex:d.zIndex||2};if(d.dashStyle)e.dashstyle=d.dashStyle;this.cross=this.chart.renderer.path(c).attr(e).add()}}},hideCrosshair:function(){this.cross&&this.cross.hide()}};q(la.prototype,{getPlotBandPath:function(a,b){var c=this.getPlotLinePath(b),d=this.getPlotLinePath(a);d&&c?d.push(c[4],c[5],c[1],c[2]):d=null;return d},addPlotBand:function(a){this.addPlotBandOrLine(a,"plotBands")},addPlotLine:function(a){this.addPlotBandOrLine(a,
141
+ "plotLines")},addPlotBandOrLine:function(a,b){var c=(new R.PlotLineOrBand(this,a)).render(),d=this.userOptions;c&&(b&&(d[b]=d[b]||[],d[b].push(a)),this.plotLinesAndBands.push(c));return c},removePlotBandOrLine:function(a){for(var b=this.plotLinesAndBands,c=this.options,d=this.userOptions,e=b.length;e--;)b[e].id===a&&b[e].destroy();p([c.plotLines||[],d.plotLines||[],c.plotBands||[],d.plotBands||[]],function(b){for(e=b.length;e--;)b[e].id===a&&ja(b,b[e])})}});la.prototype.getTimeTicks=function(a,b,
142
+ c,d){var e=[],f={},g=E.global.useUTC,h,i=new Date(b-Ra),j=a.unitRange,k=a.count;if(r(b)){j>=A.second&&(i.setMilliseconds(0),i.setSeconds(j>=A.minute?0:k*T(i.getSeconds()/k)));if(j>=A.minute)i[Db](j>=A.hour?0:k*T(i[pb]()/k));if(j>=A.hour)i[Eb](j>=A.day?0:k*T(i[qb]()/k));if(j>=A.day)i[sb](j>=A.month?1:k*T(i[Xa]()/k));j>=A.month&&(i[Fb](j>=A.year?0:k*T(i[fb]()/k)),h=i[gb]());j>=A.year&&(h-=h%k,i[Gb](h));if(j===A.week)i[sb](i[Xa]()-i[rb]()+m(d,1));b=1;Ra&&(i=new Date(i.getTime()+Ra));h=i[gb]();for(var d=
143
+ i.getTime(),l=i[fb](),o=i[Xa](),n=g?Ra:(864E5+i.getTimezoneOffset()*6E4)%864E5;d<c;)e.push(d),j===A.year?d=eb(h+b*k,0):j===A.month?d=eb(h,l+b*k):!g&&(j===A.day||j===A.week)?d=eb(h,l,o+b*k*(j===A.day?1:7)):d+=j*k,b++;e.push(d);p(vb(e,function(a){return j<=A.hour&&a%A.day===n}),function(a){f[a]="day"})}e.info=q(a,{higherRanks:f,totalRange:j*k});return e};la.prototype.normalizeTimeTickInterval=function(a,b){var c=b||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",
144
+ [1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],d=c[c.length-1],e=A[d[0]],f=d[1],g;for(g=0;g<c.length;g++)if(d=c[g],e=A[d[0]],f=d[1],c[g+1]&&a<=(e*f[f.length-1]+A[c[g+1][0]])/2)break;e===A.year&&a<5*e&&(f=[1,2,5]);c=nb(a/e,f,d[0]==="year"?v(mb(a/e),1):1);return{unitRange:e,count:c,unitName:d[0]}};la.prototype.getLogTickPositions=function(a,b,c,d){var e=this.options,f=this.len,g=[];if(!d)this._minorAutoInterval=null;if(a>=0.5)a=u(a),g=this.getLinearTickPositions(a,
145
+ b,c);else if(a>=0.08)for(var f=T(b),h,i,j,k,l,e=a>0.3?[1,2,4]:a>0.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];f<c+1&&!l;f++){i=e.length;for(h=0;h<i&&!l;h++)j=za(ia(f)*e[h]),j>b&&(!d||k<=c)&&g.push(k),k>c&&(l=!0),k=j}else if(b=ia(b),c=ia(c),a=e[d?"minorTickInterval":"tickInterval"],a=m(a==="auto"?null:a,this._minorAutoInterval,(c-b)*(e.tickPixelInterval/(d?5:1))/((d?f/this.tickPositions.length:f)||1)),a=nb(a,null,mb(a)),g=Ua(this.getLinearTickPositions(a,b,c),za),!d)this._minorAutoInterval=a/5;if(!d)this.tickInterval=
146
+ a;return g};var Mb=R.Tooltip=function(){this.init.apply(this,arguments)};Mb.prototype={init:function(a,b){var c=b.borderWidth,d=b.style,e=z(d.padding);this.chart=a;this.options=b;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.label=a.renderer.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,"tooltip").attr({padding:e,fill:b.backgroundColor,"stroke-width":c,r:b.borderRadius,zIndex:8}).css(d).css({padding:0}).add().attr({y:-9999});fa||this.label.shadow(b.shadow);this.shared=b.shared},
147
+ destroy:function(){if(this.label)this.label=this.label.destroy();clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,b,c,d){var e=this,f=e.now,g=e.options.animation!==!1&&!e.isHidden,h=e.followPointer||e.len>1;q(f,{x:g?(2*f.x+a)/3:a,y:g?(f.y+b)/2:b,anchorX:h?t:g?(2*f.anchorX+c)/3:c,anchorY:h?t:g?(f.anchorY+d)/2:d});e.label.attr(f);if(g&&(M(a-f.x)>1||M(b-f.y)>1))clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){e&&e.move(a,b,c,d)},32)},hide:function(){var a=
148
+ this,b;clearTimeout(this.hideTimer);if(!this.isHidden)b=this.chart.hoverPoints,this.hideTimer=setTimeout(function(){a.label.fadeOut();a.isHidden=!0},m(this.options.hideDelay,500)),b&&p(b,function(a){a.setState()}),this.chart.hoverPoints=null},getAnchor:function(a,b){var c,d=this.chart,e=d.inverted,f=d.plotTop,g=0,h=0,i,a=qa(a);c=a[0].tooltipPos;this.followPointer&&b&&(b.chartX===t&&(b=d.pointer.normalize(b)),c=[b.chartX-d.plotLeft,b.chartY-f]);c||(p(a,function(a){i=a.series.yAxis;g+=a.plotX;h+=(a.plotLow?
149
+ (a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&i?i.top-f:0)}),g/=a.length,h/=a.length,c=[e?d.plotWidth-h:g,this.shared&&!e&&a.length>1&&b?b.chartY-f:e?d.plotHeight-g:h]);return Ua(c,u)},getPosition:function(a,b,c){var d=this.chart,e=this.distance,f={},g,h=["y",d.chartHeight,b,c.plotY+d.plotTop],i=["x",d.chartWidth,a,c.plotX+d.plotLeft],j=c.ttBelow||d.inverted&&!c.negative||!d.inverted&&c.negative,k=function(a,b,c,d){var g=c<d-e,b=d+e+c<b,c=d-e-c;d+=e;if(j&&b)f[a]=d;else if(!j&&g)f[a]=c;else if(g)f[a]=c;else if(b)f[a]=
150
+ d;else return!1},l=function(a,b,c,d){if(d<e||d>b-e)return!1;else f[a]=d<c/2?1:d>b-c/2?b-c-2:d-c/2},o=function(a){var b=h;h=i;i=b;g=a},n=function(){k.apply(0,h)!==!1?l.apply(0,i)===!1&&!g&&(o(!0),n()):g?f.x=f.y=0:(o(!0),n())};(d.inverted||this.len>1)&&o();n();return f},defaultFormatter:function(a){var b=this.points||qa(this),c=b[0].series,d;d=[a.tooltipHeaderFormatter(b[0])];p(b,function(a){c=a.series;d.push(c.tooltipFormatter&&c.tooltipFormatter(a)||a.point.tooltipFormatter(c.tooltipOptions.pointFormat))});
151
+ d.push(a.options.footerFormat||"");return d.join("")},refresh:function(a,b){var c=this.chart,d=this.label,e=this.options,f,g,h={},i,j=[];i=e.formatter||this.defaultFormatter;var h=c.hoverPoints,k,l=this.shared;clearTimeout(this.hideTimer);this.followPointer=qa(a)[0].series.tooltipOptions.followPointer;g=this.getAnchor(a,b);f=g[0];g=g[1];l&&(!a.series||!a.series.noSharedTooltip)?(c.hoverPoints=a,h&&p(h,function(a){a.setState()}),p(a,function(a){a.setState("hover");j.push(a.getLabelConfig())}),h={x:a[0].category,
152
+ y:a[0].y},h.points=j,this.len=j.length,a=a[0]):h=a.getLabelConfig();i=i.call(h,this);h=a.series;this.distance=m(h.tooltipOptions.distance,16);i===!1?this.hide():(this.isHidden&&(bb(d),d.attr("opacity",1).show()),d.attr({text:i}),k=e.borderColor||a.color||h.color||"#606060",d.attr({stroke:k}),this.updatePosition({plotX:f,plotY:g,negative:a.negative,ttBelow:a.ttBelow}),this.isHidden=!1);D(c,"tooltipRefresh",{text:i,x:f+c.plotLeft,y:g+c.plotTop,borderColor:k})},updatePosition:function(a){var b=this.chart,
153
+ c=this.label,c=(this.options.positioner||this.getPosition).call(this,c.width,c.height,a);this.move(u(c.x),u(c.y),a.plotX+b.plotLeft,a.plotY+b.plotTop)},tooltipHeaderFormatter:function(a){var b=a.series,c=b.tooltipOptions,d=c.dateTimeLabelFormats,e=c.xDateFormat,f=b.xAxis,g=f&&f.options.type==="datetime"&&ha(a.key),c=c.headerFormat,f=f&&f.closestPointRange,h;if(g&&!e){if(f)for(h in A){if(A[h]>=f||A[h]<=A.day&&a.key%A[h]>0){e=d[h];break}}else e=d.day;e=e||d.year}g&&e&&(c=c.replace("{point.key}","{point.key:"+
154
+ e+"}"));return Ia(c,{point:a,series:b})}};var oa;$a=y.documentElement.ontouchstart!==t;var Wa=R.Pointer=function(a,b){this.init(a,b)};Wa.prototype={init:function(a,b){var c=b.chart,d=c.events,e=fa?"":c.zoomType,c=a.inverted,f;this.options=b;this.chart=a;this.zoomX=f=/x/.test(e);this.zoomY=e=/y/.test(e);this.zoomHor=f&&!c||e&&c;this.zoomVert=e&&!c||f&&c;this.hasZoom=f||e;this.runChartClick=d&&!!d.click;this.pinchDown=[];this.lastValidTouch={};if(R.Tooltip&&b.tooltip.enabled)a.tooltip=new Mb(a,b.tooltip),
155
+ this.followTouchMove=b.tooltip.followTouchMove;this.setDOMEvents()},normalize:function(a,b){var c,d,a=a||window.event,a=Sb(a);if(!a.target)a.target=a.srcElement;d=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a;if(!b)this.chartPosition=b=Rb(this.chart.container);d.pageX===t?(c=v(a.x,a.clientX-b.left),d=a.y):(c=d.pageX-b.left,d=d.pageY-b.top);return q(a,{chartX:u(c),chartY:u(d)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};p(this.chart.axes,function(c){b[c.isXAxis?"xAxis":
156
+ "yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})});return b},getIndex:function(a){var b=this.chart;return b.inverted?b.plotHeight+b.plotTop-a.chartY:a.chartX-b.plotLeft},runPointActions:function(a){var b=this.chart,c=b.series,d=b.tooltip,e,f,g=b.hoverPoint,h=b.hoverSeries,i,j,k=b.chartWidth,l=this.getIndex(a);if(d&&this.options.tooltip.shared&&(!h||!h.noSharedTooltip)){f=[];i=c.length;for(j=0;j<i;j++)if(c[j].visible&&c[j].options.enableMouseTracking!==!1&&!c[j].noSharedTooltip&&
157
+ c[j].singularTooltips!==!0&&c[j].tooltipPoints.length&&(e=c[j].tooltipPoints[l])&&e.series)e._dist=M(l-e.clientX),k=C(k,e._dist),f.push(e);for(i=f.length;i--;)f[i]._dist>k&&f.splice(i,1);if(f.length&&f[0].clientX!==this.hoverX)d.refresh(f,a),this.hoverX=f[0].clientX}c=h&&h.tooltipOptions.followPointer;if(h&&h.tracker&&!c){if((e=h.tooltipPoints[l])&&e!==g)e.onMouseOver(a)}else d&&c&&!d.isHidden&&(h=d.getAnchor([{}],a),d.updatePosition({plotX:h[0],plotY:h[1]}));if(d&&!this._onDocumentMouseMove)this._onDocumentMouseMove=
158
+ function(a){if(V[oa])V[oa].pointer.onDocumentMouseMove(a)},K(y,"mousemove",this._onDocumentMouseMove);p(b.axes,function(b){b.drawCrosshair(a,m(e,g))})},reset:function(a){var b=this.chart,c=b.hoverSeries,d=b.hoverPoint,e=b.tooltip,f=e&&e.shared?b.hoverPoints:d;(a=a&&e&&f)&&qa(f)[0].plotX===t&&(a=!1);if(a)e.refresh(f),d&&d.setState(d.state,!0);else{if(d)d.onMouseOut();if(c)c.onMouseOut();e&&e.hide();if(this._onDocumentMouseMove)W(y,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null;
159
+ p(b.axes,function(a){a.hideCrosshair()});this.hoverX=null}},scaleGroups:function(a,b){var c=this.chart,d;p(c.series,function(e){d=a||e.getPlotBox();e.xAxis&&e.xAxis.zoomEnabled&&(e.group.attr(d),e.markerGroup&&(e.markerGroup.attr(d),e.markerGroup.clip(b?c.clipRect:null)),e.dataLabelsGroup&&e.dataLabelsGroup.attr(d))});c.clipRect.attr(b||c.clipBox)},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type;b.cancelClick=!1;b.mouseDownX=this.mouseDownX=a.chartX;b.mouseDownY=this.mouseDownY=a.chartY},
160
+ drag:function(a){var b=this.chart,c=b.options.chart,d=a.chartX,e=a.chartY,f=this.zoomHor,g=this.zoomVert,h=b.plotLeft,i=b.plotTop,j=b.plotWidth,k=b.plotHeight,l,o=this.mouseDownX,n=this.mouseDownY;d<h?d=h:d>h+j&&(d=h+j);e<i?e=i:e>i+k&&(e=i+k);this.hasDragged=Math.sqrt(Math.pow(o-d,2)+Math.pow(n-e,2));if(this.hasDragged>10){l=b.isInsidePlot(o-h,n-i);if(b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&l&&!this.selectionMarker)this.selectionMarker=b.renderer.rect(h,i,f?1:j,g?1:k,0).attr({fill:c.selectionMarkerFill||
161
+ "rgba(69,114,167,0.25)",zIndex:7}).add();this.selectionMarker&&f&&(d-=o,this.selectionMarker.attr({width:M(d),x:(d>0?0:d)+o}));this.selectionMarker&&g&&(d=e-n,this.selectionMarker.attr({height:M(d),y:(d>0?0:d)+n}));l&&!this.selectionMarker&&c.panning&&b.pan(a,c.panning)}},drop:function(a){var b=this.chart,c=this.hasPinched;if(this.selectionMarker){var d={xAxis:[],yAxis:[],originalEvent:a.originalEvent||a},a=this.selectionMarker,e=a.attr?a.attr("x"):a.x,f=a.attr?a.attr("y"):a.y,g=a.attr?a.attr("width"):
162
+ a.width,h=a.attr?a.attr("height"):a.height,i;if(this.hasDragged||c)p(b.axes,function(a){if(a.zoomEnabled){var b=a.horiz,c=a.toValue(b?e:f),b=a.toValue(b?e+g:f+h);!isNaN(c)&&!isNaN(b)&&(d[a.coll].push({axis:a,min:C(c,b),max:v(c,b)}),i=!0)}}),i&&D(b,"selection",d,function(a){b.zoom(q(a,c?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();c&&this.scaleGroups()}if(b)G(b.container,{cursor:b._cursor}),b.cancelClick=this.hasDragged>10,b.mouseIsDown=this.hasDragged=this.hasPinched=
163
+ !1,this.pinchDown=[]},onContainerMouseDown:function(a){a=this.normalize(a);a.preventDefault&&a.preventDefault();this.dragStart(a)},onDocumentMouseUp:function(a){V[oa]&&V[oa].pointer.drop(a)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition,d=b.hoverSeries,a=this.normalize(a,c);c&&d&&!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&this.reset()},onContainerMouseLeave:function(){var a=V[oa];if(a)a.pointer.reset(),a.pointer.chartPosition=
164
+ null},onContainerMouseMove:function(a){var b=this.chart;oa=b.index;a=this.normalize(a);b.mouseIsDown==="mousedown"&&this.drag(a);(this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop))&&!b.openMenu&&this.runPointActions(a)},inClass:function(a,b){for(var c;a;){if(c=H(a,"class"))if(c.indexOf(b)!==-1)return!0;else if(c.indexOf("highcharts-container")!==-1)return!1;a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries,c=(a=a.relatedTarget||
165
+ a.toElement)&&a.point&&a.point.series;if(b&&!b.options.stickyTracking&&!this.inClass(a,"highcharts-tooltip")&&c!==b)b.onMouseOut()},onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop,a=this.normalize(a);a.cancelBubble=!0;b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(D(c.series,"click",q(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(q(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&D(b,"click",a)))},setDOMEvents:function(){var a=
166
+ this,b=a.chart.container;b.onmousedown=function(b){a.onContainerMouseDown(b)};b.onmousemove=function(b){a.onContainerMouseMove(b)};b.onclick=function(b){a.onContainerClick(b)};K(b,"mouseleave",a.onContainerMouseLeave);ab===1&&K(y,"mouseup",a.onDocumentMouseUp);if($a)b.ontouchstart=function(b){a.onContainerTouchStart(b)},b.ontouchmove=function(b){a.onContainerTouchMove(b)},ab===1&&K(y,"touchend",a.onDocumentTouchEnd)},destroy:function(){var a;W(this.chart.container,"mouseleave",this.onContainerMouseLeave);
167
+ ab||(W(y,"mouseup",this.onDocumentMouseUp),W(y,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(a in this)this[a]=null}};q(R.Pointer.prototype,{pinchTranslate:function(a,b,c,d,e,f){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,a,b,c,d,e,f);(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,a,b,c,d,e,f)},pinchTranslateDirection:function(a,b,c,d,e,f,g,h){var i=this.chart,j=a?"x":"y",k=a?"X":"Y",l="chart"+k,o=a?"width":"height",n=i["plot"+(a?
168
+ "Left":"Top")],s,m,p=h||1,q=i.inverted,x=i.bounds[a?"h":"v"],r=b.length===1,v=b[0][l],u=c[0][l],t=!r&&b[1][l],w=!r&&c[1][l],y,c=function(){!r&&M(v-t)>20&&(p=h||M(u-w)/M(v-t));m=(n-u)/p+v;s=i["plot"+(a?"Width":"Height")]/p};c();b=m;b<x.min?(b=x.min,y=!0):b+s>x.max&&(b=x.max-s,y=!0);y?(u-=0.8*(u-g[j][0]),r||(w-=0.8*(w-g[j][1])),c()):g[j]=[u,w];q||(f[j]=m-n,f[o]=s);f=q?1/p:p;e[o]=s;e[j]=b;d[q?a?"scaleY":"scaleX":"scale"+k]=p;d["translate"+k]=f*n+(u-f*v)},pinch:function(a){var b=this,c=b.chart,d=b.pinchDown,
169
+ e=b.followTouchMove,f=a.touches,g=f.length,h=b.lastValidTouch,i=b.hasZoom,j=b.selectionMarker,k={},l=g===1&&(b.inClass(a.target,"highcharts-tracker")&&c.runTrackerClick||c.runChartClick),o={};(i||e)&&!l&&a.preventDefault();Ua(f,function(a){return b.normalize(a)});if(a.type==="touchstart")p(f,function(a,b){d[b]={chartX:a.chartX,chartY:a.chartY}}),h.x=[d[0].chartX,d[1]&&d[1].chartX],h.y=[d[0].chartY,d[1]&&d[1].chartY],p(c.axes,function(a){if(a.zoomEnabled){var b=c.bounds[a.horiz?"h":"v"],d=a.minPixelPadding,
170
+ e=a.toPixels(a.dataMin),f=a.toPixels(a.dataMax),g=C(e,f),e=v(e,f);b.min=C(a.pos,g-d);b.max=v(a.pos+a.len,e+d)}});else if(d.length){if(!j)b.selectionMarker=j=q({destroy:sa},c.plotBox);b.pinchTranslate(d,f,k,j,o,h);b.hasPinched=i;b.scaleGroups(k,o);!i&&e&&g===1&&this.runPointActions(b.normalize(a))}},onContainerTouchStart:function(a){var b=this.chart;oa=b.index;a.touches.length===1?(a=this.normalize(a),b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)?(this.runPointActions(a),this.pinch(a)):this.reset()):
171
+ a.touches.length===2&&this.pinch(a)},onContainerTouchMove:function(a){(a.touches.length===1||a.touches.length===2)&&this.pinch(a)},onDocumentTouchEnd:function(a){V[oa]&&V[oa].pointer.drop(a)}});if(I.PointerEvent||I.MSPointerEvent){var ua={},zb=!!I.PointerEvent,Wb=function(){var a,b=[];b.item=function(a){return this[a]};for(a in ua)ua.hasOwnProperty(a)&&b.push({pageX:ua[a].pageX,pageY:ua[a].pageY,target:ua[a].target});return b},Ab=function(a,b,c,d){a=a.originalEvent||a;if((a.pointerType==="touch"||
172
+ a.pointerType===a.MSPOINTER_TYPE_TOUCH)&&V[oa])d(a),d=V[oa].pointer,d[b]({type:c,target:a.currentTarget,preventDefault:sa,touches:Wb()})};q(Wa.prototype,{onContainerPointerDown:function(a){Ab(a,"onContainerTouchStart","touchstart",function(a){ua[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){Ab(a,"onContainerTouchMove","touchmove",function(a){ua[a.pointerId]={pageX:a.pageX,pageY:a.pageY};if(!ua[a.pointerId].target)ua[a.pointerId].target=a.currentTarget})},
173
+ onDocumentPointerUp:function(a){Ab(a,"onContainerTouchEnd","touchend",function(a){delete ua[a.pointerId]})},batchMSEvents:function(a){a(this.chart.container,zb?"pointerdown":"MSPointerDown",this.onContainerPointerDown);a(this.chart.container,zb?"pointermove":"MSPointerMove",this.onContainerPointerMove);a(y,zb?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});Ma(Wa.prototype,"init",function(a,b,c){a.call(this,b,c);(this.hasZoom||this.followTouchMove)&&G(b.container,{"-ms-touch-action":Q,"touch-action":Q})});
174
+ Ma(Wa.prototype,"setDOMEvents",function(a){a.apply(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(K)});Ma(Wa.prototype,"destroy",function(a){this.batchMSEvents(W);a.call(this)})}var lb=R.Legend=function(a,b){this.init(a,b)};lb.prototype={init:function(a,b){var c=this,d=b.itemStyle,e=m(b.padding,8),f=b.itemMarginTop||0;this.options=b;if(b.enabled)c.baseline=z(d.fontSize)+3+f,c.itemStyle=d,c.itemHiddenStyle=w(d,b.itemHiddenStyle),c.itemMarginTop=f,c.padding=e,c.initialItemX=e,c.initialItemY=
175
+ e-5,c.maxItemWidth=0,c.chart=a,c.itemHeight=0,c.lastLineHeight=0,c.symbolWidth=m(b.symbolWidth,16),c.pages=[],c.render(),K(c.chart,"endResize",function(){c.positionCheckboxes()})},colorizeItem:function(a,b){var c=this.options,d=a.legendItem,e=a.legendLine,f=a.legendSymbol,g=this.itemHiddenStyle.color,c=b?c.itemStyle.color:g,h=b?a.legendColor||a.color||"#CCC":g,g=a.options&&a.options.marker,i={fill:h},j;d&&d.css({fill:c,color:c});e&&e.attr({stroke:h});if(f){if(g&&f.isMarker)for(j in i.stroke=h,g=a.convertAttribs(g),
176
+ g)d=g[j],d!==t&&(i[j]=d);f.attr(i)}},positionItem:function(a){var b=this.options,c=b.symbolPadding,b=!b.rtl,d=a._legendItemPos,e=d[0],d=d[1],f=a.checkbox;a.legendGroup&&a.legendGroup.translate(b?e:this.legendWidth-e-2*c-4,d);if(f)f.x=e,f.y=d},destroyItem:function(a){var b=a.checkbox;p(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())});b&&Pa(a.checkbox)},destroy:function(){var a=this.group,b=this.box;if(b)this.box=b.destroy();if(a)this.group=a.destroy()},
177
+ positionCheckboxes:function(a){var b=this.group.alignAttr,c,d=this.clipHeight||this.legendHeight;if(b)c=b.translateY,p(this.allItems,function(e){var f=e.checkbox,g;f&&(g=c+f.y+(a||0)+3,G(f,{left:b.translateX+e.checkboxOffset+f.x-20+"px",top:g+"px",display:g>c-6&&g<c+d-6?"":Q}))})},renderTitle:function(){var a=this.padding,b=this.options.title,c=0;if(b.text){if(!this.title)this.title=this.chart.renderer.label(b.text,a-3,a-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(b.style).add(this.group);
178
+ a=this.title.getBBox();c=a.height;this.offsetWidth=a.width;this.contentGroup.attr({translateY:c})}this.titleHeight=c},renderItem:function(a){var b=this.chart,c=b.renderer,d=this.options,e=d.layout==="horizontal",f=this.symbolWidth,g=d.symbolPadding,h=this.itemStyle,i=this.itemHiddenStyle,j=this.padding,k=e?m(d.itemDistance,20):0,l=!d.rtl,o=d.width,n=d.itemMarginBottom||0,s=this.itemMarginTop,p=this.initialItemX,q=a.legendItem,r=a.series&&a.series.drawLegendSymbol?a.series:a,x=r.options,x=this.createCheckboxForItem&&
179
+ x&&x.showCheckbox,t=d.useHTML;if(!q)a.legendGroup=c.g("legend-item").attr({zIndex:1}).add(this.scrollGroup),r.drawLegendSymbol(this,a),a.legendItem=q=c.text(d.labelFormat?Ia(d.labelFormat,a):d.labelFormatter.call(a),l?f+g:-g,this.baseline,t).css(w(a.visible?h:i)).attr({align:l?"left":"right",zIndex:2}).add(a.legendGroup),this.setItemEvents&&this.setItemEvents(a,q,t,h,i),this.colorizeItem(a,a.visible),x&&this.createCheckboxForItem(a);c=q.getBBox();f=a.checkboxOffset=d.itemWidth||a.legendItemWidth||
180
+ f+g+c.width+k+(x?20:0);this.itemHeight=g=u(a.legendItemHeight||c.height);if(e&&this.itemX-p+f>(o||b.chartWidth-2*j-p-d.x))this.itemX=p,this.itemY+=s+this.lastLineHeight+n,this.lastLineHeight=0;this.maxItemWidth=v(this.maxItemWidth,f);this.lastItemY=s+this.itemY+n;this.lastLineHeight=v(g,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];e?this.itemX+=f:(this.itemY+=s+g+n,this.lastLineHeight=g);this.offsetWidth=o||v((e?this.itemX-p-k:f)+j,this.offsetWidth)},getAllItems:function(){var a=
181
+ [];p(this.chart.series,function(b){var c=b.options;if(m(c.showInLegend,!r(c.linkedTo)?t:!1,!0))a=a.concat(b.legendItems||(c.legendType==="point"?b.data:b))});return a},render:function(){var a=this,b=a.chart,c=b.renderer,d=a.group,e,f,g,h,i=a.box,j=a.options,k=a.padding,l=j.borderWidth,o=j.backgroundColor;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;if(!d)a.group=d=c.g("legend").attr({zIndex:7}).add(),a.contentGroup=c.g().attr({zIndex:1}).add(d),a.scrollGroup=c.g().add(a.contentGroup);
182
+ a.renderTitle();e=a.getAllItems();ob(e,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});j.reversed&&e.reverse();a.allItems=e;a.display=f=!!e.length;p(e,function(b){a.renderItem(b)});g=j.width||a.offsetWidth;h=a.lastItemY+a.lastLineHeight+a.titleHeight;h=a.handleOverflow(h);if(l||o){g+=k;h+=k;if(i){if(g>0&&h>0)i[i.isNew?"attr":"animate"](i.crisp({width:g,height:h})),i.isNew=!1}else a.box=i=c.rect(0,0,g,h,j.borderRadius,l||0).attr({stroke:j.borderColor,
183
+ "stroke-width":l||0,fill:o||Q}).add(d).shadow(j.shadow),i.isNew=!0;i[f?"show":"hide"]()}a.legendWidth=g;a.legendHeight=h;p(e,function(b){a.positionItem(b)});f&&d.align(q({width:g,height:h},j),!0,"spacingBox");b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var b=this,c=this.chart,d=c.renderer,e=this.options,f=e.y,f=c.spacingBox.height+(e.verticalAlign==="top"?-f:f)-this.padding,g=e.maxHeight,h,i=this.clipRect,j=e.navigation,k=m(j.animation,!0),l=j.arrowSize||12,o=this.nav,n=this.pages,
184
+ s,q=this.allItems;e.layout==="horizontal"&&(f/=2);g&&(f=C(f,g));n.length=0;if(a>f&&!e.useHTML){this.clipHeight=h=f-20-this.titleHeight-this.padding;this.currentPage=m(this.currentPage,1);this.fullHeight=a;p(q,function(a,b){var c=a._legendItemPos[1],d=u(a.legendItem.getBBox().height),e=n.length;if(!e||c-n[e-1]>h&&(s||c)!==n[e-1])n.push(s||c),e++;b===q.length-1&&c+d-n[e-1]>h&&n.push(c);c!==s&&(s=c)});if(!i)i=b.clipRect=d.clipRect(0,this.padding,9999,0),b.contentGroup.clip(i);i.attr({height:h});if(!o)this.nav=
185
+ o=d.g().attr({zIndex:1}).add(this.group),this.up=d.symbol("triangle",0,0,l,l).on("click",function(){b.scroll(-1,k)}).add(o),this.pager=d.text("",15,10).css(j.style).add(o),this.down=d.symbol("triangle-down",0,0,l,l).on("click",function(){b.scroll(1,k)}).add(o);b.scroll(0);a=f}else if(o)i.attr({height:c.chartHeight}),o.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0;return a},scroll:function(a,b){var c=this.pages,d=c.length,e=this.currentPage+a,f=this.clipHeight,g=this.options.navigation,
186
+ h=g.activeColor,g=g.inactiveColor,i=this.pager,j=this.padding;e>d&&(e=d);if(e>0)b!==t&&Qa(b,this.chart),this.nav.attr({translateX:j,translateY:f+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:e===1?g:h}).css({cursor:e===1?"default":"pointer"}),i.attr({text:e+"/"+d}),this.down.attr({x:18+this.pager.getBBox().width,fill:e===d?g:h}).css({cursor:e===d?"default":"pointer"}),c=-c[e-1]+this.initialItemY,this.scrollGroup.animate({translateY:c}),this.currentPage=e,this.positionCheckboxes(c)}};
187
+ N=R.LegendSymbolMixin={drawRectangle:function(a,b){var c=a.options.symbolHeight||12;b.legendSymbol=this.chart.renderer.rect(0,a.baseline-5-c/2,a.symbolWidth,c,a.options.symbolRadius||0).attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var b=this.options,c=b.marker,d;d=a.symbolWidth;var e=this.chart.renderer,f=this.legendGroup,a=a.baseline-u(e.fontMetrics(a.options.itemStyle.fontSize).b*0.3),g;if(b.lineWidth){g={"stroke-width":b.lineWidth};if(b.dashStyle)g.dashstyle=b.dashStyle;this.legendLine=
188
+ e.path(["M",0,a,"L",d,a]).attr(g).add(f)}if(c&&c.enabled!==!1)b=c.radius,this.legendSymbol=d=e.symbol(this.symbol,d/2-b,a-b,2*b,2*b).add(f),d.isMarker=!0}};(/Trident\/7\.0/.test(wa)||Ta)&&Ma(lb.prototype,"positionItem",function(a,b){var c=this,d=function(){b._legendItemPos&&a.call(c,b)};d();setTimeout(d)});Ya.prototype={init:function(a,b){var c,d=a.series;a.series=null;c=w(E,a);c.series=a.series=d;this.userOptions=a;d=c.chart;this.margin=this.splashArray("margin",d);this.spacing=this.splashArray("spacing",
189
+ d);var e=d.events;this.bounds={h:{},v:{}};this.callback=b;this.isResizing=0;this.options=c;this.axes=[];this.series=[];this.hasCartesianSeries=d.showAxes;var f=this,g;f.index=V.length;V.push(f);ab++;d.reflow!==!1&&K(f,"load",function(){f.initReflow()});if(e)for(g in e)K(f,g,e[g]);f.xAxis=[];f.yAxis=[];f.animation=fa?!1:m(d.animation,!0);f.pointCount=0;f.counters=new Bb;f.firstRender()},initSeries:function(a){var b=this.options.chart;(b=F[a.type||b.type||b.defaultSeriesType])||ra(17,!0);b=new b;b.init(this,
190
+ a);return b},isInsidePlot:function(a,b,c){var d=c?b:a,a=c?a:b;return d>=0&&d<=this.plotWidth&&a>=0&&a<=this.plotHeight},adjustTickAmounts:function(){this.options.chart.alignTicks!==!1&&p(this.axes,function(a){a.adjustTickAmount()});this.maxTicks=null},redraw:function(a){var b=this.axes,c=this.series,d=this.pointer,e=this.legend,f=this.isDirtyLegend,g,h,i=this.isDirtyBox,j=c.length,k=j,l=this.renderer,o=l.isHidden(),n=[];Qa(a,this);o&&this.cloneRenderTo();for(this.layOutTitles();k--;)if(a=c[k],a.options.stacking&&
191
+ (g=!0,a.isDirty)){h=!0;break}if(h)for(k=j;k--;)if(a=c[k],a.options.stacking)a.isDirty=!0;p(c,function(a){a.isDirty&&a.options.legendType==="point"&&(f=!0)});if(f&&e.options.enabled)e.render(),this.isDirtyLegend=!1;g&&this.getStacks();if(this.hasCartesianSeries){if(!this.isResizing)this.maxTicks=null,p(b,function(a){a.setScale()});this.adjustTickAmounts();this.getMargins();p(b,function(a){a.isDirty&&(i=!0)});p(b,function(a){if(a.isDirtyExtremes)a.isDirtyExtremes=!1,n.push(function(){D(a,"afterSetExtremes",
192
+ q(a.eventArgs,a.getExtremes()));delete a.eventArgs});(i||g)&&a.redraw()})}i&&this.drawChartBox();p(c,function(a){a.isDirty&&a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()});d&&d.reset(!0);l.draw();D(this,"redraw");o&&this.cloneRenderTo(!0);p(n,function(a){a.call()})},get:function(a){var b=this.axes,c=this.series,d,e;for(d=0;d<b.length;d++)if(b[d].options.id===a)return b[d];for(d=0;d<c.length;d++)if(c[d].options.id===a)return c[d];for(d=0;d<c.length;d++){e=c[d].points||[];for(b=0;b<e.length;b++)if(e[b].id===
193
+ a)return e[b]}return null},getAxes:function(){var a=this,b=this.options,c=b.xAxis=qa(b.xAxis||{}),b=b.yAxis=qa(b.yAxis||{});p(c,function(a,b){a.index=b;a.isX=!0});p(b,function(a,b){a.index=b});c=c.concat(b);p(c,function(b){new la(a,b)});a.adjustTickAmounts()},getSelectedPoints:function(){var a=[];p(this.series,function(b){a=a.concat(vb(b.points||[],function(a){return a.selected}))});return a},getSelectedSeries:function(){return vb(this.series,function(a){return a.selected})},getStacks:function(){var a=
194
+ this;p(a.yAxis,function(a){if(a.stacks&&a.hasVisibleSeries)a.oldStacks=a.stacks});p(a.series,function(b){if(b.options.stacking&&(b.visible===!0||a.options.chart.ignoreHiddenSeries===!1))b.stackKey=b.type+m(b.options.stack,"")})},setTitle:function(a,b,c){var g;var d=this,e=d.options,f;f=e.title=w(e.title,a);g=e.subtitle=w(e.subtitle,b),e=g;p([["title",a,f],["subtitle",b,e]],function(a){var b=a[0],c=d[b],e=a[1],a=a[2];c&&e&&(d[b]=c=c.destroy());a&&a.text&&!c&&(d[b]=d.renderer.text(a.text,0,0,a.useHTML).attr({align:a.align,
195
+ "class":"highcharts-"+b,zIndex:a.zIndex||4}).css(a.style).add())});d.layOutTitles(c)},layOutTitles:function(a){var b=0,c=this.title,d=this.subtitle,e=this.options,f=e.title,e=e.subtitle,g=this.spacingBox.width-44;if(c&&(c.css({width:(f.width||g)+"px"}).align(q({y:15},f),!1,"spacingBox"),!f.floating&&!f.verticalAlign))b=c.getBBox().height;d&&(d.css({width:(e.width||g)+"px"}).align(q({y:b+f.margin},e),!1,"spacingBox"),!e.floating&&!e.verticalAlign&&(b=Ka(b+d.getBBox().height)));c=this.titleOffset!==
196
+ b;this.titleOffset=b;if(!this.isDirtyBox&&c)this.isDirtyBox=c,this.hasRendered&&m(a,!0)&&this.isDirtyBox&&this.redraw()},getChartSize:function(){var a=this.options.chart,b=a.width,a=a.height,c=this.renderToClone||this.renderTo;if(!r(b))this.containerWidth=jb(c,"width");if(!r(a))this.containerHeight=jb(c,"height");this.chartWidth=v(0,b||this.containerWidth||600);this.chartHeight=v(0,m(a,this.containerHeight>19?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;
197
+ a?b&&(this.renderTo.appendChild(c),Pa(b),delete this.renderToClone):(c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),G(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),y.body.appendChild(b),c&&b.appendChild(c))},getContainer:function(){var a,b=this.options.chart,c,d,e;this.renderTo=a=b.renderTo;e="highcharts-"+tb++;if(Fa(a))this.renderTo=a=y.getElementById(a);
198
+ a||ra(13,!0);c=z(H(a,"data-highcharts-chart"));!isNaN(c)&&V[c]&&V[c].hasRendered&&V[c].destroy();H(a,"data-highcharts-chart",this.index);a.innerHTML="";!b.skipClone&&!a.offsetWidth&&this.cloneRenderTo();this.getChartSize();c=this.chartWidth;d=this.chartHeight;this.container=a=Y(Ja,{className:"highcharts-container"+(b.className?" "+b.className:""),id:e},q({position:"relative",overflow:"hidden",width:c+"px",height:d+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},
199
+ b.style),this.renderToClone||a);this._cursor=a.style.cursor;this.renderer=b.forExport?new ta(a,c,d,b.style,!0):new Za(a,c,d,b.style);fa&&this.renderer.create(this,a,c,d)},getMargins:function(){var a=this.spacing,b,c=this.legend,d=this.margin,e=this.options.legend,f=m(e.margin,20),g=e.x,h=e.y,i=e.align,j=e.verticalAlign,k=this.titleOffset;this.resetMargins();b=this.axisOffset;if(k&&!r(d[0]))this.plotTop=v(this.plotTop,k+this.options.title.margin+a[0]);if(c.display&&!e.floating)if(i==="right"){if(!r(d[1]))this.marginRight=
200
+ v(this.marginRight,c.legendWidth-g+f+a[1])}else if(i==="left"){if(!r(d[3]))this.plotLeft=v(this.plotLeft,c.legendWidth+g+f+a[3])}else if(j==="top"){if(!r(d[0]))this.plotTop=v(this.plotTop,c.legendHeight+h+f+a[0])}else if(j==="bottom"&&!r(d[2]))this.marginBottom=v(this.marginBottom,c.legendHeight-h+f+a[2]);this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);this.hasCartesianSeries&&p(this.axes,function(a){a.getOffset()});r(d[3])||
201
+ (this.plotLeft+=b[3]);r(d[0])||(this.plotTop+=b[0]);r(d[2])||(this.marginBottom+=b[2]);r(d[1])||(this.marginRight+=b[1]);this.setChartSize()},reflow:function(a){var b=this,c=b.options.chart,d=b.renderTo,e=c.width||jb(d,"width"),f=c.height||jb(d,"height"),c=a?a.target:I,d=function(){if(b.container)b.setSize(e,f,!1),b.hasUserSize=null};if(!b.hasUserSize&&e&&f&&(c===I||c===y)){if(e!==b.containerWidth||f!==b.containerHeight)clearTimeout(b.reflowTimeout),a?b.reflowTimeout=setTimeout(d,100):d();b.containerWidth=
202
+ e;b.containerHeight=f}},initReflow:function(){var a=this,b=function(b){a.reflow(b)};K(I,"resize",b);K(a,"destroy",function(){W(I,"resize",b)})},setSize:function(a,b,c){var d=this,e,f,g;d.isResizing+=1;g=function(){d&&D(d,"endResize",null,function(){d.isResizing-=1})};Qa(c,d);d.oldChartHeight=d.chartHeight;d.oldChartWidth=d.chartWidth;if(r(a))d.chartWidth=e=v(0,u(a)),d.hasUserSize=!!e;if(r(b))d.chartHeight=f=v(0,u(b));(va?kb:G)(d.container,{width:e+"px",height:f+"px"},va);d.setChartSize(!0);d.renderer.setSize(e,
203
+ f,c);d.maxTicks=null;p(d.axes,function(a){a.isDirty=!0;a.setScale()});p(d.series,function(a){a.isDirty=!0});d.isDirtyLegend=!0;d.isDirtyBox=!0;d.layOutTitles();d.getMargins();d.redraw(c);d.oldChartHeight=null;D(d,"resize");va===!1?g():setTimeout(g,va&&va.duration||500)},setChartSize:function(a){var b=this.inverted,c=this.renderer,d=this.chartWidth,e=this.chartHeight,f=this.options.chart,g=this.spacing,h=this.clipOffset,i,j,k,l;this.plotLeft=i=u(this.plotLeft);this.plotTop=j=u(this.plotTop);this.plotWidth=
204
+ k=v(0,u(d-i-this.marginRight));this.plotHeight=l=v(0,u(e-j-this.marginBottom));this.plotSizeX=b?l:k;this.plotSizeY=b?k:l;this.plotBorderWidth=f.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:g[3],y:g[0],width:d-g[3]-g[1],height:e-g[0]-g[2]};this.plotBox=c.plotBox={x:i,y:j,width:k,height:l};d=2*T(this.plotBorderWidth/2);b=Ka(v(d,h[3])/2);c=Ka(v(d,h[0])/2);this.clipBox={x:b,y:c,width:T(this.plotSizeX-v(d,h[1])/2-b),height:T(this.plotSizeY-v(d,h[2])/2-c)};a||p(this.axes,function(a){a.setAxisSize();
205
+ a.setAxisTranslation()})},resetMargins:function(){var a=this.spacing,b=this.margin;this.plotTop=m(b[0],a[0]);this.marginRight=m(b[1],a[1]);this.marginBottom=m(b[2],a[2]);this.plotLeft=m(b[3],a[3]);this.axisOffset=[0,0,0,0];this.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,b=this.renderer,c=this.chartWidth,d=this.chartHeight,e=this.chartBackground,f=this.plotBackground,g=this.plotBorder,h=this.plotBGImage,i=a.borderWidth||0,j=a.backgroundColor,k=a.plotBackgroundColor,l=a.plotBackgroundImage,
206
+ o=a.plotBorderWidth||0,n,s=this.plotLeft,m=this.plotTop,p=this.plotWidth,q=this.plotHeight,r=this.plotBox,v=this.clipRect,u=this.clipBox;n=i+(a.shadow?8:0);if(i||j)if(e)e.animate(e.crisp({width:c-n,height:d-n}));else{e={fill:j||Q};if(i)e.stroke=a.borderColor,e["stroke-width"]=i;this.chartBackground=b.rect(n/2,n/2,c-n,d-n,a.borderRadius,i).attr(e).addClass("highcharts-background").add().shadow(a.shadow)}if(k)f?f.animate(r):this.plotBackground=b.rect(s,m,p,q,0).attr({fill:k}).add().shadow(a.plotShadow);
207
+ if(l)h?h.animate(r):this.plotBGImage=b.image(l,s,m,p,q).add();v?v.animate({width:u.width,height:u.height}):this.clipRect=b.clipRect(u);if(o)g?g.animate(g.crisp({x:s,y:m,width:p,height:q})):this.plotBorder=b.rect(s,m,p,q,0,-o).attr({stroke:a.plotBorderColor,"stroke-width":o,fill:Q,zIndex:1}).add();this.isDirtyBox=!1},propFromSeries:function(){var a=this,b=a.options.chart,c,d=a.options.series,e,f;p(["inverted","angular","polar"],function(g){c=F[b.type||b.defaultSeriesType];f=a[g]||b[g]||c&&c.prototype[g];
208
+ for(e=d&&d.length;!f&&e--;)(c=F[d[e].type])&&c.prototype[g]&&(f=!0);a[g]=f})},linkSeries:function(){var a=this,b=a.series;p(b,function(a){a.linkedSeries.length=0});p(b,function(b){var d=b.options.linkedTo;if(Fa(d)&&(d=d===":previous"?a.series[b.index-1]:a.get(d)))d.linkedSeries.push(b),b.linkedParent=d})},renderSeries:function(){p(this.series,function(a){a.translate();a.setTooltipPoints&&a.setTooltipPoints();a.render()})},render:function(){var a=this,b=a.axes,c=a.renderer,d=a.options,e=d.labels,f=
209
+ d.credits,g;a.setTitle();a.legend=new lb(a,d.legend);a.getStacks();p(b,function(a){a.setScale()});a.getMargins();a.maxTicks=null;p(b,function(a){a.setTickPositions(!0);a.setMaxTicks()});a.adjustTickAmounts();a.getMargins();a.drawChartBox();a.hasCartesianSeries&&p(b,function(a){a.render()});if(!a.seriesGroup)a.seriesGroup=c.g("series-group").attr({zIndex:3}).add();a.renderSeries();e.items&&p(e.items,function(b){var d=q(e.style,b.style),f=z(d.left)+a.plotLeft,g=z(d.top)+a.plotTop+12;delete d.left;delete d.top;
210
+ c.text(b.html,f,g).attr({zIndex:2}).css(d).add()});if(f.enabled&&!a.credits)g=f.href,a.credits=c.text(f.text,0,0).on("click",function(){if(g)location.href=g}).attr({align:f.position.align,zIndex:8}).css(f.style).add().align(f.position);a.hasRendered=!0},destroy:function(){var a=this,b=a.axes,c=a.series,d=a.container,e,f=d&&d.parentNode;D(a,"destroy");V[a.index]=t;ab--;a.renderTo.removeAttribute("data-highcharts-chart");W(a);for(e=b.length;e--;)b[e]=b[e].destroy();for(e=c.length;e--;)c[e]=c[e].destroy();
211
+ p("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(b){var c=a[b];c&&c.destroy&&(a[b]=c.destroy())});if(d)d.innerHTML="",W(d),f&&Pa(d);for(e in a)delete a[e]},isReadyToRender:function(){var a=this;return!aa&&I==I.top&&y.readyState!=="complete"||fa&&!I.canvg?(fa?Lb.push(function(){a.firstRender()},a.options.global.canvasToolsURL):y.attachEvent("onreadystatechange",
212
+ function(){y.detachEvent("onreadystatechange",a.firstRender);y.readyState==="complete"&&a.firstRender()}),!1):!0},firstRender:function(){var a=this,b=a.options,c=a.callback;if(a.isReadyToRender()){a.getContainer();D(a,"init");a.resetMargins();a.setChartSize();a.propFromSeries();a.getAxes();p(b.series||[],function(b){a.initSeries(b)});a.linkSeries();D(a,"beforeRender");if(R.Pointer)a.pointer=new Wa(a,b);a.render();a.renderer.draw();c&&c.apply(a,[a]);p(a.callbacks,function(b){b.apply(a,[a])});a.cloneRenderTo(!0);
213
+ D(a,"load")}},splashArray:function(a,b){var c=b[a],c=ca(c)?c:[c,c,c,c];return[m(b[a+"Top"],c[0]),m(b[a+"Right"],c[1]),m(b[a+"Bottom"],c[2]),m(b[a+"Left"],c[3])]}};Ya.prototype.callbacks=[];X=R.CenteredSeriesMixin={getCenter:function(){var a=this.options,b=this.chart,c=2*(a.slicedOffset||0),d,e=b.plotWidth-2*c,f=b.plotHeight-2*c,b=a.center,a=[m(b[0],"50%"),m(b[1],"50%"),a.size||"100%",a.innerSize||0],g=C(e,f),h;return Ua(a,function(a,b){h=/%$/.test(a);d=b<2||b===2&&h;return(h?[e,f,g,g][b]*z(a)/100:
214
+ a)+(d?c:0)})}};var Ea=function(){};Ea.prototype={init:function(a,b,c){this.series=a;this.applyOptions(b,c);this.pointAttr={};if(a.options.colorByPoint&&(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter++],a.colorCounter===b.length))a.colorCounter=0;a.chart.pointCount++;return this},applyOptions:function(a,b){var c=this.series,d=c.pointValKey,a=Ea.prototype.optionsToObject.call(this,a);q(this,a);this.options=this.options?q(this.options,a):a;if(d)this.y=this[d];if(this.x===
215
+ t&&c)this.x=b===t?c.autoIncrement():b;return this},optionsToObject:function(a){var b={},c=this.series,d=c.pointArrayMap||["y"],e=d.length,f=0,g=0;if(typeof a==="number"||a===null)b[d[0]]=a;else if(La(a)){if(a.length>e){c=typeof a[0];if(c==="string")b.name=a[0];else if(c==="number")b.x=a[0];f++}for(;g<e;)b[d[g++]]=a[f++]}else if(typeof a==="object"){b=a;if(a.dataLabels)c._hasPointLabels=!0;if(a.marker)c._hasPointMarkers=!0}return b},destroy:function(){var a=this.series.chart,b=a.hoverPoints,c;a.pointCount--;
216
+ if(b&&(this.setState(),ja(b,this),!b.length))a.hoverPoints=null;if(this===a.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel)W(this),this.destroyElements();this.legendItem&&a.legend.destroyItem(this);for(c in this)this[c]=null},destroyElements:function(){for(var a="graphic,dataLabel,dataLabelUpper,group,connector,shadowGroup".split(","),b,c=6;c--;)b=a[c],this[b]&&(this[b]=this[b].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,key:this.name||this.category,series:this.series,
217
+ point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(a){var b=this.series,c=b.tooltipOptions,d=m(c.valueDecimals,""),e=c.valuePrefix||"",f=c.valueSuffix||"";p(b.pointArrayMap||["y"],function(b){b="{point."+b;if(e||f)a=a.replace(b+"}",e+b+"}"+f);a=a.replace(b+"}",b+":,."+d+"f}")});return Ia(a,{point:this,series:this.series})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])&&
218
+ this.importEvents();a==="click"&&e.allowPointSelect&&(c=function(a){d.select(null,a.ctrlKey||a.metaKey||a.shiftKey)});D(this,a,b,c)}};var O=function(){};O.prototype={isCartesian:!0,type:"line",pointClass:Ea,sorted:!0,requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],init:function(a,b){var c=this,d,e,f=a.series,g=function(a,b){return m(a.options.index,a._i)-m(b.options.index,
219
+ b._i)};c.chart=a;c.options=b=c.setOptions(b);c.linkedSeries=[];c.bindAxes();q(c,{name:b.name,state:"",pointAttr:{},visible:b.visible!==!1,selected:b.selected===!0});if(fa)b.animation=!1;e=b.events;for(d in e)K(c,d,e[d]);if(e&&e.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=!0;c.getColor();c.getSymbol();p(c.parallelArrays,function(a){c[a+"Data"]=[]});c.setData(b.data,!1);if(c.isCartesian)a.hasCartesianSeries=!0;f.push(c);c._i=f.length-1;ob(f,g);this.yAxis&&
220
+ ob(this.yAxis.series,g);p(f,function(a,b){a.index=b;a.name=a.name||"Series "+(b+1)})},bindAxes:function(){var a=this,b=a.options,c=a.chart,d;p(a.axisTypes||[],function(e){p(c[e],function(c){d=c.options;if(b[e]===d.index||b[e]!==t&&b[e]===d.id||b[e]===t&&d.index===0)c.series.push(a),a[e]=c,c.isDirty=!0});!a[e]&&a.optionalAxis!==e&&ra(18,!0)})},updateParallelArrays:function(a,b){var c=a.series,d=arguments;p(c.parallelArrays,typeof b==="number"?function(d){var f=d==="y"&&c.toYData?c.toYData(a):a[d];
221
+ c[d+"Data"][b]=f}:function(a){Array.prototype[b].apply(c[a+"Data"],Array.prototype.slice.call(d,2))})},autoIncrement:function(){var a=this.options,b=this.xIncrement,b=m(b,a.pointStart,0);this.pointInterval=m(this.pointInterval,a.pointInterval,1);this.xIncrement=b+this.pointInterval;return b},getSegments:function(){var a=-1,b=[],c,d=this.points,e=d.length;if(e)if(this.options.connectNulls){for(c=e;c--;)d[c].y===null&&d.splice(c,1);d.length&&(b=[d])}else p(d,function(c,g){c.y===null?(g>a+1&&b.push(d.slice(a+
222
+ 1,g)),a=g):g===e-1&&b.push(d.slice(a+1,g+1))});this.segments=b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},d=b.plotOptions||{},e=c[this.type];this.userOptions=a;c=w(e,c.series,a);this.tooltipOptions=w(E.tooltip,E.plotOptions[this.type].tooltip,b.tooltip,d.series&&d.series.tooltip,d[this.type]&&d[this.type].tooltip,a.tooltip);e.marker===null&&delete c.marker;return c},getColor:function(){var a=this.options,b=this.userOptions,c=this.chart.options.colors,d=this.chart.counters,
223
+ e;e=a.color||ba[this.type].color;if(!e&&!a.colorByPoint)r(b._colorIndex)?a=b._colorIndex:(b._colorIndex=d.color,a=d.color++),e=c[a];this.color=e;d.wrapColor(c.length)},getSymbol:function(){var a=this.userOptions,b=this.options.marker,c=this.chart,d=c.options.symbols,c=c.counters;this.symbol=b.symbol;if(!this.symbol)r(a._symbolIndex)?a=a._symbolIndex:(a._symbolIndex=c.symbol,a=c.symbol++),this.symbol=d[a];if(/^url/.test(this.symbol))b.radius=0;c.wrapSymbol(d.length)},drawLegendSymbol:N.drawLineMarker,
224
+ setData:function(a,b,c,d){var e=this,f=e.points,g=f&&f.length||0,h,i=e.options,j=e.chart,k=null,l=e.xAxis,o=l&&!!l.categories,n=e.tooltipPoints,s=i.turboThreshold,q=this.xData,r=this.yData,v=(h=e.pointArrayMap)&&h.length,a=a||[];h=a.length;b=m(b,!0);if(d!==!1&&h&&g===h&&!e.cropped&&!e.hasGroupedData)p(a,function(a,b){f[b].update(a,!1)});else{e.xIncrement=null;e.pointRange=o?1:i.pointRange;e.colorCounter=0;p(this.parallelArrays,function(a){e[a+"Data"].length=0});if(s&&h>s){for(c=0;k===null&&c<h;)k=
225
+ a[c],c++;if(ha(k)){o=m(i.pointStart,0);i=m(i.pointInterval,1);for(c=0;c<h;c++)q[c]=o,r[c]=a[c],o+=i;e.xIncrement=o}else if(La(k))if(v)for(c=0;c<h;c++)i=a[c],q[c]=i[0],r[c]=i.slice(1,v+1);else for(c=0;c<h;c++)i=a[c],q[c]=i[0],r[c]=i[1];else ra(12)}else for(c=0;c<h;c++)if(a[c]!==t&&(i={series:e},e.pointClass.prototype.applyOptions.apply(i,[a[c]]),e.updateParallelArrays(i,c),o&&i.name))l.names[i.x]=i.name;Fa(r[0])&&ra(14,!0);e.data=[];e.options.data=a;for(c=g;c--;)f[c]&&f[c].destroy&&f[c].destroy();
226
+ if(n)n.length=0;if(l)l.minRange=l.userMinRange;e.isDirty=e.isDirtyData=j.isDirtyBox=!0;c=!1}b&&j.redraw(c)},processData:function(a){var b=this.xData,c=this.yData,d=b.length,e;e=0;var f,g,h=this.xAxis,i=this.options,j=i.cropThreshold,k=0,l=this.isCartesian,o,n;if(l&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!a)return!1;if(l&&this.sorted&&(!j||d>j||this.forceCrop))if(o=h.min,n=h.max,b[d-1]<o||b[0]>n)b=[],c=[];else if(b[0]<o||b[d-1]>n)e=this.cropData(this.xData,this.yData,o,n),b=e.xData,c=e.yData,
227
+ e=e.start,f=!0,k=b.length;for(d=b.length-1;d>=0;d--)a=b[d]-b[d-1],!f&&b[d]>o&&b[d]<n&&k++,a>0&&(g===t||a<g)?g=a:a<0&&this.requireSorting&&ra(15);this.cropped=f;this.cropStart=e;this.processedXData=b;this.processedYData=c;this.activePointCount=k;if(i.pointRange===null)this.pointRange=g||1;this.closestPointRange=g},cropData:function(a,b,c,d){var e=a.length,f=0,g=e,h=m(this.cropShoulder,1),i;for(i=0;i<e;i++)if(a[i]>=c){f=v(0,i-h);break}for(;i<e;i++)if(a[i]>d){g=i+h;break}return{xData:a.slice(f,g),yData:b.slice(f,
228
+ g),start:f,end:g}},generatePoints:function(){var a=this.options.data,b=this.data,c,d=this.processedXData,e=this.processedYData,f=this.pointClass,g=d.length,h=this.cropStart||0,i,j=this.hasGroupedData,k,l=[],o;if(!b&&!j)b=[],b.length=a.length,b=this.data=b;for(o=0;o<g;o++)i=h+o,j?l[o]=(new f).init(this,[d[o]].concat(qa(e[o]))):(b[i]?k=b[i]:a[i]!==t&&(b[i]=k=(new f).init(this,a[i],d[o])),l[o]=k);if(b&&(g!==(c=b.length)||j))for(o=0;o<c;o++)if(o===h&&!j&&(o+=g),b[o])b[o].destroyElements(),b[o].plotX=
229
+ t;this.data=b;this.points=l},getExtremes:function(a){var b=this.yAxis,c=this.processedXData,d,e=[],f=0;d=this.xAxis.getExtremes();var g=d.min,h=d.max,i,j,k,l,a=a||this.stackedYData||this.processedYData;d=a.length;for(l=0;l<d;l++)if(j=c[l],k=a[l],i=k!==null&&k!==t&&(!b.isLog||k.length||k>0),j=this.getExtremesFromAll||this.cropped||(c[l+1]||j)>=g&&(c[l-1]||j)<=h,i&&j)if(i=k.length)for(;i--;)k[i]!==null&&(e[f++]=k[i]);else e[f++]=k;this.dataMin=m(void 0,Na(e));this.dataMax=m(void 0,Ba(e))},translate:function(){this.processedXData||
230
+ this.processData();this.generatePoints();for(var a=this.options,b=a.stacking,c=this.xAxis,d=c.categories,e=this.yAxis,f=this.points,g=f.length,h=!!this.modifyValue,i=a.pointPlacement,j=i==="between"||ha(i),k=a.threshold,a=0;a<g;a++){var l=f[a],o=l.x,n=l.y,s=l.low,p=b&&e.stacks[(this.negStacks&&n<k?"-":"")+this.stackKey];if(e.isLog&&n<=0)l.y=n=null;l.plotX=c.translate(o,0,0,0,1,i,this.type==="flags");if(b&&this.visible&&p&&p[o])p=p[o],n=p.points[this.index+","+a],s=n[0],n=n[1],s===0&&(s=m(k,e.min)),
231
+ e.isLog&&s<=0&&(s=null),l.total=l.stackTotal=p.total,l.percentage=p.total&&l.y/p.total*100,l.stackY=n,p.setOffset(this.pointXOffset||0,this.barW||0);l.yBottom=r(s)?e.translate(s,0,1,0,1):null;h&&(n=this.modifyValue(n,l));l.plotY=typeof n==="number"&&n!==Infinity?e.translate(n,0,1,0,1):t;l.clientX=j?c.translate(o,0,0,0,1):l.plotX;l.negative=l.y<(k||0);l.category=d&&d[l.x]!==t?d[l.x]:l.x}this.getSegments()},animate:function(a){var b=this.chart,c=b.renderer,d;d=this.options.animation;var e=this.clipBox||
232
+ b.clipBox,f=b.inverted,g;if(d&&!ca(d))d=ba[this.type].animation;g=["_sharedClip",d.duration,d.easing,e.height].join(",");a?(a=b[g],d=b[g+"m"],a||(b[g]=a=c.clipRect(q(e,{width:0})),b[g+"m"]=d=c.clipRect(-99,f?-b.plotLeft:-b.plotTop,99,f?b.chartWidth:b.chartHeight)),this.group.clip(a),this.markerGroup.clip(d),this.sharedClipKey=g):((a=b[g])&&a.animate({width:b.plotSizeX},d),b[g+"m"]&&b[g+"m"].animate({width:b.plotSizeX+99},d),this.animate=null)},afterAnimate:function(){var a=this.chart,b=this.sharedClipKey,
233
+ c=this.group,d=this.clipBox;if(c&&this.options.clip!==!1){if(!b||!d)c.clip(d?a.renderer.clipRect(d):a.clipRect);this.markerGroup.clip()}D(this,"afterAnimate");setTimeout(function(){b&&a[b]&&(d||(a[b]=a[b].destroy()),a[b+"m"]&&(a[b+"m"]=a[b+"m"].destroy()))},100)},drawPoints:function(){var a,b=this.points,c=this.chart,d,e,f,g,h,i,j,k;d=this.options.marker;var l=this.pointAttr[""],o,n=this.markerGroup,s=m(d.enabled,this.activePointCount<0.5*this.xAxis.len/d.radius);if(d.enabled!==!1||this._hasPointMarkers)for(f=
234
+ b.length;f--;)if(g=b[f],d=T(g.plotX),e=g.plotY,k=g.graphic,i=g.marker||{},a=s&&i.enabled===t||i.enabled,o=c.isInsidePlot(u(d),e,c.inverted),a&&e!==t&&!isNaN(e)&&g.y!==null)if(a=g.pointAttr[g.selected?"select":""]||l,h=a.r,i=m(i.symbol,this.symbol),j=i.indexOf("url")===0,k)k[o?"show":"hide"](!0).animate(q({x:d-h,y:e-h},k.symbolName?{width:2*h,height:2*h}:{}));else{if(o&&(h>0||j))g.graphic=c.renderer.symbol(i,d-h,e-h,2*h,2*h).attr(a).add(n)}else if(k)g.graphic=k.destroy()},convertAttribs:function(a,
235
+ b,c,d){var e=this.pointAttrToOptions,f,g,h={},a=a||{},b=b||{},c=c||{},d=d||{};for(f in e)g=e[f],h[f]=m(a[g],b[f],c[f],d[f]);return h},getAttribs:function(){var a=this,b=a.options,c=ba[a.type].marker?b.marker:b,d=c.states,e=d.hover,f,g=a.color;f={stroke:g,fill:g};var h=a.points||[],i,j=[],k,l=a.pointAttrToOptions;k=a.hasPointSpecificOptions;var o=b.negativeColor,n=c.lineColor,s=c.fillColor;i=b.turboThreshold;var m;b.marker?(e.radius=e.radius||c.radius+2,e.lineWidth=e.lineWidth||c.lineWidth+1):e.color=
236
+ e.color||ya(e.color||g).brighten(e.brightness).get();j[""]=a.convertAttribs(c,f);p(["hover","select"],function(b){j[b]=a.convertAttribs(d[b],j[""])});a.pointAttr=j;g=h.length;if(!i||g<i||k)for(;g--;){i=h[g];if((c=i.options&&i.options.marker||i.options)&&c.enabled===!1)c.radius=0;if(i.negative&&o)i.color=i.fillColor=o;k=b.colorByPoint||i.color;if(i.options)for(m in l)r(c[l[m]])&&(k=!0);if(k){c=c||{};k=[];d=c.states||{};f=d.hover=d.hover||{};if(!b.marker)f.color=f.color||!i.options.color&&e.color||
237
+ ya(i.color).brighten(f.brightness||e.brightness).get();f={color:i.color};if(!s)f.fillColor=i.color;if(!n)f.lineColor=i.color;k[""]=a.convertAttribs(q(f,c),j[""]);k.hover=a.convertAttribs(d.hover,j.hover,k[""]);k.select=a.convertAttribs(d.select,j.select,k[""])}else k=j;i.pointAttr=k}},destroy:function(){var a=this,b=a.chart,c=/AppleWebKit\/533/.test(wa),d,e,f=a.data||[],g,h,i;D(a,"destroy");W(a);p(a.axisTypes||[],function(b){if(i=a[b])ja(i.series,a),i.isDirty=i.forceRedraw=!0});a.legendItem&&a.chart.legend.destroyItem(a);
238
+ for(e=f.length;e--;)(g=f[e])&&g.destroy&&g.destroy();a.points=null;clearTimeout(a.animationTimeout);p("area,graph,dataLabelsGroup,group,markerGroup,tracker,graphNeg,areaNeg,posClip,negClip".split(","),function(b){a[b]&&(d=c&&b==="group"?"hide":"destroy",a[b][d]())});if(b.hoverSeries===a)b.hoverSeries=null;ja(b.series,a);for(h in a)delete a[h]},getSegmentPath:function(a){var b=this,c=[],d=b.options.step;p(a,function(e,f){var g=e.plotX,h=e.plotY,i;b.getPointSpline?c.push.apply(c,b.getPointSpline(a,
239
+ e,f)):(c.push(f?"L":"M"),d&&f&&(i=a[f-1],d==="right"?c.push(i.plotX,h):d==="center"?c.push((i.plotX+g)/2,i.plotY,(i.plotX+g)/2,h):c.push(g,i.plotY)),c.push(e.plotX,e.plotY))});return c},getGraphPath:function(){var a=this,b=[],c,d=[];p(a.segments,function(e){c=a.getSegmentPath(e);e.length>1?b=b.concat(c):d.push(e[0])});a.singlePoints=d;return a.graphPath=b},drawGraph:function(){var a=this,b=this.options,c=[["graph",b.lineColor||this.color]],d=b.lineWidth,e=b.dashStyle,f=b.linecap!=="square",g=this.getGraphPath(),
240
+ h=b.negativeColor;h&&c.push(["graphNeg",h]);p(c,function(c,h){var k=c[0],l=a[k];if(l)bb(l),l.animate({d:g});else if(d&&g.length)l={stroke:c[1],"stroke-width":d,fill:Q,zIndex:1},e?l.dashstyle=e:f&&(l["stroke-linecap"]=l["stroke-linejoin"]="round"),a[k]=a.chart.renderer.path(g).attr(l).add(a.group).shadow(!h&&b.shadow)})},clipNeg:function(){var a=this.options,b=this.chart,c=b.renderer,d=a.negativeColor||a.negativeFillColor,e,f=this.graph,g=this.area,h=this.posClip,i=this.negClip;e=b.chartWidth;var j=
241
+ b.chartHeight,k=v(e,j),l=this.yAxis;if(d&&(f||g)){d=u(l.toPixels(a.threshold||0,!0));d<0&&(k-=d);a={x:0,y:0,width:k,height:d};k={x:0,y:d,width:k,height:k};if(b.inverted)a.height=k.y=b.plotWidth-d,c.isVML&&(a={x:b.plotWidth-d-b.plotLeft,y:0,width:e,height:j},k={x:d+b.plotLeft-e,y:0,width:b.plotLeft+d,height:e});l.reversed?(b=k,e=a):(b=a,e=k);h?(h.animate(b),i.animate(e)):(this.posClip=h=c.clipRect(b),this.negClip=i=c.clipRect(e),f&&this.graphNeg&&(f.clip(h),this.graphNeg.clip(i)),g&&(g.clip(h),this.areaNeg.clip(i)))}},
242
+ invertGroups:function(){function a(){var a={width:b.yAxis.len,height:b.xAxis.len};p(["group","markerGroup"],function(c){b[c]&&b[c].attr(a).invert()})}var b=this,c=b.chart;if(b.xAxis)K(c,"resize",a),K(b,"destroy",function(){W(c,"resize",a)}),a(),b.invertGroups=a},plotGroup:function(a,b,c,d,e){var f=this[a],g=!f;g&&(this[a]=f=this.chart.renderer.g(b).attr({visibility:c,zIndex:d||0.1}).add(e));f[g?"attr":"animate"](this.getPlotBox());return f},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;
243
+ if(a.inverted)b=c,c=this.xAxis;return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var a=this,b=a.chart,c,d=a.options,e=(c=d.animation)&&!!a.animate&&b.renderer.isSVG&&m(c.duration,500)||0,f=a.visible?"visible":"hidden",g=d.zIndex,h=a.hasRendered,i=b.seriesGroup;c=a.plotGroup("group","series",f,g,i);a.markerGroup=a.plotGroup("markerGroup","markers",f,g,i);e&&a.animate(!0);a.getAttribs();c.inverted=a.isCartesian?b.inverted:!1;a.drawGraph&&(a.drawGraph(),
244
+ a.clipNeg());a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&&a.options.enableMouseTracking!==!1&&a.drawTracker();b.inverted&&a.invertGroups();d.clip!==!1&&!a.sharedClipKey&&!h&&c.clip(b.clipRect);e&&a.animate();if(!h)e?a.animationTimeout=setTimeout(function(){a.afterAnimate()},e):a.afterAnimate();a.isDirty=a.isDirtyData=!1;a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirtyData,c=this.group,d=this.xAxis,e=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,
245
+ height:a.plotHeight}),c.animate({translateX:m(d&&d.left,a.plotLeft),translateY:m(e&&e.top,a.plotTop)}));this.translate();this.setTooltipPoints&&this.setTooltipPoints(!0);this.render();b&&D(this,"updatedData")}};Hb.prototype={destroy:function(){Oa(this,this.axis)},render:function(a){var b=this.options,c=b.format,c=c?Ia(c,this):b.formatter.call(this);this.label?this.label.attr({text:c,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(c,null,null,b.useHTML).css(b.style).attr({align:this.textAlign,
246
+ rotation:b.rotation,visibility:"hidden"}).add(a)},setOffset:function(a,b){var c=this.axis,d=c.chart,e=d.inverted,f=this.isNegative,g=c.translate(c.usePercentage?100:this.total,0,0,0,1),c=c.translate(0),c=M(g-c),h=d.xAxis[0].translate(this.x)+a,i=d.plotHeight,f={x:e?f?g:g-c:h,y:e?i-h-b:f?i-g-c:i-g,width:e?c:b,height:e?b:c};if(e=this.label)e.align(this.alignOptions,null,f),f=e.alignAttr,e[this.options.crop===!1||d.isInsidePlot(f.x,f.y)?"show":"hide"](!0)}};la.prototype.buildStacks=function(){var a=
247
+ this.series,b=m(this.options.reversedStacks,!0),c=a.length;if(!this.isXAxis){for(this.usePercentage=!1;c--;)a[b?c:a.length-c-1].setStackedPoints();if(this.usePercentage)for(c=0;c<a.length;c++)a[c].setPercentStacks()}};la.prototype.renderStackTotals=function(){var a=this.chart,b=a.renderer,c=this.stacks,d,e,f=this.stackTotalGroup;if(!f)this.stackTotalGroup=f=b.g("stack-labels").attr({visibility:"visible",zIndex:6}).add();f.translate(a.plotLeft,a.plotTop);for(d in c)for(e in a=c[d],a)a[e].render(f)};
248
+ O.prototype.setStackedPoints=function(){if(this.options.stacking&&!(this.visible!==!0&&this.chart.options.chart.ignoreHiddenSeries!==!1)){var a=this.processedXData,b=this.processedYData,c=[],d=b.length,e=this.options,f=e.threshold,g=e.stack,e=e.stacking,h=this.stackKey,i="-"+h,j=this.negStacks,k=this.yAxis,l=k.stacks,o=k.oldStacks,n,m,p,q,r,u;for(q=0;q<d;q++){r=a[q];u=b[q];p=this.index+","+q;m=(n=j&&u<f)?i:h;l[m]||(l[m]={});if(!l[m][r])o[m]&&o[m][r]?(l[m][r]=o[m][r],l[m][r].total=null):l[m][r]=new Hb(k,
249
+ k.options.stackLabels,n,r,g);m=l[m][r];m.points[p]=[m.cum||0];e==="percent"?(n=n?h:i,j&&l[n]&&l[n][r]?(n=l[n][r],m.total=n.total=v(n.total,m.total)+M(u)||0):m.total=da(m.total+(M(u)||0))):m.total=da(m.total+(u||0));m.cum=(m.cum||0)+(u||0);m.points[p].push(m.cum);c[q]=m.cum}if(e==="percent")k.usePercentage=!0;this.stackedYData=c;k.oldStacks={}}};O.prototype.setPercentStacks=function(){var a=this,b=a.stackKey,c=a.yAxis.stacks,d=a.processedXData;p([b,"-"+b],function(b){var e;for(var f=d.length,g,h;f--;)if(g=
250
+ d[f],e=(h=c[b]&&c[b][g])&&h.points[a.index+","+f],g=e)h=h.total?100/h.total:0,g[0]=da(g[0]*h),g[1]=da(g[1]*h),a.stackedYData[f]=g[1]})};q(Ya.prototype,{addSeries:function(a,b,c){var d,e=this;a&&(b=m(b,!0),D(e,"addSeries",{options:a},function(){d=e.initSeries(a);e.isDirtyLegend=!0;e.linkSeries();b&&e.redraw(c)}));return d},addAxis:function(a,b,c,d){var e=b?"xAxis":"yAxis",f=this.options;new la(this,w(a,{index:this[e].length,isX:b}));f[e]=qa(f[e]||{});f[e].push(a);m(c,!0)&&this.redraw(d)},showLoading:function(a){var b=
251
+ this.options,c=this.loadingDiv,d=b.loading;if(!c)this.loadingDiv=c=Y(Ja,{className:"highcharts-loading"},q(d.style,{zIndex:10,display:Q}),this.container),this.loadingSpan=Y("span",null,d.labelStyle,c);this.loadingSpan.innerHTML=a||b.lang.loading;if(!this.loadingShown)G(c,{opacity:0,display:"",left:this.plotLeft+"px",top:this.plotTop+"px",width:this.plotWidth+"px",height:this.plotHeight+"px"}),kb(c,{opacity:d.style.opacity},{duration:d.showDuration||0}),this.loadingShown=!0},hideLoading:function(){var a=
252
+ this.options,b=this.loadingDiv;b&&kb(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){G(b,{display:Q})}});this.loadingShown=!1}});q(Ea.prototype,{update:function(a,b,c){var d=this,e=d.series,f=d.graphic,g,h=e.data,i=e.chart,j=e.options,b=m(b,!0);d.firePointEvent("update",{options:a},function(){d.applyOptions(a);if(ca(a)){e.getAttribs();if(f)a&&a.marker&&a.marker.symbol?d.graphic=f.destroy():f.attr(d.pointAttr[d.state||""]);if(a&&a.dataLabels&&d.dataLabel)d.dataLabel=d.dataLabel.destroy()}g=
253
+ Da(d,h);e.updateParallelArrays(d,g);j.data[g]=d.options;e.isDirty=e.isDirtyData=!0;if(!e.fixedBox&&e.hasCartesianSeries)i.isDirtyBox=!0;j.legendType==="point"&&i.legend.destroyItem(d);b&&i.redraw(c)})},remove:function(a,b){var c=this,d=c.series,e=d.points,f=d.chart,g,h=d.data;Qa(b,f);a=m(a,!0);c.firePointEvent("remove",null,function(){g=Da(c,h);h.length===e.length&&e.splice(g,1);h.splice(g,1);d.options.data.splice(g,1);d.updateParallelArrays(c,"splice",g,1);c.destroy();d.isDirty=!0;d.isDirtyData=
254
+ !0;a&&f.redraw()})}});q(O.prototype,{addPoint:function(a,b,c,d){var e=this.options,f=this.data,g=this.graph,h=this.area,i=this.chart,j=this.xAxis&&this.xAxis.names,k=g&&g.shift||0,l=e.data,o,n=this.xData;Qa(d,i);c&&p([g,h,this.graphNeg,this.areaNeg],function(a){if(a)a.shift=k+1});if(h)h.isArea=!0;b=m(b,!0);d={series:this};this.pointClass.prototype.applyOptions.apply(d,[a]);g=d.x;h=n.length;if(this.requireSorting&&g<n[h-1])for(o=!0;h&&n[h-1]>g;)h--;this.updateParallelArrays(d,"splice",h,0,0);this.updateParallelArrays(d,
255
+ h);if(j)j[g]=d.name;l.splice(h,0,a);o&&(this.data.splice(h,0,null),this.processData());e.legendType==="point"&&this.generatePoints();c&&(f[0]&&f[0].remove?f[0].remove(!1):(f.shift(),this.updateParallelArrays(d,"shift"),l.shift()));this.isDirtyData=this.isDirty=!0;b&&(this.getAttribs(),i.redraw())},remove:function(a,b){var c=this,d=c.chart,a=m(a,!0);if(!c.isRemoving)c.isRemoving=!0,D(c,"remove",null,function(){c.destroy();d.isDirtyLegend=d.isDirtyBox=!0;d.linkSeries();a&&d.redraw(b)});c.isRemoving=
256
+ !1},update:function(a,b){var c=this.chart,d=this.type,e=F[d].prototype,f,a=w(this.userOptions,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1);for(f in e)e.hasOwnProperty(f)&&(this[f]=t);q(this,F[a.type||d].prototype);this.init(c,a);m(b,!0)&&c.redraw(!1)}});q(la.prototype,{update:function(a,b){var c=this.chart,a=c.options[this.coll][this.options.index]=w(this.userOptions,a);this.destroy(!0);this._addedPlotLB=t;this.init(c,q(a,{events:t}));c.isDirtyBox=
257
+ !0;m(b,!0)&&c.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,d=this.series,e=d.length;e--;)d[e]&&d[e].remove(!1);ja(b.axes,this);ja(b[c],this);b.options[c].splice(this.options.index,1);p(b[c],function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;m(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},b)}});ga=ka(O);F.line=ga;ba.area=w(S,{threshold:0});var pa=ka(O,{type:"area",getSegments:function(){var a=
258
+ [],b=[],c=[],d=this.xAxis,e=this.yAxis,f=e.stacks[this.stackKey],g={},h,i,j=this.points,k=this.options.connectNulls,l,o,n;if(this.options.stacking&&!this.cropped){for(o=0;o<j.length;o++)g[j[o].x]=j[o];for(n in f)f[n].total!==null&&c.push(+n);c.sort(function(a,b){return a-b});p(c,function(a){if(!k||g[a]&&g[a].y!==null)g[a]?b.push(g[a]):(h=d.translate(a),l=f[a].percent?f[a].total?f[a].cum*100/f[a].total:0:f[a].cum,i=e.toPixels(l,!0),b.push({y:null,plotX:h,clientX:h,plotY:i,yBottom:i,onMouseOver:sa}))});
259
+ b.length&&a.push(b)}else O.prototype.getSegments.call(this),a=this.segments;this.segments=a},getSegmentPath:function(a){var b=O.prototype.getSegmentPath.call(this,a),c=[].concat(b),d,e=this.options;d=b.length;var f=this.yAxis.getThreshold(e.threshold),g;d===3&&c.push("L",b[1],b[2]);if(e.stacking&&!this.closedStacks)for(d=a.length-1;d>=0;d--)g=m(a[d].yBottom,f),d<a.length-1&&e.step&&c.push(a[d+1].plotX,g),c.push(a[d].plotX,g);else this.closeSegment(c,a,f);this.areaPath=this.areaPath.concat(c);return b},
260
+ closeSegment:function(a,b,c){a.push("L",b[b.length-1].plotX,c,"L",b[0].plotX,c)},drawGraph:function(){this.areaPath=[];O.prototype.drawGraph.apply(this);var a=this,b=this.areaPath,c=this.options,d=c.negativeColor,e=c.negativeFillColor,f=[["area",this.color,c.fillColor]];(d||e)&&f.push(["areaNeg",d,e]);p(f,function(d){var e=d[0],f=a[e];f?f.animate({d:b}):a[e]=a.chart.renderer.path(b).attr({fill:m(d[2],ya(d[1]).setOpacity(m(c.fillOpacity,0.75)).get()),zIndex:0}).add(a.group)})},drawLegendSymbol:N.drawRectangle});
261
+ F.area=pa;ba.spline=w(S);ga=ka(O,{type:"spline",getPointSpline:function(a,b,c){var d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1],h,i,j,k;if(f&&g){a=f.plotY;j=g.plotX;var g=g.plotY,l;h=(1.5*d+f.plotX)/2.5;i=(1.5*e+a)/2.5;j=(1.5*d+j)/2.5;k=(1.5*e+g)/2.5;l=(k-i)*(j-d)/(j-h)+e-k;i+=l;k+=l;i>a&&i>e?(i=v(a,e),k=2*e-i):i<a&&i<e&&(i=C(a,e),k=2*e-i);k>g&&k>e?(k=v(g,e),i=2*e-k):k<g&&k<e&&(k=C(g,e),i=2*e-k);b.rightContX=j;b.rightContY=k}c?(b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,i||e,d,e],f.rightContX=
262
+ f.rightContY=null):b=["M",d,e];return b}});F.spline=ga;ba.areaspline=w(ba.area);pa=pa.prototype;ga=ka(ga,{type:"areaspline",closedStacks:!0,getSegmentPath:pa.getSegmentPath,closeSegment:pa.closeSegment,drawGraph:pa.drawGraph,drawLegendSymbol:N.drawRectangle});F.areaspline=ga;ba.column=w(S,{borderColor:"#FFFFFF",borderRadius:0,groupPadding:0.2,marker:null,pointPadding:0.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{brightness:0.1,shadow:!1,halo:!1},select:{color:"#C0C0C0",borderColor:"#000000",
263
+ shadow:!1}},dataLabels:{align:null,verticalAlign:null,y:null},stickyTracking:!1,tooltip:{distance:6},threshold:0});ga=ka(O,{type:"column",pointAttrToOptions:{stroke:"borderColor",fill:"color",r:"borderRadius"},cropShoulder:0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){O.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasRendered&&p(b.series,function(b){if(b.type===a.type)b.isDirty=!0})},getColumnMetrics:function(){var a=this,b=a.options,c=a.xAxis,d=a.yAxis,e=
264
+ c.reversed,f,g={},h,i=0;b.grouping===!1?i=1:p(a.chart.series,function(b){var c=b.options,e=b.yAxis;if(b.type===a.type&&b.visible&&d.len===e.len&&d.pos===e.pos)c.stacking?(f=b.stackKey,g[f]===t&&(g[f]=i++),h=g[f]):c.grouping!==!1&&(h=i++),b.columnIndex=h});var c=C(M(c.transA)*(c.ordinalSlope||b.pointRange||c.closestPointRange||c.tickInterval||1),c.len),j=c*b.groupPadding,k=(c-2*j)/i,l=b.pointWidth,b=r(l)?(k-l)/2:k*b.pointPadding,l=m(l,k-2*b);return a.columnMetrics={width:l,offset:b+(j+((e?i-(a.columnIndex||
265
+ 0):a.columnIndex)||0)*k-c/2)*(e?-1:1)}},translate:function(){var a=this,b=a.chart,c=a.options,d=a.borderWidth=m(c.borderWidth,a.activePointCount>0.5*a.xAxis.len?0:1),e=a.yAxis,f=a.translatedThreshold=e.getThreshold(c.threshold),g=m(c.minPointLength,5),c=a.getColumnMetrics(),h=c.width,i=a.barW=Ka(v(h,1+2*d)),j=a.pointXOffset=c.offset,k=-(d%2?0.5:0),l=d%2?0.5:1;b.renderer.isVML&&b.inverted&&(l+=1);O.prototype.translate.apply(a);p(a.points,function(c){var d=m(c.yBottom,f),p=C(v(-999-d,c.plotY),e.len+
266
+ 999+d),q=c.plotX+j,r=i,t=C(p,d),x;x=v(p,d)-t;M(x)<g&&g&&(x=g,t=u(M(t-f)>g?d-g:f-(e.translate(c.y,0,1,0,1)<=f?g:0)));c.barX=q;c.pointWidth=h;c.tooltipPos=b.inverted?[e.len-p,a.xAxis.len-q-r/2]:[q+r/2,p];d=M(q)<0.5;r=u(q+r)+k;q=u(q)+k;r-=q;p=M(t)<0.5;x=u(t+x)+l;t=u(t)+l;x-=t;d&&(q+=1,r-=1);p&&(t-=1,x+=1);c.shapeType="rect";c.shapeArgs={x:q,y:t,width:r,height:x}})},getSymbol:sa,drawLegendSymbol:N.drawRectangle,drawGraph:sa,drawPoints:function(){var a=this,b=this.chart,c=a.options,d=b.renderer,e=c.animationLimit||
267
+ 250,f,g,h;p(a.points,function(i){var j=i.plotY,k=i.graphic;if(j!==t&&!isNaN(j)&&i.y!==null)f=i.shapeArgs,h=r(a.borderWidth)?{"stroke-width":a.borderWidth}:{},g=i.pointAttr[i.selected?"select":""]||a.pointAttr[""],k?(bb(k),k.attr(h)[b.pointCount<e?"animate":"attr"](w(f))):i.graphic=d[i.shapeType](f).attr(g).attr(h).add(a.group).shadow(c.shadow,null,c.stacking&&!c.borderRadius);else if(k)i.graphic=k.destroy()})},animate:function(a){var b=this.yAxis,c=this.options,d=this.chart.inverted,e={};if(aa)a?
268
+ (e.scaleY=0.001,a=C(b.pos+b.len,v(b.pos,b.toPixels(c.threshold))),d?e.translateX=a-b.len:e.translateY=a,this.group.attr(e)):(e.scaleY=1,e[d?"translateX":"translateY"]=b.pos,this.group.animate(e,this.options.animation),this.animate=null)},remove:function(){var a=this,b=a.chart;b.hasRendered&&p(b.series,function(b){if(b.type===a.type)b.isDirty=!0});O.prototype.remove.apply(a,arguments)}});F.column=ga;ba.bar=w(ba.column);pa=ka(ga,{type:"bar",inverted:!0});F.bar=pa;ba.scatter=w(S,{lineWidth:0,tooltip:{headerFormat:'<span style="color:{series.color}">●</span> <span style="font-size: 10px;"> {series.name}</span><br/>',
269
+ pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"},stickyTracking:!1});pa=ka(O,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["markerGroup"],takeOrdinalPosition:!1,singularTooltips:!0,drawGraph:function(){this.options.lineWidth&&O.prototype.drawGraph.call(this)}});F.scatter=pa;ba.pie=w(S,{borderColor:"#FFFFFF",borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.point.name}},ignoreHiddenPoint:!0,
270
+ legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,states:{hover:{brightness:0.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}});S={type:"pie",isCartesian:!1,pointClass:ka(Ea,{init:function(){Ea.prototype.init.apply(this,arguments);var a=this,b;if(a.y<0)a.y=null;q(a,{visible:a.visible!==!1,name:m(a.name,"Slice")});b=function(b){a.slice(b.type==="select")};K(a,"select",b);K(a,"unselect",b);return a},setVisible:function(a){var b=this,c=b.series,d=c.chart;b.visible=b.options.visible=
271
+ a=a===t?!b.visible:a;c.options.data[Da(b,c.data)]=b.options;p(["graphic","dataLabel","connector","shadowGroup"],function(c){if(b[c])b[c][a?"show":"hide"](!0)});b.legendItem&&d.legend.colorizeItem(b,a);if(!c.isDirty&&c.options.ignoreHiddenPoint)c.isDirty=!0,d.redraw()},slice:function(a,b,c){var d=this.series;Qa(c,d.chart);m(b,!0);this.sliced=this.options.sliced=a=r(a)?a:!this.sliced;d.options.data[Da(this,d.data)]=this.options;a=a?this.slicedTranslation:{translateX:0,translateY:0};this.graphic.animate(a);
272
+ this.shadowGroup&&this.shadowGroup.animate(a)},haloPath:function(a){var b=this.shapeArgs,c=this.series.chart;return this.series.chart.renderer.symbols.arc(c.plotLeft+b.x,c.plotTop+b.y,b.r+a,b.r+a,{innerR:this.shapeArgs.r,start:b.start,end:b.end})}}),requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},singularTooltips:!0,getColor:sa,animate:function(a){var b=this,c=b.points,d=
273
+ b.startAngleRad;if(!a)p(c,function(a){var c=a.graphic,a=a.shapeArgs;c&&(c.attr({r:b.center[3]/2,start:d,end:d}),c.animate({r:a.r,start:a.start,end:a.end},b.options.animation))}),b.animate=null},setData:function(a,b,c,d){O.prototype.setData.call(this,a,!1,c,d);this.processData();this.generatePoints();m(b,!0)&&this.chart.redraw(c)},generatePoints:function(){var a,b=0,c,d,e,f=this.options.ignoreHiddenPoint;O.prototype.generatePoints.call(this);c=this.points;d=c.length;for(a=0;a<d;a++)e=c[a],b+=f&&!e.visible?
274
+ 0:e.y;this.total=b;for(a=0;a<d;a++)e=c[a],e.percentage=b>0?e.y/b*100:0,e.total=b},translate:function(a){this.generatePoints();var b=0,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f,g,h,i=c.startAngle||0,j=this.startAngleRad=ma/180*(i-90),i=(this.endAngleRad=ma/180*(m(c.endAngle,i+360)-90))-j,k=this.points,l=c.dataLabels.distance,c=c.ignoreHiddenPoint,o,n=k.length,p;if(!a)this.center=a=this.getCenter();this.getX=function(b,c){h=U.asin(C((b-a[1])/(a[2]/2+l),1));return a[0]+(c?-1:1)*Z(h)*(a[2]/
275
+ 2+l)};for(o=0;o<n;o++){p=k[o];f=j+b*i;if(!c||p.visible)b+=p.percentage/100;g=j+b*i;p.shapeType="arc";p.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:u(f*1E3)/1E3,end:u(g*1E3)/1E3};h=(g+f)/2;h>1.5*ma?h-=2*ma:h<-ma/2&&(h+=2*ma);p.slicedTranslation={translateX:u(Z(h)*d),translateY:u(ea(h)*d)};f=Z(h)*a[2]/2;g=ea(h)*a[2]/2;p.tooltipPos=[a[0]+f*0.7,a[1]+g*0.7];p.half=h<-ma/2||h>ma/2?1:0;p.angle=h;e=C(e,l/2);p.labelPos=[a[0]+f+Z(h)*l,a[1]+g+ea(h)*l,a[0]+f+Z(h)*e,a[1]+g+ea(h)*e,a[0]+f,a[1]+g,l<0?
276
+ "center":p.half?"right":"left",h]}},drawGraph:null,drawPoints:function(){var a=this,b=a.chart.renderer,c,d,e=a.options.shadow,f,g;if(e&&!a.shadowGroup)a.shadowGroup=b.g("shadow").add(a.group);p(a.points,function(h){d=h.graphic;g=h.shapeArgs;f=h.shadowGroup;if(e&&!f)f=h.shadowGroup=b.g("shadow").add(a.shadowGroup);c=h.sliced?h.slicedTranslation:{translateX:0,translateY:0};f&&f.attr(c);d?d.animate(q(g,c)):h.graphic=d=b[h.shapeType](g).setRadialReference(a.center).attr(h.pointAttr[h.selected?"select":
277
+ ""]).attr({"stroke-linejoin":"round"}).attr(c).add(a.group).shadow(e,f);h.visible!==void 0&&h.setVisible(h.visible)})},sortByAngle:function(a,b){a.sort(function(a,d){return a.angle!==void 0&&(d.angle-a.angle)*b})},drawLegendSymbol:N.drawRectangle,getCenter:X.getCenter,getSymbol:sa};S=ka(O,S);F.pie=S;O.prototype.drawDataLabels=function(){var a=this,b=a.options,c=b.cursor,d=b.dataLabels,e=a.points,f,g,h,i;if(d.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(d),i=a.plotGroup("dataLabelsGroup",
278
+ "data-labels","hidden",d.zIndex||6),!a.hasRendered&&m(d.defer,!0)&&(i.attr({opacity:0}),K(a,"afterAnimate",function(){a.dataLabelsGroup.show()[b.animation?"animate":"attr"]({opacity:1},{duration:200})})),g=d,p(e,function(b){var e,l=b.dataLabel,o,n,p=b.connector,u=!0;f=b.options&&b.options.dataLabels;e=m(f&&f.enabled,g.enabled);if(l&&!e)b.dataLabel=l.destroy();else if(e){d=w(g,f);e=d.rotation;o=b.getLabelConfig();h=d.format?Ia(d.format,o):d.formatter.call(o,d);d.style.color=m(d.color,d.style.color,
279
+ a.color,"black");if(l)if(r(h))l.attr({text:h}),u=!1;else{if(b.dataLabel=l=l.destroy(),p)b.connector=p.destroy()}else if(r(h)){l={fill:d.backgroundColor,stroke:d.borderColor,"stroke-width":d.borderWidth,r:d.borderRadius||0,rotation:e,padding:d.padding,zIndex:1};for(n in l)l[n]===t&&delete l[n];l=b.dataLabel=a.chart.renderer[e?"text":"label"](h,0,-999,null,null,null,d.useHTML).attr(l).css(q(d.style,c&&{cursor:c})).add(i).shadow(d.shadow)}l&&a.alignDataLabel(b,l,d,null,u)}})};O.prototype.alignDataLabel=
280
+ function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=m(a.plotX,-999),i=m(a.plotY,-999),j=b.getBBox();if(a=this.visible&&(a.series.forceDL||f.isInsidePlot(h,u(i),g)||d&&f.isInsidePlot(h,g?d.x+1:d.y+d.height-1,g)))d=q({x:g?f.plotWidth-i:h,y:u(g?f.plotHeight-h:i),width:0,height:0},d),q(c,{width:j.width,height:j.height}),c.rotation?(g={align:c.align,x:d.x+c.x+d.width/2,y:d.y+c.y+d.height/2},b[e?"attr":"animate"](g)):(b.align(c,null,d),g=b.alignAttr,m(c.overflow,"justify")==="justify"?this.justifyDataLabel(b,
281
+ c,g,j,d,e):m(c.crop,!0)&&(a=f.isInsidePlot(g.x,g.y)&&f.isInsidePlot(g.x+j.width,g.y+j.height)));if(!a)b.attr({y:-999}),b.placed=!1};O.prototype.justifyDataLabel=function(a,b,c,d,e,f){var g=this.chart,h=b.align,i=b.verticalAlign,j,k;j=c.x;if(j<0)h==="right"?b.align="left":b.x=-j,k=!0;j=c.x+d.width;if(j>g.plotWidth)h==="left"?b.align="right":b.x=g.plotWidth-j,k=!0;j=c.y;if(j<0)i==="bottom"?b.verticalAlign="top":b.y=-j,k=!0;j=c.y+d.height;if(j>g.plotHeight)i==="top"?b.verticalAlign="bottom":b.y=g.plotHeight-
282
+ j,k=!0;if(k)a.placed=!f,a.align(b,null,e)};if(F.pie)F.pie.prototype.drawDataLabels=function(){var a=this,b=a.data,c,d=a.chart,e=a.options.dataLabels,f=m(e.connectorPadding,10),g=m(e.connectorWidth,1),h=d.plotWidth,d=d.plotHeight,i,j,k=m(e.softConnector,!0),l=e.distance,o=a.center,n=o[2]/2,q=o[1],r=l>0,t,w,x,y,z=[[],[]],A,C,G,D,B,F=[0,0,0,0],N=function(a,b){return b.y-a.y};if(a.visible&&(e.enabled||a._hasPointLabels)){O.prototype.drawDataLabels.apply(a);p(b,function(a){a.dataLabel&&a.visible&&z[a.half].push(a)});
283
+ for(D=0;!y&&b[D];)y=b[D]&&b[D].dataLabel&&(b[D].dataLabel.getBBox().height||21),D++;for(D=2;D--;){var b=[],K=[],H=z[D],I=H.length,E;a.sortByAngle(H,D-0.5);if(l>0){for(B=q-n-l;B<=q+n+l;B+=y)b.push(B);w=b.length;if(I>w){c=[].concat(H);c.sort(N);for(B=I;B--;)c[B].rank=B;for(B=I;B--;)H[B].rank>=w&&H.splice(B,1);I=H.length}for(B=0;B<I;B++){c=H[B];x=c.labelPos;c=9999;var Q,P;for(P=0;P<w;P++)Q=M(b[P]-x[1]),Q<c&&(c=Q,E=P);if(E<B&&b[B]!==null)E=B;else for(w<I-B+E&&b[B]!==null&&(E=w-I+B);b[E]===null;)E++;K.push({i:E,
284
+ y:b[E]});b[E]=null}K.sort(N)}for(B=0;B<I;B++){c=H[B];x=c.labelPos;t=c.dataLabel;G=c.visible===!1?"hidden":"visible";c=x[1];if(l>0){if(w=K.pop(),E=w.i,C=w.y,c>C&&b[E+1]!==null||c<C&&b[E-1]!==null)C=c}else C=c;A=e.justify?o[0]+(D?-1:1)*(n+l):a.getX(E===0||E===b.length-1?c:C,D);t._attr={visibility:G,align:x[6]};t._pos={x:A+e.x+({left:f,right:-f}[x[6]]||0),y:C+e.y-10};t.connX=A;t.connY=C;if(this.options.size===null)w=t.width,A-w<f?F[3]=v(u(w-A+f),F[3]):A+w>h-f&&(F[1]=v(u(A+w-h+f),F[1])),C-y/2<0?F[0]=
285
+ v(u(-C+y/2),F[0]):C+y/2>d&&(F[2]=v(u(C+y/2-d),F[2]))}}if(Ba(F)===0||this.verifyDataLabelOverflow(F))this.placeDataLabels(),r&&g&&p(this.points,function(b){i=b.connector;x=b.labelPos;if((t=b.dataLabel)&&t._pos)G=t._attr.visibility,A=t.connX,C=t.connY,j=k?["M",A+(x[6]==="left"?5:-5),C,"C",A,C,2*x[2]-x[4],2*x[3]-x[5],x[2],x[3],"L",x[4],x[5]]:["M",A+(x[6]==="left"?5:-5),C,"L",x[2],x[3],"L",x[4],x[5]],i?(i.animate({d:j}),i.attr("visibility",G)):b.connector=i=a.chart.renderer.path(j).attr({"stroke-width":g,
286
+ stroke:e.connectorColor||b.color||"#606060",visibility:G}).add(a.dataLabelsGroup);else if(i)b.connector=i.destroy()})}},F.pie.prototype.placeDataLabels=function(){p(this.points,function(a){var a=a.dataLabel,b;if(a)(b=a._pos)?(a.attr(a._attr),a[a.moved?"animate":"attr"](b),a.moved=!0):a&&a.attr({y:-999})})},F.pie.prototype.alignDataLabel=sa,F.pie.prototype.verifyDataLabelOverflow=function(a){var b=this.center,c=this.options,d=c.center,e=c=c.minSize||80,f;d[0]!==null?e=v(b[2]-v(a[1],a[3]),c):(e=v(b[2]-
287
+ a[1]-a[3],c),b[0]+=(a[3]-a[1])/2);d[1]!==null?e=v(C(e,b[2]-v(a[0],a[2])),c):(e=v(C(e,b[2]-a[0]-a[2]),c),b[1]+=(a[0]-a[2])/2);e<b[2]?(b[2]=e,this.translate(b),p(this.points,function(a){if(a.dataLabel)a.dataLabel._pos=null}),this.drawDataLabels&&this.drawDataLabels()):f=!0;return f};if(F.column)F.column.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=a.dlBox||a.shapeArgs,i=a.below||a.plotY>m(this.translatedThreshold,f.plotSizeY),j=m(c.inside,!!this.options.stacking);if(h&&
288
+ (d=w(h),g&&(d={x:f.plotWidth-d.y-d.height,y:f.plotHeight-d.x-d.width,width:d.height,height:d.width}),!j))g?(d.x+=i?0:d.width,d.width=0):(d.y+=i?d.height:0,d.height=0);c.align=m(c.align,!g||j?"center":i?"right":"left");c.verticalAlign=m(c.verticalAlign,g||j?"middle":i?"top":"bottom");O.prototype.alignDataLabel.call(this,a,b,c,d,e)};S=R.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,d=a.options.cursor,e=d&&{cursor:d},f=function(c){var d=c.target,e;if(b.hoverSeries!==a)a.onMouseOver();
289
+ for(;d&&!e;)e=d.point,d=d.parentNode;if(e!==t&&e!==b.hoverPoint)e.onMouseOver(c)};p(a.points,function(a){if(a.graphic)a.graphic.element.point=a;if(a.dataLabel)a.dataLabel.element.point=a});if(!a._hasTracking)p(a.trackerGroups,function(b){if(a[b]&&(a[b].addClass("highcharts-tracker").on("mouseover",f).on("mouseout",function(a){c.onTrackerMouseOut(a)}).css(e),$a))a[b].on("touchstart",f)}),a._hasTracking=!0},drawTrackerGraph:function(){var a=this,b=a.options,c=b.trackByArea,d=[].concat(c?a.areaPath:
290
+ a.graphPath),e=d.length,f=a.chart,g=f.pointer,h=f.renderer,i=f.options.tooltip.snap,j=a.tracker,k=b.cursor,l=k&&{cursor:k},k=a.singlePoints,m,n=function(){if(f.hoverSeries!==a)a.onMouseOver()},q="rgba(192,192,192,"+(aa?1.0E-4:0.002)+")";if(e&&!c)for(m=e+1;m--;)d[m]==="M"&&d.splice(m+1,0,d[m+1]-i,d[m+2],"L"),(m&&d[m]==="M"||m===e)&&d.splice(m,0,"L",d[m-2]+i,d[m-1]);for(m=0;m<k.length;m++)e=k[m],d.push("M",e.plotX-i,e.plotY,"L",e.plotX+i,e.plotY);j?j.attr({d:d}):(a.tracker=h.path(d).attr({"stroke-linejoin":"round",
291
+ visibility:a.visible?"visible":"hidden",stroke:q,fill:c?q:Q,"stroke-width":b.lineWidth+(c?0:2*i),zIndex:2}).add(a.group),p([a.tracker,a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",n).on("mouseout",function(a){g.onTrackerMouseOut(a)}).css(l);if($a)a.on("touchstart",n)}))}};if(F.column)ga.prototype.drawTracker=S.drawTrackerPoint;if(F.pie)F.pie.prototype.drawTracker=S.drawTrackerPoint;if(F.scatter)pa.prototype.drawTracker=S.drawTrackerPoint;q(lb.prototype,{setItemEvents:function(a,
292
+ b,c,d,e){var f=this;(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover");b.css(f.options.itemHoverStyle)}).on("mouseout",function(){b.css(a.visible?d:e);a.setState()}).on("click",function(b){var c=function(){a.setVisible()},b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):D(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=Y("input",{type:"checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);
293
+ K(a.checkbox,"click",function(b){D(a,"checkboxClick",{checked:b.target.checked},function(){a.select()})})}});E.legend.itemStyle.cursor="pointer";q(Ya.prototype,{showResetZoom:function(){var a=this,b=E.lang,c=a.options.chart.resetZoomButton,d=c.theme,e=d.states,f=c.relativeTo==="chart"?null:"plotBox";this.resetZoomButton=a.renderer.button(b.resetZoom,null,null,function(){a.zoomOut()},d,e&&e.hover).attr({align:c.position.align,title:b.resetZoomTitle}).add().align(c.position,!1,f)},zoomOut:function(){var a=
294
+ this;D(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var b,c=this.pointer,d=!1,e;!a||a.resetSelection?p(this.axes,function(a){b=a.zoom()}):p(a.xAxis.concat(a.yAxis),function(a){var e=a.axis,h=e.isXAxis;if(c[h?"zoomX":"zoomY"]||c[h?"pinchX":"pinchY"])b=e.zoom(a.min,a.max),e.displayBtn&&(d=!0)});e=this.resetZoomButton;if(d&&!e)this.showResetZoom();else if(!d&&ca(e))this.resetZoomButton=e.destroy();b&&this.redraw(m(this.options.chart.animation,a&&a.animation,this.pointCount<
295
+ 100))},pan:function(a,b){var c=this,d=c.hoverPoints,e;d&&p(d,function(a){a.setState()});p(b==="xy"?[1,0]:[1],function(b){var d=a[b?"chartX":"chartY"],h=c[b?"xAxis":"yAxis"][0],i=c[b?"mouseDownX":"mouseDownY"],j=(h.pointRange||0)/2,k=h.getExtremes(),l=h.toValue(i-d,!0)+j,i=h.toValue(i+c[b?"plotWidth":"plotHeight"]-d,!0)-j;h.series.length&&l>C(k.dataMin,k.min)&&i<v(k.dataMax,k.max)&&(h.setExtremes(l,i,!1,!1,{trigger:"pan"}),e=!0);c[b?"mouseDownX":"mouseDownY"]=d});e&&c.redraw(!1);G(c.container,{cursor:"move"})}});
296
+ q(Ea.prototype,{select:function(a,b){var c=this,d=c.series,e=d.chart,a=m(a,!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=c.options.selected=a;d.options.data[Da(c,d.data)]=c.options;c.setState(a&&"select");b||p(e.getSelectedPoints(),function(a){if(a.selected&&a!==c)a.selected=a.options.selected=!1,d.options.data[Da(a,d.data)]=a.options,a.setState(""),a.firePointEvent("unselect")})})},onMouseOver:function(a){var b=this.series,c=b.chart,d=c.tooltip,e=c.hoverPoint;
297
+ if(e&&e!==this)e.onMouseOut();this.firePointEvent("mouseOver");d&&(!d.shared||b.noSharedTooltip)&&d.refresh(this,a);this.setState("hover");c.hoverPoint=this},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints;if(!b||Da(this,b)===-1)this.firePointEvent("mouseOut"),this.setState(),a.hoverPoint=null},importEvents:function(){if(!this.hasImportedEvents){var a=w(this.series.options.point,this.options).events,b;this.events=a;for(b in a)K(this,b,a[b]);this.hasImportedEvents=!0}},setState:function(a,
298
+ b){var c=this.plotX,d=this.plotY,e=this.series,f=e.options.states,g=ba[e.type].marker&&e.options.marker,h=g&&!g.enabled,i=g&&g.states[a],j=i&&i.enabled===!1,k=e.stateMarkerGraphic,l=this.marker||{},m=e.chart,n=e.halo,p,a=a||"";p=this.pointAttr[a]||e.pointAttr[a];if(!(a===this.state&&!b||this.selected&&a!=="select"||f[a]&&f[a].enabled===!1||a&&(j||h&&i.enabled===!1)||a&&l.states&&l.states[a]&&l.states[a].enabled===!1)){if(this.graphic)g=g&&this.graphic.symbolName&&p.r,this.graphic.attr(w(p,g?{x:c-
299
+ g,y:d-g,width:2*g,height:2*g}:{})),k&&k.hide();else{if(a&&i)if(g=i.radius,l=l.symbol||e.symbol,k&&k.currentSymbol!==l&&(k=k.destroy()),k)k[b?"animate":"attr"]({x:c-g,y:d-g});else if(l)e.stateMarkerGraphic=k=m.renderer.symbol(l,c-g,d-g,2*g,2*g).attr(p).add(e.markerGroup),k.currentSymbol=l;if(k)k[a&&m.isInsidePlot(c,d,m.inverted)?"show":"hide"]()}if((c=f[a]&&f[a].halo)&&c.size){if(!n)e.halo=n=m.renderer.path().add(e.seriesGroup);n.attr(q({fill:ya(this.color||e.color).setOpacity(c.opacity).get()},c.attributes))[b?
300
+ "animate":"attr"]({d:this.haloPath(c.size)})}else n&&n.attr({d:[]});this.state=a}},haloPath:function(a){var b=this.series,c=b.chart,d=b.getPlotBox(),e=c.inverted;return c.renderer.symbols.circle(d.translateX+(e?b.yAxis.len-this.plotY:this.plotX)-a,d.translateY+(e?b.xAxis.len-this.plotX:this.plotY)-a,a*2,a*2)}});q(O.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(b&&b!==this)b.onMouseOut();this.options.events.mouseOver&&D(this,"mouseOver");this.setState("hover");a.hoverSeries=
301
+ this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;if(d)d.onMouseOut();this&&a.events.mouseOut&&D(this,"mouseOut");c&&!a.stickyTracking&&(!c.shared||this.noSharedTooltip)&&c.hide();this.setState();b.hoverSeries=null},setState:function(a){var b=this.options,c=this.graph,d=this.graphNeg,e=b.states,b=b.lineWidth,a=a||"";if(this.state!==a)this.state=a,e[a]&&e[a].enabled===!1||(a&&(b=e[a].lineWidth||b+1),c&&!c.dashstyle&&(a={"stroke-width":b},c.attr(a),d&&d.attr(a)))},
302
+ setVisible:function(a,b){var c=this,d=c.chart,e=c.legendItem,f,g=d.options.chart.ignoreHiddenSeries,h=c.visible;f=(c.visible=a=c.userOptions.visible=a===t?!h:a)?"show":"hide";p(["group","dataLabelsGroup","markerGroup","tracker"],function(a){if(c[a])c[a][f]()});if(d.hoverSeries===c)c.onMouseOut();e&&d.legend.colorizeItem(c,a);c.isDirty=!0;c.options.stacking&&p(d.series,function(a){if(a.options.stacking&&a.visible)a.isDirty=!0});p(c.linkedSeries,function(b){b.setVisible(a,!1)});if(g)d.isDirtyBox=!0;
303
+ b!==!1&&d.redraw();D(c,f)},setTooltipPoints:function(a){var b=[],c,d,e=this.xAxis,f=e&&e.getExtremes(),g=e?e.tooltipLen||e.len:this.chart.plotSizeX,h,i,j=[];if(!(this.options.enableMouseTracking===!1||this.singularTooltips)){if(a)this.tooltipPoints=null;p(this.segments||this.points,function(a){b=b.concat(a)});e&&e.reversed&&(b=b.reverse());this.orderTooltipPoints&&this.orderTooltipPoints(b);a=b.length;for(i=0;i<a;i++)if(e=b[i],c=e.x,c>=f.min&&c<=f.max){h=b[i+1];c=d===t?0:d+1;for(d=b[i+1]?C(v(0,T((e.clientX+
304
+ (h?h.wrappedClientX||h.clientX:g))/2)),g):g;c>=0&&c<=d;)j[c++]=e}this.tooltipPoints=j}},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=a===t?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;D(this,a?"select":"unselect")},drawTracker:S.drawTrackerGraph});q(R,{Axis:la,Chart:Ya,Color:ya,Point:Ea,Tick:Sa,Renderer:Za,Series:O,SVGElement:P,SVGRenderer:ta,arrayMin:Na,arrayMax:Ba,charts:V,dateFormat:cb,format:Ia,pathAnim:ub,getOptions:function(){return E},
305
+ hasBidiBug:Nb,isTouchDevice:Jb,numberFormat:Ga,seriesTypes:F,setOptions:function(a){E=w(!0,E,a);Cb();return E},addEvent:K,removeEvent:W,createElement:Y,discardElement:Pa,css:G,each:p,extend:q,map:Ua,merge:w,pick:m,splat:qa,extendClass:ka,pInt:z,wrap:Ma,svg:aa,canvas:fa,vml:!aa&&!fa,product:"Highcharts",version:"4.0.1"})})();
306
  jQuery(document).ready( function ( $ ) {
307
+
308
+ $("#filter_action").select2();
309
+
310
+ $("#filter_content").select2({
311
+ query: function( query ) {
312
+ var key = query.term;
313
+
314
+ $.ajax({
315
+ type: 'POST',
316
+ url: li_admin_ajax.ajax_url,
317
+ data: {
318
+ "action": "leadin_get_posts_and_pages",
319
+ "search_term": key
320
+ },
321
+ success: function(data){
322
+ // Force override the current tracking with the merged value
323
+ var json_data = jQuery.parseJSON(data);
324
+ var data_test = {results: []}, i, j, s;
325
+ for ( i = 0; i < json_data.length; i++ )
326
+ {
327
+ data_test.results.push({id: json_data[i].post_title, text: json_data[i].post_title});
328
+ }
329
+
330
+ query.callback(data_test);
331
+ }
332
+ })
333
+
334
+ },
335
+ initSelection: function(element, callback) {
336
+ if ( $('#filter_content').val() )
337
+ {
338
+ $('#filter_content').select2("data", {id: $('#filter_content').val(), text: $('#filter_content').val()});
339
+ }
340
+ else
341
+ {
342
+ $('#filter_content').select2("data", {id: '', text: 'Any Page'});
343
+ }
344
+ }
345
  });
346
 
347
+ $('#leadin-contact-status').change( function ( e ) {
348
+ $('#leadin-contact-status-button').addClass('button-primary');
349
  });
350
  });
351
  jQuery(document).ready( function ( $ ) {
419
  }
420
 
421
  });
422
+ });
423
+ /*
424
+ Copyright 2012 Igor Vaynberg
425
+
426
+ Version: 3.4.8 Timestamp: Thu May 1 09:50:32 EDT 2014
427
+
428
+ This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
429
+ General Public License version 2 (the "GPL License"). You may choose either license to govern your
430
+ use of this software only upon the condition that you accept all of the terms of either the Apache
431
+ License or the GPL License.
432
+
433
+ You may obtain a copy of the Apache License and the GPL License at:
434
+
435
+ http://www.apache.org/licenses/LICENSE-2.0
436
+ http://www.gnu.org/licenses/gpl-2.0.html
437
+
438
+ Unless required by applicable law or agreed to in writing, software distributed under the
439
+ Apache License or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
440
+ CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
441
+ the specific language governing permissions and limitations under the Apache License and the GPL License.
442
+ */
443
+ (function ($) {
444
+ if(typeof $.fn.each2 == "undefined") {
445
+ $.extend($.fn, {
446
+ /*
447
+ * 4-10 times faster .each replacement
448
+ * use it carefully, as it overrides jQuery context of element on each iteration
449
+ */
450
+ each2 : function (c) {
451
+ var j = $([0]), i = -1, l = this.length;
452
+ while (
453
+ ++i < l
454
+ && (j.context = j[0] = this[i])
455
+ && c.call(j[0], i, j) !== false //"this"=DOM, i=index, j=jQuery object
456
+ );
457
+ return this;
458
+ }
459
+ });
460
+ }
461
+ })(jQuery);
462
+
463
+ (function ($, undefined) {
464
+ "use strict";
465
+ /*global document, window, jQuery, console */
466
+
467
+ if (window.Select2 !== undefined) {
468
+ return;
469
+ }
470
+
471
+ var KEY, AbstractSelect2, SingleSelect2, MultiSelect2, nextUid, sizer,
472
+ lastMousePosition={x:0,y:0}, $document, scrollBarDimensions,
473
+
474
+ KEY = {
475
+ TAB: 9,
476
+ ENTER: 13,
477
+ ESC: 27,
478
+ SPACE: 32,
479
+ LEFT: 37,
480
+ UP: 38,
481
+ RIGHT: 39,
482
+ DOWN: 40,
483
+ SHIFT: 16,
484
+ CTRL: 17,
485
+ ALT: 18,
486
+ PAGE_UP: 33,
487
+ PAGE_DOWN: 34,
488
+ HOME: 36,
489
+ END: 35,
490
+ BACKSPACE: 8,
491
+ DELETE: 46,
492
+ isArrow: function (k) {
493
+ k = k.which ? k.which : k;
494
+ switch (k) {
495
+ case KEY.LEFT:
496
+ case KEY.RIGHT:
497
+ case KEY.UP:
498
+ case KEY.DOWN:
499
+ return true;
500
+ }
501
+ return false;
502
+ },
503
+ isControl: function (e) {
504
+ var k = e.which;
505
+ switch (k) {
506
+ case KEY.SHIFT:
507
+ case KEY.CTRL:
508
+ case KEY.ALT:
509
+ return true;
510
+ }
511
+
512
+ if (e.metaKey) return true;
513
+
514
+ return false;
515
+ },
516
+ isFunctionKey: function (k) {
517
+ k = k.which ? k.which : k;
518
+ return k >= 112 && k <= 123;
519
+ }
520
+ },
521
+ MEASURE_SCROLLBAR_TEMPLATE = "<div class='select2-measure-scrollbar'></div>",
522
+
523
+ DIACRITICS = {"\u24B6":"A","\uFF21":"A","\u00C0":"A","\u00C1":"A","\u00C2":"A","\u1EA6":"A","\u1EA4":"A","\u1EAA":"A","\u1EA8":"A","\u00C3":"A","\u0100":"A","\u0102":"A","\u1EB0":"A","\u1EAE":"A","\u1EB4":"A","\u1EB2":"A","\u0226":"A","\u01E0":"A","\u00C4":"A","\u01DE":"A","\u1EA2":"A","\u00C5":"A","\u01FA":"A","\u01CD":"A","\u0200":"A","\u0202":"A","\u1EA0":"A","\u1EAC":"A","\u1EB6":"A","\u1E00":"A","\u0104":"A","\u023A":"A","\u2C6F":"A","\uA732":"AA","\u00C6":"AE","\u01FC":"AE","\u01E2":"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B","\uFF22":"B","\u1E02":"B","\u1E04":"B","\u1E06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24B8":"C","\uFF23":"C","\u0106":"C","\u0108":"C","\u010A":"C","\u010C":"C","\u00C7":"C","\u1E08":"C","\u0187":"C","\u023B":"C","\uA73E":"C","\u24B9":"D","\uFF24":"D","\u1E0A":"D","\u010E":"D","\u1E0C":"D","\u1E10":"D","\u1E12":"D","\u1E0E":"D","\u0110":"D","\u018B":"D","\u018A":"D","\u0189":"D","\uA779":"D","\u01F1":"DZ","\u01C4":"DZ","\u01F2":"Dz","\u01C5":"Dz","\u24BA":"E","\uFF25":"E","\u00C8":"E","\u00C9":"E","\u00CA":"E","\u1EC0":"E","\u1EBE":"E","\u1EC4":"E","\u1EC2":"E","\u1EBC":"E","\u0112":"E","\u1E14":"E","\u1E16":"E","\u0114":"E","\u0116":"E","\u00CB":"E","\u1EBA":"E","\u011A":"E","\u0204":"E","\u0206":"E","\u1EB8":"E","\u1EC6":"E","\u0228":"E","\u1E1C":"E","\u0118":"E","\u1E18":"E","\u1E1A":"E","\u0190":"E","\u018E":"E","\u24BB":"F","\uFF26":"F","\u1E1E":"F","\u0191":"F","\uA77B":"F","\u24BC":"G","\uFF27":"G","\u01F4":"G","\u011C":"G","\u1E20":"G","\u011E":"G","\u0120":"G","\u01E6":"G","\u0122":"G","\u01E4":"G","\u0193":"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H","\uFF28":"H","\u0124":"H","\u1E22":"H","\u1E26":"H","\u021E":"H","\u1E24":"H","\u1E28":"H","\u1E2A":"H","\u0126":"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I","\uFF29":"I","\u00CC":"I","\u00CD":"I","\u00CE":"I","\u0128":"I","\u012A":"I","\u012C":"I","\u0130":"I","\u00CF":"I","\u1E2E":"I","\u1EC8":"I","\u01CF":"I","\u0208":"I","\u020A":"I","\u1ECA":"I","\u012E":"I","\u1E2C":"I","\u0197":"I","\u24BF":"J","\uFF2A":"J","\u0134":"J","\u0248":"J","\u24C0":"K","\uFF2B":"K","\u1E30":"K","\u01E8":"K","\u1E32":"K","\u0136":"K","\u1E34":"K","\u0198":"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L","\uFF2C":"L","\u013F":"L","\u0139":"L","\u013D":"L","\u1E36":"L","\u1E38":"L","\u013B":"L","\u1E3C":"L","\u1E3A":"L","\u0141":"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L","\u01C7":"LJ","\u01C8":"Lj","\u24C2":"M","\uFF2D":"M","\u1E3E":"M","\u1E40":"M","\u1E42":"M","\u2C6E":"M","\u019C":"M","\u24C3":"N","\uFF2E":"N","\u01F8":"N","\u0143":"N","\u00D1":"N","\u1E44":"N","\u0147":"N","\u1E46":"N","\u0145":"N","\u1E4A":"N","\u1E48":"N","\u0220":"N","\u019D":"N","\uA790":"N","\uA7A4":"N","\u01CA":"NJ","\u01CB":"Nj","\u24C4":"O","\uFF2F":"O","\u00D2":"O","\u00D3":"O","\u00D4":"O","\u1ED2":"O","\u1ED0":"O","\u1ED6":"O","\u1ED4":"O","\u00D5":"O","\u1E4C":"O","\u022C":"O","\u1E4E":"O","\u014C":"O","\u1E50":"O","\u1E52":"O","\u014E":"O","\u022E":"O","\u0230":"O","\u00D6":"O","\u022A":"O","\u1ECE":"O","\u0150":"O","\u01D1":"O","\u020C":"O","\u020E":"O","\u01A0":"O","\u1EDC":"O","\u1EDA":"O","\u1EE0":"O","\u1EDE":"O","\u1EE2":"O","\u1ECC":"O","\u1ED8":"O","\u01EA":"O","\u01EC":"O","\u00D8":"O","\u01FE":"O","\u0186":"O","\u019F":"O","\uA74A":"O","\uA74C":"O","\u01A2":"OI","\uA74E":"OO","\u0222":"OU","\u24C5":"P","\uFF30":"P","\u1E54":"P","\u1E56":"P","\u01A4":"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q","\uFF31":"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R","\uFF32":"R","\u0154":"R","\u1E58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1E5A":"R","\u1E5C":"R","\u0156":"R","\u1E5E":"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S","\uFF33":"S","\u1E9E":"S","\u015A":"S","\u1E64":"S","\u015C":"S","\u1E60":"S","\u0160":"S","\u1E66":"S","\u1E62":"S","\u1E68":"S","\u0218":"S","\u015E":"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u24C9":"T","\uFF34":"T","\u1E6A":"T","\u0164":"T","\u1E6C":"T","\u021A":"T","\u0162":"T","\u1E70":"T","\u1E6E":"T","\u0166":"T","\u01AC":"T","\u01AE":"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U","\uFF35":"U","\u00D9":"U","\u00DA":"U","\u00DB":"U","\u0168":"U","\u1E78":"U","\u016A":"U","\u1E7A":"U","\u016C":"U","\u00DC":"U","\u01DB":"U","\u01D7":"U","\u01D5":"U","\u01D9":"U","\u1EE6":"U","\u016E":"U","\u0170":"U","\u01D3":"U","\u0214":"U","\u0216":"U","\u01AF":"U","\u1EEA":"U","\u1EE8":"U","\u1EEE":"U","\u1EEC":"U","\u1EF0":"U","\u1EE4":"U","\u1E72":"U","\u0172":"U","\u1E76":"U","\u1E74":"U","\u0244":"U","\u24CB":"V","\uFF36":"V","\u1E7C":"V","\u1E7E":"V","\u01B2":"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W","\uFF37":"W","\u1E80":"W","\u1E82":"W","\u0174":"W","\u1E86":"W","\u1E84":"W","\u1E88":"W","\u2C72":"W","\u24CD":"X","\uFF38":"X","\u1E8A":"X","\u1E8C":"X","\u24CE":"Y","\uFF39":"Y","\u1EF2":"Y","\u00DD":"Y","\u0176":"Y","\u1EF8":"Y","\u0232":"Y","\u1E8E":"Y","\u0178":"Y","\u1EF6":"Y","\u1EF4":"Y","\u01B3":"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z","\uFF3A":"Z","\u0179":"Z","\u1E90":"Z","\u017B":"Z","\u017D":"Z","\u1E92":"Z","\u1E94":"Z","\u01B5":"Z","\u0224":"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a","\uFF41":"a","\u1E9A":"a","\u00E0":"a","\u00E1":"a","\u00E2":"a","\u1EA7":"a","\u1EA5":"a","\u1EAB":"a","\u1EA9":"a","\u00E3":"a","\u0101":"a","\u0103":"a","\u1EB1":"a","\u1EAF":"a","\u1EB5":"a","\u1EB3":"a","\u0227":"a","\u01E1":"a","\u00E4":"a","\u01DF":"a","\u1EA3":"a","\u00E5":"a","\u01FB":"a","\u01CE":"a","\u0201":"a","\u0203":"a","\u1EA1":"a","\u1EAD":"a","\u1EB7":"a","\u1E01":"a","\u0105":"a","\u2C65":"a","\u0250":"a","\uA733":"aa","\u00E6":"ae","\u01FD":"ae","\u01E3":"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b","\uFF42":"b","\u1E03":"b","\u1E05":"b","\u1E07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24D2":"c","\uFF43":"c","\u0107":"c","\u0109":"c","\u010B":"c","\u010D":"c","\u00E7":"c","\u1E09":"c","\u0188":"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d","\uFF44":"d","\u1E0B":"d","\u010F":"d","\u1E0D":"d","\u1E11":"d","\u1E13":"d","\u1E0F":"d","\u0111":"d","\u018C":"d","\u0256":"d","\u0257":"d","\uA77A":"d","\u01F3":"dz","\u01C6":"dz","\u24D4":"e","\uFF45":"e","\u00E8":"e","\u00E9":"e","\u00EA":"e","\u1EC1":"e","\u1EBF":"e","\u1EC5":"e","\u1EC3":"e","\u1EBD":"e","\u0113":"e","\u1E15":"e","\u1E17":"e","\u0115":"e","\u0117":"e","\u00EB":"e","\u1EBB":"e","\u011B":"e","\u0205":"e","\u0207":"e","\u1EB9":"e","\u1EC7":"e","\u0229":"e","\u1E1D":"e","\u0119":"e","\u1E19":"e","\u1E1B":"e","\u0247":"e","\u025B":"e","\u01DD":"e","\u24D5":"f","\uFF46":"f","\u1E1F":"f","\u0192":"f","\uA77C":"f","\u24D6":"g","\uFF47":"g","\u01F5":"g","\u011D":"g","\u1E21":"g","\u011F":"g","\u0121":"g","\u01E7":"g","\u0123":"g","\u01E5":"g","\u0260":"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h","\uFF48":"h","\u0125":"h","\u1E23":"h","\u1E27":"h","\u021F":"h","\u1E25":"h","\u1E29":"h","\u1E2B":"h","\u1E96":"h","\u0127":"h","\u2C68":"h","\u2C76":"h","\u0265":"h","\u0195":"hv","\u24D8":"i","\uFF49":"i","\u00EC":"i","\u00ED":"i","\u00EE":"i","\u0129":"i","\u012B":"i","\u012D":"i","\u00EF":"i","\u1E2F":"i","\u1EC9":"i","\u01D0":"i","\u0209":"i","\u020B":"i","\u1ECB":"i","\u012F":"i","\u1E2D":"i","\u0268":"i","\u0131":"i","\u24D9":"j","\uFF4A":"j","\u0135":"j","\u01F0":"j","\u0249":"j","\u24DA":"k","\uFF4B":"k","\u1E31":"k","\u01E9":"k","\u1E33":"k","\u0137":"k","\u1E35":"k","\u0199":"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l","\uFF4C":"l","\u0140":"l","\u013A":"l","\u013E":"l","\u1E37":"l","\u1E39":"l","\u013C":"l","\u1E3D":"l","\u1E3B":"l","\u017F":"l","\u0142":"l","\u019A":"l","\u026B":"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l","\u01C9":"lj","\u24DC":"m","\uFF4D":"m","\u1E3F":"m","\u1E41":"m","\u1E43":"m","\u0271":"m","\u026F":"m","\u24DD":"n","\uFF4E":"n","\u01F9":"n","\u0144":"n","\u00F1":"n","\u1E45":"n","\u0148":"n","\u1E47":"n","\u0146":"n","\u1E4B":"n","\u1E49":"n","\u019E":"n","\u0272":"n","\u0149":"n","\uA791":"n","\uA7A5":"n","\u01CC":"nj","\u24DE":"o","\uFF4F":"o","\u00F2":"o","\u00F3":"o","\u00F4":"o","\u1ED3":"o","\u1ED1":"o","\u1ED7":"o","\u1ED5":"o","\u00F5":"o","\u1E4D":"o","\u022D":"o","\u1E4F":"o","\u014D":"o","\u1E51":"o","\u1E53":"o","\u014F":"o","\u022F":"o","\u0231":"o","\u00F6":"o","\u022B":"o","\u1ECF":"o","\u0151":"o","\u01D2":"o","\u020D":"o","\u020F":"o","\u01A1":"o","\u1EDD":"o","\u1EDB":"o","\u1EE1":"o","\u1EDF":"o","\u1EE3":"o","\u1ECD":"o","\u1ED9":"o","\u01EB":"o","\u01ED":"o","\u00F8":"o","\u01FF":"o","\u0254":"o","\uA74B":"o","\uA74D":"o","\u0275":"o","\u01A3":"oi","\u0223":"ou","\uA74F":"oo","\u24DF":"p","\uFF50":"p","\u1E55":"p","\u1E57":"p","\u01A5":"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q","\uFF51":"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r","\uFF52":"r","\u0155":"r","\u1E59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1E5B":"r","\u1E5D":"r","\u0157":"r","\u1E5F":"r","\u024D":"r","\u027D":"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s","\uFF53":"s","\u00DF":"s","\u015B":"s","\u1E65":"s","\u015D":"s","\u1E61":"s","\u0161":"s","\u1E67":"s","\u1E63":"s","\u1E69":"s","\u0219":"s","\u015F":"s","\u023F":"s","\uA7A9":"s","\uA785":"s","\u1E9B":"s","\u24E3":"t","\uFF54":"t","\u1E6B":"t","\u1E97":"t","\u0165":"t","\u1E6D":"t","\u021B":"t","\u0163":"t","\u1E71":"t","\u1E6F":"t","\u0167":"t","\u01AD":"t","\u0288":"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u","\uFF55":"u","\u00F9":"u","\u00FA":"u","\u00FB":"u","\u0169":"u","\u1E79":"u","\u016B":"u","\u1E7B":"u","\u016D":"u","\u00FC":"u","\u01DC":"u","\u01D8":"u","\u01D6":"u","\u01DA":"u","\u1EE7":"u","\u016F":"u","\u0171":"u","\u01D4":"u","\u0215":"u","\u0217":"u","\u01B0":"u","\u1EEB":"u","\u1EE9":"u","\u1EEF":"u","\u1EED":"u","\u1EF1":"u","\u1EE5":"u","\u1E73":"u","\u0173":"u","\u1E77":"u","\u1E75":"u","\u0289":"u","\u24E5":"v","\uFF56":"v","\u1E7D":"v","\u1E7F":"v","\u028B":"v","\uA75F":"v","\u028C":"v","\uA761":"vy","\u24E6":"w","\uFF57":"w","\u1E81":"w","\u1E83":"w","\u0175":"w","\u1E87":"w","\u1E85":"w","\u1E98":"w","\u1E89":"w","\u2C73":"w","\u24E7":"x","\uFF58":"x","\u1E8B":"x","\u1E8D":"x","\u24E8":"y","\uFF59":"y","\u1EF3":"y","\u00FD":"y","\u0177":"y","\u1EF9":"y","\u0233":"y","\u1E8F":"y","\u00FF":"y","\u1EF7":"y","\u1E99":"y","\u1EF5":"y","\u01B4":"y","\u024F":"y","\u1EFF":"y","\u24E9":"z","\uFF5A":"z","\u017A":"z","\u1E91":"z","\u017C":"z","\u017E":"z","\u1E93":"z","\u1E95":"z","\u01B6":"z","\u0225":"z","\u0240":"z","\u2C6C":"z","\uA763":"z"};
524
+
525
+ $document = $(document);
526
+
527
+ nextUid=(function() { var counter=1; return function() { return counter++; }; }());
528
+
529
+
530
+ function reinsertElement(element) {
531
+ var placeholder = $(document.createTextNode(''));
532
+
533
+ element.before(placeholder);
534
+ placeholder.before(element);
535
+ placeholder.remove();
536
+ }
537
+
538
+ function stripDiacritics(str) {
539
+ // Used 'uni range + named function' from http://jsperf.com/diacritics/18
540
+ function match(a) {
541
+ return DIACRITICS[a] || a;
542
+ }
543
+
544
+ return str.replace(/[^\u0000-\u007E]/g, match);
545
+ }
546
+
547
+ function indexOf(value, array) {
548
+ var i = 0, l = array.length;
549
+ for (; i < l; i = i + 1) {
550
+ if (equal(value, array[i])) return i;
551
+ }
552
+ return -1;
553
+ }
554
+
555
+ function measureScrollbar () {
556
+ var $template = $( MEASURE_SCROLLBAR_TEMPLATE );
557
+ $template.appendTo('body');
558
+
559
+ var dim = {
560
+ width: $template.width() - $template[0].clientWidth,
561
+ height: $template.height() - $template[0].clientHeight
562
+ };
563
+ $template.remove();
564
+
565
+ return dim;
566
+ }
567
+
568
+ /**
569
+ * Compares equality of a and b
570
+ * @param a
571
+ * @param b
572
+ */
573
+ function equal(a, b) {
574
+ if (a === b) return true;
575
+ if (a === undefined || b === undefined) return false;
576
+ if (a === null || b === null) return false;
577
+ // Check whether 'a' or 'b' is a string (primitive or object).
578
+ // The concatenation of an empty string (+'') converts its argument to a string's primitive.
579
+ if (a.constructor === String) return a+'' === b+''; // a+'' - in case 'a' is a String object
580
+ if (b.constructor === String) return b+'' === a+''; // b+'' - in case 'b' is a String object
581
+ return false;
582
+ }
583
+
584
+ /**
585
+ * Splits the string into an array of values, trimming each value. An empty array is returned for nulls or empty
586
+ * strings
587
+ * @param string
588
+ * @param separator
589
+ */
590
+ function splitVal(string, separator) {
591
+ var val, i, l;
592
+ if (string === null || string.length < 1) return [];
593
+ val = string.split(separator);
594
+ for (i = 0, l = val.length; i < l; i = i + 1) val[i] = $.trim(val[i]);
595
+ return val;
596
+ }
597
+
598
+ function getSideBorderPadding(element) {
599
+ return element.outerWidth(false) - element.width();
600
+ }
601
+
602
+ function installKeyUpChangeEvent(element) {
603
+ var key="keyup-change-value";
604
+ element.on("keydown", function () {
605
+ if ($.data(element, key) === undefined) {
606
+ $.data(element, key, element.val());
607
+ }
608
+ });
609
+ element.on("keyup", function () {
610
+ var val= $.data(element, key);
611
+ if (val !== undefined && element.val() !== val) {
612
+ $.removeData(element, key);
613
+ element.trigger("keyup-change");
614
+ }
615
+ });
616
+ }
617
+
618
+ $document.on("mousemove", function (e) {
619
+ lastMousePosition.x = e.pageX;
620
+ lastMousePosition.y = e.pageY;
621
+ });
622
+
623
+ /**
624
+ * filters mouse events so an event is fired only if the mouse moved.
625
+ *
626
+ * filters out mouse events that occur when mouse is stationary but
627
+ * the elements under the pointer are scrolled.
628
+ */
629
+ function installFilteredMouseMove(element) {
630
+ element.on("mousemove", function (e) {
631
+ var lastpos = lastMousePosition;
632
+ if (lastpos === undefined || lastpos.x !== e.pageX || lastpos.y !== e.pageY) {
633
+ $(e.target).trigger("mousemove-filtered", e);
634
+ }
635
+ });
636
+ }
637
+
638
+ /**
639
+ * Debounces a function. Returns a function that calls the original fn function only if no invocations have been made
640
+ * within the last quietMillis milliseconds.
641
+ *
642
+ * @param quietMillis number of milliseconds to wait before invoking fn
643
+ * @param fn function to be debounced
644
+ * @param ctx object to be used as this reference within fn
645
+ * @return debounced version of fn
646
+ */
647
+ function debounce(quietMillis, fn, ctx) {
648
+ ctx = ctx || undefined;
649
+ var timeout;
650
+ return function () {
651
+ var args = arguments;
652
+ window.clearTimeout(timeout);
653
+ timeout = window.setTimeout(function() {
654
+ fn.apply(ctx, args);
655
+ }, quietMillis);
656
+ };
657
+ }
658
+
659
+ function installDebouncedScroll(threshold, element) {
660
+ var notify = debounce(threshold, function (e) { element.trigger("scroll-debounced", e);});
661
+ element.on("scroll", function (e) {
662
+ if (indexOf(e.target, element.get()) >= 0) notify(e);
663
+ });
664
+ }
665
+
666
+ function focus($el) {
667
+ if ($el[0] === document.activeElement) return;
668
+
669
+ /* set the focus in a 0 timeout - that way the focus is set after the processing
670
+ of the current event has finished - which seems like the only reliable way
671
+ to set focus */
672
+ window.setTimeout(function() {
673
+ var el=$el[0], pos=$el.val().length, range;
674
+
675
+ $el.focus();
676
+
677
+ /* make sure el received focus so we do not error out when trying to manipulate the caret.
678
+ sometimes modals or others listeners may steal it after its set */
679
+ var isVisible = (el.offsetWidth > 0 || el.offsetHeight > 0);
680
+ if (isVisible && el === document.activeElement) {
681
+
682
+ /* after the focus is set move the caret to the end, necessary when we val()
683
+ just before setting focus */
684
+ if(el.setSelectionRange)
685
+ {
686
+ el.setSelectionRange(pos, pos);
687
+ }
688
+ else if (el.createTextRange) {
689
+ range = el.createTextRange();
690
+ range.collapse(false);
691
+ range.select();
692
+ }
693
+ }
694
+ }, 0);
695
+ }
696
+
697
+ function getCursorInfo(el) {
698
+ el = $(el)[0];
699
+ var offset = 0;
700
+ var length = 0;
701
+ if ('selectionStart' in el) {
702
+ offset = el.selectionStart;
703
+ length = el.selectionEnd - offset;
704
+ } else if ('selection' in document) {
705
+ el.focus();
706
+ var sel = document.selection.createRange();
707
+ length = document.selection.createRange().text.length;
708
+ sel.moveStart('character', -el.value.length);
709
+ offset = sel.text.length - length;
710
+ }
711
+ return { offset: offset, length: length };
712
+ }
713
+
714
+ function killEvent(event) {
715
+ event.preventDefault();
716
+ event.stopPropagation();
717
+ }
718
+ function killEventImmediately(event) {
719
+ event.preventDefault();
720
+ event.stopImmediatePropagation();
721
+ }
722
+
723
+ function measureTextWidth(e) {
724
+ if (!sizer){
725
+ var style = e[0].currentStyle || window.getComputedStyle(e[0], null);
726
+ sizer = $(document.createElement("div")).css({
727
+ position: "absolute",
728
+ left: "-10000px",
729
+ top: "-10000px",
730
+ display: "none",
731
+ fontSize: style.fontSize,
732
+ fontFamily: style.fontFamily,
733
+ fontStyle: style.fontStyle,
734
+ fontWeight: style.fontWeight,
735
+ letterSpacing: style.letterSpacing,
736
+ textTransform: style.textTransform,
737
+ whiteSpace: "nowrap"
738
+ });
739
+ sizer.attr("class","select2-sizer");
740
+ $("body").append(sizer);
741
+ }
742
+ sizer.text(e.val());
743
+ return sizer.width();
744
+ }
745
+
746
+ function syncCssClasses(dest, src, adapter) {
747
+ var classes, replacements = [], adapted;
748
+
749
+ classes = dest.attr("class");
750
+ if (classes) {
751
+ classes = '' + classes; // for IE which returns object
752
+ $(classes.split(" ")).each2(function() {
753
+ if (this.indexOf("select2-") === 0) {
754
+ replacements.push(this);
755
+ }
756
+ });
757
+ }
758
+ classes = src.attr("class");
759
+ if (classes) {
760
+ classes = '' + classes; // for IE which returns object
761
+ $(classes.split(" ")).each2(function() {
762
+ if (this.indexOf("select2-") !== 0) {
763
+ adapted = adapter(this);
764
+ if (adapted) {
765
+ replacements.push(adapted);
766
+ }
767
+ }
768
+ });
769
+ }
770
+ dest.attr("class", replacements.join(" "));
771
+ }
772
+
773
+
774
+ function markMatch(text, term, markup, escapeMarkup) {
775
+ var match=stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase())),
776
+ tl=term.length;
777
+
778
+ if (match<0) {
779
+ markup.push(escapeMarkup(text));
780
+ return;
781
+ }
782
+
783
+ markup.push(escapeMarkup(text.substring(0, match)));
784
+ markup.push("<span class='select2-match'>");
785
+ markup.push(escapeMarkup(text.substring(match, match + tl)));
786
+ markup.push("</span>");
787
+ markup.push(escapeMarkup(text.substring(match + tl, text.length)));
788
+ }
789
+
790
+ function defaultEscapeMarkup(markup) {
791
+ var replace_map = {
792
+ '\\': '&#92;',
793
+ '&': '&amp;',
794
+ '<': '&lt;',
795
+ '>': '&gt;',
796
+ '"': '&quot;',
797
+ "'": '&#39;',
798
+ "/": '&#47;'
799
+ };
800
+
801
+ return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
802
+ return replace_map[match];
803
+ });
804
+ }
805
+
806
+ /**
807
+ * Produces an ajax-based query function
808
+ *
809
+ * @param options object containing configuration parameters
810
+ * @param options.params parameter map for the transport ajax call, can contain such options as cache, jsonpCallback, etc. see $.ajax
811
+ * @param options.transport function that will be used to execute the ajax request. must be compatible with parameters supported by $.ajax
812
+ * @param options.url url for the data
813
+ * @param options.data a function(searchTerm, pageNumber, context) that should return an object containing query string parameters for the above url.
814
+ * @param options.dataType request data type: ajax, jsonp, other datatypes supported by jQuery's $.ajax function or the transport function if specified
815
+ * @param options.quietMillis (optional) milliseconds to wait before making the ajaxRequest, helps debounce the ajax function if invoked too often
816
+ * @param options.results a function(remoteData, pageNumber) that converts data returned form the remote request to the format expected by Select2.
817
+ * The expected format is an object containing the following keys:
818
+ * results array of objects that will be used as choices
819
+ * more (optional) boolean indicating whether there are more results available
820
+ * Example: {results:[{id:1, text:'Red'},{id:2, text:'Blue'}], more:true}
821
+ */
822
+ function ajax(options) {
823
+ var timeout, // current scheduled but not yet executed request
824
+ handler = null,
825
+ quietMillis = options.quietMillis || 100,
826
+ ajaxUrl = options.url,
827
+ self = this;
828
+
829
+ return function (query) {
830
+ window.clearTimeout(timeout);
831
+ timeout = window.setTimeout(function () {
832
+ var data = options.data, // ajax data function
833
+ url = ajaxUrl, // ajax url string or function
834
+ transport = options.transport || $.fn.select2.ajaxDefaults.transport,
835
+ // deprecated - to be removed in 4.0 - use params instead
836
+ deprecated = {
837
+ type: options.type || 'GET', // set type of request (GET or POST)
838
+ cache: options.cache || false,
839
+ jsonpCallback: options.jsonpCallback||undefined,
840
+ dataType: options.dataType||"json"
841
+ },
842
+ params = $.extend({}, $.fn.select2.ajaxDefaults.params, deprecated);
843
+
844
+ data = data ? data.call(self, query.term, query.page, query.context) : null;
845
+ url = (typeof url === 'function') ? url.call(self, query.term, query.page, query.context) : url;
846
+
847
+ if (handler && typeof handler.abort === "function") { handler.abort(); }
848
+
849
+ if (options.params) {
850
+ if ($.isFunction(options.params)) {
851
+ $.extend(params, options.params.call(self));
852
+ } else {
853
+ $.extend(params, options.params);
854
+ }
855
+ }
856
+
857
+ $.extend(params, {
858
+ url: url,
859
+ dataType: options.dataType,
860
+ data: data,
861
+ success: function (data) {
862
+ // TODO - replace query.page with query so users have access to term, page, etc.
863
+ var results = options.results(data, query.page);
864
+ query.callback(results);
865
+ }
866
+ });
867
+ handler = transport.call(self, params);
868
+ }, quietMillis);
869
+ };
870
+ }
871
+
872
+ /**
873
+ * Produces a query function that works with a local array
874
+ *
875
+ * @param options object containing configuration parameters. The options parameter can either be an array or an
876
+ * object.
877
+ *
878
+ * If the array form is used it is assumed that it contains objects with 'id' and 'text' keys.
879
+ *
880
+ * If the object form is used it is assumed that it contains 'data' and 'text' keys. The 'data' key should contain
881
+ * an array of objects that will be used as choices. These objects must contain at least an 'id' key. The 'text'
882
+ * key can either be a String in which case it is expected that each element in the 'data' array has a key with the
883
+ * value of 'text' which will be used to match choices. Alternatively, text can be a function(item) that can extract
884
+ * the text.
885
+ */
886
+ function local(options) {
887
+ var data = options, // data elements
888
+ dataText,
889
+ tmp,
890
+ text = function (item) { return ""+item.text; }; // function used to retrieve the text portion of a data item that is matched against the search
891
+
892
+ if ($.isArray(data)) {
893
+ tmp = data;
894
+ data = { results: tmp };
895
+ }
896
+
897
+ if ($.isFunction(data) === false) {
898
+ tmp = data;
899
+ data = function() { return tmp; };
900
+ }
901
+
902
+ var dataItem = data();
903
+ if (dataItem.text) {
904
+ text = dataItem.text;
905
+ // if text is not a function we assume it to be a key name
906
+ if (!$.isFunction(text)) {
907
+ dataText = dataItem.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available
908
+ text = function (item) { return item[dataText]; };
909
+ }
910
+ }
911
+
912
+ return function (query) {
913
+ var t = query.term, filtered = { results: [] }, process;
914
+ if (t === "") {
915
+ query.callback(data());
916
+ return;
917
+ }
918
+
919
+ process = function(datum, collection) {
920
+ var group, attr;
921
+ datum = datum[0];
922
+ if (datum.children) {
923
+ group = {};
924
+ for (attr in datum) {
925
+ if (datum.hasOwnProperty(attr)) group[attr]=datum[attr];
926
+ }
927
+ group.children=[];
928
+ $(datum.children).each2(function(i, childDatum) { process(childDatum, group.children); });
929
+ if (group.children.length || query.matcher(t, text(group), datum)) {
930
+ collection.push(group);
931
+ }
932
+ } else {
933
+ if (query.matcher(t, text(datum), datum)) {
934
+ collection.push(datum);
935
+ }
936
+ }
937
+ };
938
+
939
+ $(data().results).each2(function(i, datum) { process(datum, filtered.results); });
940
+ query.callback(filtered);
941
+ };
942
+ }
943
+
944
+ // TODO javadoc
945
+ function tags(data) {
946
+ var isFunc = $.isFunction(data);
947
+ return function (query) {
948
+ var t = query.term, filtered = {results: []};
949
+ var result = isFunc ? data(query) : data;
950
+ if ($.isArray(result)) {
951
+ $(result).each(function () {
952
+ var isObject = this.text !== undefined,
953
+ text = isObject ? this.text : this;
954
+ if (t === "" || query.matcher(t, text)) {
955
+ filtered.results.push(isObject ? this : {id: this, text: this});
956
+ }
957
+ });
958
+ query.callback(filtered);
959
+ }
960
+ };
961
+ }
962
+
963
+ /**
964
+ * Checks if the formatter function should be used.
965
+ *
966
+ * Throws an error if it is not a function. Returns true if it should be used,
967
+ * false if no formatting should be performed.
968
+ *
969
+ * @param formatter
970
+ */
971
+ function checkFormatter(formatter, formatterName) {
972
+ if ($.isFunction(formatter)) return true;
973
+ if (!formatter) return false;
974
+ if (typeof(formatter) === 'string') return true;
975
+ throw new Error(formatterName +" must be a string, function, or falsy value");
976
+ }
977
+
978
+ function evaluate(val) {
979
+ if ($.isFunction(val)) {
980
+ var args = Array.prototype.slice.call(arguments, 1);
981
+ return val.apply(null, args);
982
+ }
983
+ return val;
984
+ }
985
+
986
+ function countResults(results) {
987
+ var count = 0;
988
+ $.each(results, function(i, item) {
989
+ if (item.children) {
990
+ count += countResults(item.children);
991
+ } else {
992
+ count++;
993
+ }
994
+ });
995
+ return count;
996
+ }
997
+
998
+ /**
999
+ * Default tokenizer. This function uses breaks the input on substring match of any string from the
1000
+ * opts.tokenSeparators array and uses opts.createSearchChoice to create the choice object. Both of those
1001
+ * two options have to be defined in order for the tokenizer to work.
1002
+ *
1003
+ * @param input text user has typed so far or pasted into the search field
1004
+ * @param selection currently selected choices
1005
+ * @param selectCallback function(choice) callback tho add the choice to selection
1006
+ * @param opts select2's opts
1007
+ * @return undefined/null to leave the current input unchanged, or a string to change the input to the returned value
1008
+ */
1009
+ function defaultTokenizer(input, selection, selectCallback, opts) {
1010
+ var original = input, // store the original so we can compare and know if we need to tell the search to update its text
1011
+ dupe = false, // check for whether a token we extracted represents a duplicate selected choice
1012
+ token, // token
1013
+ index, // position at which the separator was found
1014
+ i, l, // looping variables
1015
+ separator; // the matched separator
1016
+
1017
+ if (!opts.createSearchChoice || !opts.tokenSeparators || opts.tokenSeparators.length < 1) return undefined;
1018
+
1019
+ while (true) {
1020
+ index = -1;
1021
+
1022
+ for (i = 0, l = opts.tokenSeparators.length; i < l; i++) {
1023
+ separator = opts.tokenSeparators[i];
1024
+ index = input.indexOf(separator);
1025
+ if (index >= 0) break;
1026
+ }
1027
+
1028
+ if (index < 0) break; // did not find any token separator in the input string, bail
1029
+
1030
+ token = input.substring(0, index);
1031
+ input = input.substring(index + separator.length);
1032
+
1033
+ if (token.length > 0) {
1034
+ token = opts.createSearchChoice.call(this, token, selection);
1035
+ if (token !== undefined && token !== null && opts.id(token) !== undefined && opts.id(token) !== null) {
1036
+ dupe = false;
1037
+ for (i = 0, l = selection.length; i < l; i++) {
1038
+ if (equal(opts.id(token), opts.id(selection[i]))) {
1039
+ dupe = true; break;
1040
+ }
1041
+ }
1042
+
1043
+ if (!dupe) selectCallback(token);
1044
+ }
1045
+ }
1046
+ }
1047
+
1048
+ if (original!==input) return input;
1049
+ }
1050
+
1051
+ function cleanupJQueryElements() {
1052
+ var self = this;
1053
+
1054
+ Array.prototype.forEach.call(arguments, function (element) {
1055
+ self[element].remove();
1056
+ self[element] = null;
1057
+ });
1058
+ }
1059
+
1060
+ /**
1061
+ * Creates a new class
1062
+ *
1063
+ * @param superClass
1064
+ * @param methods
1065
+ */
1066
+ function clazz(SuperClass, methods) {
1067
+ var constructor = function () {};
1068
+ constructor.prototype = new SuperClass;
1069
+ constructor.prototype.constructor = constructor;
1070
+ constructor.prototype.parent = SuperClass.prototype;
1071
+ constructor.prototype = $.extend(constructor.prototype, methods);
1072
+ return constructor;
1073
+ }
1074
+
1075
+ AbstractSelect2 = clazz(Object, {
1076
+
1077
+ // abstract
1078
+ bind: function (func) {
1079
+ var self = this;
1080
+ return function () {
1081
+ func.apply(self, arguments);
1082
+ };
1083
+ },
1084
+
1085
+ // abstract
1086
+ init: function (opts) {
1087
+ var results, search, resultsSelector = ".select2-results";
1088
+
1089
+ // prepare options
1090
+ this.opts = opts = this.prepareOpts(opts);
1091
+
1092
+ this.id=opts.id;
1093
+
1094
+ // destroy if called on an existing component
1095
+ if (opts.element.data("select2") !== undefined &&
1096
+ opts.element.data("select2") !== null) {
1097
+ opts.element.data("select2").destroy();
1098
+ }
1099
+
1100
+ this.container = this.createContainer();
1101
+
1102
+ this.liveRegion = $("<span>", {
1103
+ role: "status",
1104
+ "aria-live": "polite"
1105
+ })
1106
+ .addClass("select2-hidden-accessible")
1107
+ .appendTo(document.body);
1108
+
1109
+ this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid());
1110
+ this.containerEventName= this.containerId
1111
+ .replace(/([.])/g, '_')
1112
+ .replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
1113
+ this.container.attr("id", this.containerId);
1114
+
1115
+ this.container.attr("title", opts.element.attr("title"));
1116
+
1117
+ this.body = $("body");
1118
+
1119
+ syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
1120
+
1121
+ this.container.attr("style", opts.element.attr("style"));
1122
+ this.container.css(evaluate(opts.containerCss));
1123
+ this.container.addClass(evaluate(opts.containerCssClass));
1124
+
1125
+ this.elementTabIndex = this.opts.element.attr("tabindex");
1126
+
1127
+ // swap container for the element
1128
+ this.opts.element
1129
+ .data("select2", this)
1130
+ .attr("tabindex", "-1")
1131
+ .before(this.container)
1132
+ .on("click.select2", killEvent); // do not leak click events
1133
+
1134
+ this.container.data("select2", this);
1135
+
1136
+ this.dropdown = this.container.find(".select2-drop");
1137
+
1138
+ syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
1139
+
1140
+ this.dropdown.addClass(evaluate(opts.dropdownCssClass));
1141
+ this.dropdown.data("select2", this);
1142
+ this.dropdown.on("click", killEvent);
1143
+
1144
+ this.results = results = this.container.find(resultsSelector);
1145
+ this.search = search = this.container.find("input.select2-input");
1146
+
1147
+ this.queryCount = 0;
1148
+ this.resultsPage = 0;
1149
+ this.context = null;
1150
+
1151
+ // initialize the container
1152
+ this.initContainer();
1153
+
1154
+ this.container.on("click", killEvent);
1155
+
1156
+ installFilteredMouseMove(this.results);
1157
+
1158
+ this.dropdown.on("mousemove-filtered", resultsSelector, this.bind(this.highlightUnderEvent));
1159
+ this.dropdown.on("touchstart touchmove touchend", resultsSelector, this.bind(function (event) {
1160
+ this._touchEvent = true;
1161
+ this.highlightUnderEvent(event);
1162
+ }));
1163
+ this.dropdown.on("touchmove", resultsSelector, this.bind(this.touchMoved));
1164
+ this.dropdown.on("touchstart touchend", resultsSelector, this.bind(this.clearTouchMoved));
1165
+
1166
+ // Waiting for a click event on touch devices to select option and hide dropdown
1167
+ // otherwise click will be triggered on an underlying element
1168
+ this.dropdown.on('click', this.bind(function (event) {
1169
+ if (this._touchEvent) {
1170
+ this._touchEvent = false;
1171
+ this.selectHighlighted();
1172
+ }
1173
+ }));
1174
+
1175
+ installDebouncedScroll(80, this.results);
1176
+ this.dropdown.on("scroll-debounced", resultsSelector, this.bind(this.loadMoreIfNeeded));
1177
+
1178
+ // do not propagate change event from the search field out of the component
1179
+ $(this.container).on("change", ".select2-input", function(e) {e.stopPropagation();});
1180
+ $(this.dropdown).on("change", ".select2-input", function(e) {e.stopPropagation();});
1181
+
1182
+ // if jquery.mousewheel plugin is installed we can prevent out-of-bounds scrolling of results via mousewheel
1183
+ if ($.fn.mousewheel) {
1184
+ results.mousewheel(function (e, delta, deltaX, deltaY) {
1185
+ var top = results.scrollTop();
1186
+ if (deltaY > 0 && top - deltaY <= 0) {
1187
+ results.scrollTop(0);
1188
+ killEvent(e);
1189
+ } else if (deltaY < 0 && results.get(0).scrollHeight - results.scrollTop() + deltaY <= results.height()) {
1190
+ results.scrollTop(results.get(0).scrollHeight - results.height());
1191
+ killEvent(e);
1192
+ }
1193
+ });
1194
+ }
1195
+
1196
+ installKeyUpChangeEvent(search);
1197
+ search.on("keyup-change input paste", this.bind(this.updateResults));
1198
+ search.on("focus", function () { search.addClass("select2-focused"); });
1199
+ search.on("blur", function () { search.removeClass("select2-focused");});
1200
+
1201
+ this.dropdown.on("mouseup", resultsSelector, this.bind(function (e) {
1202
+ if ($(e.target).closest(".select2-result-selectable").length > 0) {
1203
+ this.highlightUnderEvent(e);
1204
+ this.selectHighlighted(e);
1205
+ }
1206
+ }));
1207
+
1208
+ // trap all mouse events from leaving the dropdown. sometimes there may be a modal that is listening
1209
+ // for mouse events outside of itself so it can close itself. since the dropdown is now outside the select2's
1210
+ // dom it will trigger the popup close, which is not what we want
1211
+ // focusin can cause focus wars between modals and select2 since the dropdown is outside the modal.
1212
+ this.dropdown.on("click mouseup mousedown touchstart touchend focusin", function (e) { e.stopPropagation(); });
1213
+
1214
+ this.nextSearchTerm = undefined;
1215
+
1216
+ if ($.isFunction(this.opts.initSelection)) {
1217
+ // initialize selection based on the current value of the source element
1218
+ this.initSelection();
1219
+
1220
+ // if the user has provided a function that can set selection based on the value of the source element
1221
+ // we monitor the change event on the element and trigger it, allowing for two way synchronization
1222
+ this.monitorSource();
1223
+ }
1224
+
1225
+ if (opts.maximumInputLength !== null) {
1226
+ this.search.attr("maxlength", opts.maximumInputLength);
1227
+ }
1228
+
1229
+ var disabled = opts.element.prop("disabled");
1230
+ if (disabled === undefined) disabled = false;
1231
+ this.enable(!disabled);
1232
+
1233
+ var readonly = opts.element.prop("readonly");
1234
+ if (readonly === undefined) readonly = false;
1235
+ this.readonly(readonly);
1236
+
1237
+ // Calculate size of scrollbar
1238
+ scrollBarDimensions = scrollBarDimensions || measureScrollbar();
1239
+
1240
+ this.autofocus = opts.element.prop("autofocus");
1241
+ opts.element.prop("autofocus", false);
1242
+ if (this.autofocus) this.focus();
1243
+
1244
+ this.search.attr("placeholder", opts.searchInputPlaceholder);
1245
+ },
1246
+
1247
+ // abstract
1248
+ destroy: function () {
1249
+ var element=this.opts.element, select2 = element.data("select2");
1250
+
1251
+ this.close();
1252
+
1253
+ if (this.propertyObserver) {
1254
+ this.propertyObserver.disconnect();
1255
+ this.propertyObserver = null;
1256
+ }
1257
+
1258
+ if (select2 !== undefined) {
1259
+ select2.container.remove();
1260
+ select2.liveRegion.remove();
1261
+ select2.dropdown.remove();
1262
+ element
1263
+ .removeClass("select2-offscreen")
1264
+ .removeData("select2")
1265
+ .off(".select2")
1266
+ .prop("autofocus", this.autofocus || false);
1267
+ if (this.elementTabIndex) {
1268
+ element.attr({tabindex: this.elementTabIndex});
1269
+ } else {
1270
+ element.removeAttr("tabindex");
1271
+ }
1272
+ element.show();
1273
+ }
1274
+
1275
+ cleanupJQueryElements.call(this,
1276
+ "container",
1277
+ "liveRegion",
1278
+ "dropdown",
1279
+ "results",
1280
+ "search"
1281
+ );
1282
+ },
1283
+
1284
+ // abstract
1285
+ optionToData: function(element) {
1286
+ if (element.is("option")) {
1287
+ return {
1288
+ id:element.prop("value"),
1289
+ text:element.text(),
1290
+ element: element.get(),
1291
+ css: element.attr("class"),
1292
+ disabled: element.prop("disabled"),
1293
+ locked: equal(element.attr("locked"), "locked") || equal(element.data("locked"), true)
1294
+ };
1295
+ } else if (element.is("optgroup")) {
1296
+ return {
1297
+ text:element.attr("label"),
1298
+ children:[],
1299
+ element: element.get(),
1300
+ css: element.attr("class")
1301
+ };
1302
+ }
1303
+ },
1304
+
1305
+ // abstract
1306
+ prepareOpts: function (opts) {
1307
+ var element, select, idKey, ajaxUrl, self = this;
1308
+
1309
+ element = opts.element;
1310
+
1311
+ if (element.get(0).tagName.toLowerCase() === "select") {
1312
+ this.select = select = opts.element;
1313
+ }
1314
+
1315
+ if (select) {
1316
+ // these options are not allowed when attached to a select because they are picked up off the element itself
1317
+ $.each(["id", "multiple", "ajax", "query", "createSearchChoice", "initSelection", "data", "tags"], function () {
1318
+ if (this in opts) {
1319
+ throw new Error("Option '" + this + "' is not allowed for Select2 when attached to a <select> element.");
1320
+ }
1321
+ });
1322
+ }
1323
+
1324
+ opts = $.extend({}, {
1325
+ populateResults: function(container, results, query) {
1326
+ var populate, id=this.opts.id, liveRegion=this.liveRegion;
1327
+
1328
+ populate=function(results, container, depth) {
1329
+
1330
+ var i, l, result, selectable, disabled, compound, node, label, innerContainer, formatted;
1331
+
1332
+ results = opts.sortResults(results, container, query);
1333
+
1334
+ for (i = 0, l = results.length; i < l; i = i + 1) {
1335
+
1336
+ result=results[i];
1337
+
1338
+ disabled = (result.disabled === true);
1339
+ selectable = (!disabled) && (id(result) !== undefined);
1340
+
1341
+ compound=result.children && result.children.length > 0;
1342
+
1343
+ node=$("<li></li>");
1344
+ node.addClass("select2-results-dept-"+depth);
1345
+ node.addClass("select2-result");
1346
+ node.addClass(selectable ? "select2-result-selectable" : "select2-result-unselectable");
1347
+ if (disabled) { node.addClass("select2-disabled"); }
1348
+ if (compound) { node.addClass("select2-result-with-children"); }
1349
+ node.addClass(self.opts.formatResultCssClass(result));
1350
+ node.attr("role", "presentation");
1351
+
1352
+ label=$(document.createElement("div"));
1353
+ label.addClass("select2-result-label");
1354
+ label.attr("id", "select2-result-label-" + nextUid());
1355
+ label.attr("role", "option");
1356
+
1357
+ formatted=opts.formatResult(result, label, query, self.opts.escapeMarkup);
1358
+ if (formatted!==undefined) {
1359
+ label.html(formatted);
1360
+ node.append(label);
1361
+ }
1362
+
1363
+
1364
+ if (compound) {
1365
+
1366
+ innerContainer=$("<ul></ul>");
1367
+ innerContainer.addClass("select2-result-sub");
1368
+ populate(result.children, innerContainer, depth+1);
1369
+ node.append(innerContainer);
1370
+ }
1371
+
1372
+ node.data("select2-data", result);
1373
+ container.append(node);
1374
+ }
1375
+
1376
+ liveRegion.text(opts.formatMatches(results.length));
1377
+ };
1378
+
1379
+ populate(results, container, 0);
1380
+ }
1381
+ }, $.fn.select2.defaults, opts);
1382
+
1383
+ if (typeof(opts.id) !== "function") {
1384
+ idKey = opts.id;
1385
+ opts.id = function (e) { return e[idKey]; };
1386
+ }
1387
+
1388
+ if ($.isArray(opts.element.data("select2Tags"))) {
1389
+ if ("tags" in opts) {
1390
+ throw "tags specified as both an attribute 'data-select2-tags' and in options of Select2 " + opts.element.attr("id");
1391
+ }
1392
+ opts.tags=opts.element.data("select2Tags");
1393
+ }
1394
+
1395
+ if (select) {
1396
+ opts.query = this.bind(function (query) {
1397
+ var data = { results: [], more: false },
1398
+ term = query.term,
1399
+ children, placeholderOption, process;
1400
+
1401
+ process=function(element, collection) {
1402
+ var group;
1403
+ if (element.is("option")) {
1404
+ if (query.matcher(term, element.text(), element)) {
1405
+ collection.push(self.optionToData(element));
1406
+ }
1407
+ } else if (element.is("optgroup")) {
1408
+ group=self.optionToData(element);
1409
+ element.children().each2(function(i, elm) { process(elm, group.children); });
1410
+ if (group.children.length>0) {
1411
+ collection.push(group);
1412
+ }
1413
+ }
1414
+ };
1415
+
1416
+ children=element.children();
1417
+
1418
+ // ignore the placeholder option if there is one
1419
+ if (this.getPlaceholder() !== undefined && children.length > 0) {
1420
+ placeholderOption = this.getPlaceholderOption();
1421
+ if (placeholderOption) {
1422
+ children=children.not(placeholderOption);
1423
+ }
1424
+ }
1425
+
1426
+ children.each2(function(i, elm) { process(elm, data.results); });
1427
+
1428
+ query.callback(data);
1429
+ });
1430
+ // this is needed because inside val() we construct choices from options and there id is hardcoded
1431
+ opts.id=function(e) { return e.id; };
1432
+ } else {
1433
+ if (!("query" in opts)) {
1434
+
1435
+ if ("ajax" in opts) {
1436
+ ajaxUrl = opts.element.data("ajax-url");
1437
+ if (ajaxUrl && ajaxUrl.length > 0) {
1438
+ opts.ajax.url = ajaxUrl;
1439
+ }
1440
+ opts.query = ajax.call(opts.element, opts.ajax);
1441
+ } else if ("data" in opts) {
1442
+ opts.query = local(opts.data);
1443
+ } else if ("tags" in opts) {
1444
+ opts.query = tags(opts.tags);
1445
+ if (opts.createSearchChoice === undefined) {
1446
+ opts.createSearchChoice = function (term) { return {id: $.trim(term), text: $.trim(term)}; };
1447
+ }
1448
+ if (opts.initSelection === undefined) {
1449
+ opts.initSelection = function (element, callback) {
1450
+ var data = [];
1451
+ $(splitVal(element.val(), opts.separator)).each(function () {
1452
+ var obj = { id: this, text: this },
1453
+ tags = opts.tags;
1454
+ if ($.isFunction(tags)) tags=tags();
1455
+ $(tags).each(function() { if (equal(this.id, obj.id)) { obj = this; return false; } });
1456
+ data.push(obj);
1457
+ });
1458
+
1459
+ callback(data);
1460
+ };
1461
+ }
1462
+ }
1463
+ }
1464
+ }
1465
+ if (typeof(opts.query) !== "function") {
1466
+ throw "query function not defined for Select2 " + opts.element.attr("id");
1467
+ }
1468
+
1469
+ if (opts.createSearchChoicePosition === 'top') {
1470
+ opts.createSearchChoicePosition = function(list, item) { list.unshift(item); };
1471
+ }
1472
+ else if (opts.createSearchChoicePosition === 'bottom') {
1473
+ opts.createSearchChoicePosition = function(list, item) { list.push(item); };
1474
+ }
1475
+ else if (typeof(opts.createSearchChoicePosition) !== "function") {
1476
+ throw "invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";
1477
+ }
1478
+
1479
+ return opts;
1480
+ },
1481
+
1482
+ /**
1483
+ * Monitor the original element for changes and update select2 accordingly
1484
+ */
1485
+ // abstract
1486
+ monitorSource: function () {
1487
+ var el = this.opts.element, sync, observer;
1488
+
1489
+ el.on("change.select2", this.bind(function (e) {
1490
+ if (this.opts.element.data("select2-change-triggered") !== true) {
1491
+ this.initSelection();
1492
+ }
1493
+ }));
1494
+
1495
+ sync = this.bind(function () {
1496
+
1497
+ // sync enabled state
1498
+ var disabled = el.prop("disabled");
1499
+ if (disabled === undefined) disabled = false;
1500
+ this.enable(!disabled);
1501
+
1502
+ var readonly = el.prop("readonly");
1503
+ if (readonly === undefined) readonly = false;
1504
+ this.readonly(readonly);
1505
+
1506
+ syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
1507
+ this.container.addClass(evaluate(this.opts.containerCssClass));
1508
+
1509
+ syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
1510
+ this.dropdown.addClass(evaluate(this.opts.dropdownCssClass));
1511
+
1512
+ });
1513
+
1514
+ // IE8-10 (IE9/10 won't fire propertyChange via attachEventListener)
1515
+ if (el.length && el[0].attachEvent) {
1516
+ el.each(function() {
1517
+ this.attachEvent("onpropertychange", sync);
1518
+ });
1519
+ }
1520
+
1521
+ // safari, chrome, firefox, IE11
1522
+ observer = window.MutationObserver || window.WebKitMutationObserver|| window.MozMutationObserver;
1523
+ if (observer !== undefined) {
1524
+ if (this.propertyObserver) { delete this.propertyObserver; this.propertyObserver = null; }
1525
+ this.propertyObserver = new observer(function (mutations) {
1526
+ mutations.forEach(sync);
1527
+ });
1528
+ this.propertyObserver.observe(el.get(0), { attributes:true, subtree:false });
1529
+ }
1530
+ },
1531
+
1532
+ // abstract
1533
+ triggerSelect: function(data) {
1534
+ var evt = $.Event("select2-selecting", { val: this.id(data), object: data });
1535
+ this.opts.element.trigger(evt);
1536
+ return !evt.isDefaultPrevented();
1537
+ },
1538
+
1539
+ /**
1540
+ * Triggers the change event on the source element
1541
+ */
1542
+ // abstract
1543
+ triggerChange: function (details) {
1544
+
1545
+ details = details || {};
1546
+ details= $.extend({}, details, { type: "change", val: this.val() });
1547
+ // prevents recursive triggering
1548
+ this.opts.element.data("select2-change-triggered", true);
1549
+ this.opts.element.trigger(details);
1550
+ this.opts.element.data("select2-change-triggered", false);
1551
+
1552
+ // some validation frameworks ignore the change event and listen instead to keyup, click for selects
1553
+ // so here we trigger the click event manually
1554
+ this.opts.element.click();
1555
+
1556
+ // ValidationEngine ignores the change event and listens instead to blur
1557
+ // so here we trigger the blur event manually if so desired
1558
+ if (this.opts.blurOnChange)
1559
+ this.opts.element.blur();
1560
+ },
1561
+
1562
+ //abstract
1563
+ isInterfaceEnabled: function()
1564
+ {
1565
+ return this.enabledInterface === true;
1566
+ },
1567
+
1568
+ // abstract
1569
+ enableInterface: function() {
1570
+ var enabled = this._enabled && !this._readonly,
1571
+ disabled = !enabled;
1572
+
1573
+ if (enabled === this.enabledInterface) return false;
1574
+
1575
+ this.container.toggleClass("select2-container-disabled", disabled);
1576
+ this.close();
1577
+ this.enabledInterface = enabled;
1578
+
1579
+ return true;
1580
+ },
1581
+
1582
+ // abstract
1583
+ enable: function(enabled) {
1584
+ if (enabled === undefined) enabled = true;
1585
+ if (this._enabled === enabled) return;
1586
+ this._enabled = enabled;
1587
+
1588
+ this.opts.element.prop("disabled", !enabled);
1589
+ this.enableInterface();
1590
+ },
1591
+
1592
+ // abstract
1593
+ disable: function() {
1594
+ this.enable(false);
1595
+ },
1596
+
1597
+ // abstract
1598
+ readonly: function(enabled) {
1599
+ if (enabled === undefined) enabled = false;
1600
+ if (this._readonly === enabled) return;
1601
+ this._readonly = enabled;
1602
+
1603
+ this.opts.element.prop("readonly", enabled);
1604
+ this.enableInterface();
1605
+ },
1606
+
1607
+ // abstract
1608
+ opened: function () {
1609
+ return this.container.hasClass("select2-dropdown-open");
1610
+ },
1611
+
1612
+ // abstract
1613
+ positionDropdown: function() {
1614
+ var $dropdown = this.dropdown,
1615
+ offset = this.container.offset(),
1616
+ height = this.container.outerHeight(false),
1617
+ width = this.container.outerWidth(false),
1618
+ dropHeight = $dropdown.outerHeight(false),
1619
+ $window = $(window),
1620
+ windowWidth = $window.width(),
1621
+ windowHeight = $window.height(),
1622
+ viewPortRight = $window.scrollLeft() + windowWidth,
1623
+ viewportBottom = $window.scrollTop() + windowHeight,
1624
+ dropTop = offset.top + height,
1625
+ dropLeft = offset.left,
1626
+ enoughRoomBelow = dropTop + dropHeight <= viewportBottom,
1627
+ enoughRoomAbove = (offset.top - dropHeight) >= $window.scrollTop(),
1628
+ dropWidth = $dropdown.outerWidth(false),
1629
+ enoughRoomOnRight = dropLeft + dropWidth <= viewPortRight,
1630
+ aboveNow = $dropdown.hasClass("select2-drop-above"),
1631
+ bodyOffset,
1632
+ above,
1633
+ changeDirection,
1634
+ css,
1635
+ resultsListNode;
1636
+
1637
+ // always prefer the current above/below alignment, unless there is not enough room
1638
+ if (aboveNow) {
1639
+ above = true;
1640
+ if (!enoughRoomAbove && enoughRoomBelow) {
1641
+ changeDirection = true;
1642
+ above = false;
1643
+ }
1644
+ } else {
1645
+ above = false;
1646
+ if (!enoughRoomBelow && enoughRoomAbove) {
1647
+ changeDirection = true;
1648
+ above = true;
1649
+ }
1650
+ }
1651
+
1652
+ //if we are changing direction we need to get positions when dropdown is hidden;
1653
+ if (changeDirection) {
1654
+ $dropdown.hide();
1655
+ offset = this.container.offset();
1656
+ height = this.container.outerHeight(false);
1657
+ width = this.container.outerWidth(false);
1658
+ dropHeight = $dropdown.outerHeight(false);
1659
+ viewPortRight = $window.scrollLeft() + windowWidth;
1660
+ viewportBottom = $window.scrollTop() + windowHeight;
1661
+ dropTop = offset.top + height;
1662
+ dropLeft = offset.left;
1663
+ dropWidth = $dropdown.outerWidth(false);
1664
+ enoughRoomOnRight = dropLeft + dropWidth <= viewPortRight;
1665
+ $dropdown.show();
1666
+
1667
+ // fix so the cursor does not move to the left within the search-textbox in IE
1668
+ this.focusSearch();
1669
+ }
1670
+
1671
+ if (this.opts.dropdownAutoWidth) {
1672
+ resultsListNode = $('.select2-results', $dropdown)[0];
1673
+ $dropdown.addClass('select2-drop-auto-width');
1674
+ $dropdown.css('width', '');
1675
+ // Add scrollbar width to dropdown if vertical scrollbar is present
1676
+ dropWidth = $dropdown.outerWidth(false) + (resultsListNode.scrollHeight === resultsListNode.clientHeight ? 0 : scrollBarDimensions.width);
1677
+ dropWidth > width ? width = dropWidth : dropWidth = width;
1678
+ dropHeight = $dropdown.outerHeight(false);
1679
+ enoughRoomOnRight = dropLeft + dropWidth <= viewPortRight;
1680
+ }
1681
+ else {
1682
+ this.container.removeClass('select2-drop-auto-width');
1683
+ }
1684
+
1685
+ //console.log("below/ droptop:", dropTop, "dropHeight", dropHeight, "sum", (dropTop+dropHeight)+" viewport bottom", viewportBottom, "enough?", enoughRoomBelow);
1686
+ //console.log("above/ offset.top", offset.top, "dropHeight", dropHeight, "top", (offset.top-dropHeight), "scrollTop", this.body.scrollTop(), "enough?", enoughRoomAbove);
1687
+
1688
+ // fix positioning when body has an offset and is not position: static
1689
+ if (this.body.css('position') !== 'static') {
1690
+ bodyOffset = this.body.offset();
1691
+ dropTop -= bodyOffset.top;
1692
+ dropLeft -= bodyOffset.left;
1693
+ }
1694
+
1695
+ if (!enoughRoomOnRight) {
1696
+ dropLeft = offset.left + this.container.outerWidth(false) - dropWidth;
1697
+ }
1698
+
1699
+ css = {
1700
+ left: dropLeft,
1701
+ width: width
1702
+ };
1703
+
1704
+ if (above) {
1705
+ css.top = offset.top - dropHeight;
1706
+ css.bottom = 'auto';
1707
+ this.container.addClass("select2-drop-above");
1708
+ $dropdown.addClass("select2-drop-above");
1709
+ }
1710
+ else {
1711
+ css.top = dropTop;
1712
+ css.bottom = 'auto';
1713
+ this.container.removeClass("select2-drop-above");
1714
+ $dropdown.removeClass("select2-drop-above");
1715
+ }
1716
+ css = $.extend(css, evaluate(this.opts.dropdownCss));
1717
+
1718
+ $dropdown.css(css);
1719
+ },
1720
+
1721
+ // abstract
1722
+ shouldOpen: function() {
1723
+ var event;
1724
+
1725
+ if (this.opened()) return false;
1726
+
1727
+ if (this._enabled === false || this._readonly === true) return false;
1728
+
1729
+ event = $.Event("select2-opening");
1730
+ this.opts.element.trigger(event);
1731
+ return !event.isDefaultPrevented();
1732
+ },
1733
+
1734
+ // abstract
1735
+ clearDropdownAlignmentPreference: function() {
1736
+ // clear the classes used to figure out the preference of where the dropdown should be opened
1737
+ this.container.removeClass("select2-drop-above");
1738
+ this.dropdown.removeClass("select2-drop-above");
1739
+ },
1740
+
1741
+ /**
1742
+ * Opens the dropdown
1743
+ *
1744
+ * @return {Boolean} whether or not dropdown was opened. This method will return false if, for example,
1745
+ * the dropdown is already open, or if the 'open' event listener on the element called preventDefault().
1746
+ */
1747
+ // abstract
1748
+ open: function () {
1749
+
1750
+ if (!this.shouldOpen()) return false;
1751
+
1752
+ this.opening();
1753
+
1754
+ return true;
1755
+ },
1756
+
1757
+ /**
1758
+ * Performs the opening of the dropdown
1759
+ */
1760
+ // abstract
1761
+ opening: function() {
1762
+ var cid = this.containerEventName,
1763
+ scroll = "scroll." + cid,
1764
+ resize = "resize."+cid,
1765
+ orient = "orientationchange."+cid,
1766
+ mask;
1767
+
1768
+ this.container.addClass("select2-dropdown-open").addClass("select2-container-active");
1769
+
1770
+ this.clearDropdownAlignmentPreference();
1771
+
1772
+ if(this.dropdown[0] !== this.body.children().last()[0]) {
1773
+ this.dropdown.detach().appendTo(this.body);
1774
+ }
1775
+
1776
+ // create the dropdown mask if doesn't already exist
1777
+ mask = $("#select2-drop-mask");
1778
+ if (mask.length == 0) {
1779
+ mask = $(document.createElement("div"));
1780
+ mask.attr("id","select2-drop-mask").attr("class","select2-drop-mask");
1781
+ mask.hide();
1782
+ mask.appendTo(this.body);
1783
+ mask.on("mousedown touchstart click", function (e) {
1784
+ // Prevent IE from generating a click event on the body
1785
+ reinsertElement(mask);
1786
+
1787
+ var dropdown = $("#select2-drop"), self;
1788
+ if (dropdown.length > 0) {
1789
+ self=dropdown.data("select2");
1790
+ if (self.opts.selectOnBlur) {
1791
+ self.selectHighlighted({noFocus: true});
1792
+ }
1793
+ self.close();
1794
+ e.preventDefault();
1795
+ e.stopPropagation();
1796
+ }
1797
+ });
1798
+ }
1799
+
1800
+ // ensure the mask is always right before the dropdown
1801
+ if (this.dropdown.prev()[0] !== mask[0]) {
1802
+ this.dropdown.before(mask);
1803
+ }
1804
+
1805
+ // move the global id to the correct dropdown
1806
+ $("#select2-drop").removeAttr("id");
1807
+ this.dropdown.attr("id", "select2-drop");
1808
+
1809
+ // show the elements
1810
+ mask.show();
1811
+
1812
+ this.positionDropdown();
1813
+ this.dropdown.show();
1814
+ this.positionDropdown();
1815
+
1816
+ this.dropdown.addClass("select2-drop-active");
1817
+
1818
+ // attach listeners to events that can change the position of the container and thus require
1819
+ // the position of the dropdown to be updated as well so it does not come unglued from the container
1820
+ var that = this;
1821
+ this.container.parents().add(window).each(function () {
1822
+ $(this).on(resize+" "+scroll+" "+orient, function (e) {
1823
+ if (that.opened()) that.positionDropdown();
1824
+ });
1825
+ });
1826
+
1827
+
1828
+ },
1829
+
1830
+ // abstract
1831
+ close: function () {
1832
+ if (!this.opened()) return;
1833
+
1834
+ var cid = this.containerEventName,
1835
+ scroll = "scroll." + cid,
1836
+ resize = "resize."+cid,
1837
+ orient = "orientationchange."+cid;
1838
+
1839
+ // unbind event listeners
1840
+ this.container.parents().add(window).each(function () { $(this).off(scroll).off(resize).off(orient); });
1841
+
1842
+ this.clearDropdownAlignmentPreference();
1843
+
1844
+ $("#select2-drop-mask").hide();
1845
+ this.dropdown.removeAttr("id"); // only the active dropdown has the select2-drop id
1846
+ this.dropdown.hide();
1847
+ this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");
1848
+ this.results.empty();
1849
+
1850
+
1851
+ this.clearSearch();
1852
+ this.search.removeClass("select2-active");
1853
+ this.opts.element.trigger($.Event("select2-close"));
1854
+ },
1855
+
1856
+ /**
1857
+ * Opens control, sets input value, and updates results.
1858
+ */
1859
+ // abstract
1860
+ externalSearch: function (term) {
1861
+ this.open();
1862
+ this.search.val(term);
1863
+ this.updateResults(false);
1864
+ },
1865
+
1866
+ // abstract
1867
+ clearSearch: function () {
1868
+
1869
+ },
1870
+
1871
+ //abstract
1872
+ getMaximumSelectionSize: function() {
1873
+ return evaluate(this.opts.maximumSelectionSize);
1874
+ },
1875
+
1876
+ // abstract
1877
+ ensureHighlightVisible: function () {
1878
+ var results = this.results, children, index, child, hb, rb, y, more;
1879
+
1880
+ index = this.highlight();
1881
+
1882
+ if (index < 0) return;
1883
+
1884
+ if (index == 0) {
1885
+
1886
+ // if the first element is highlighted scroll all the way to the top,
1887
+ // that way any unselectable headers above it will also be scrolled
1888
+ // into view
1889
+
1890
+ results.scrollTop(0);
1891
+ return;
1892
+ }
1893
+
1894
+ children = this.findHighlightableChoices().find('.select2-result-label');
1895
+
1896
+ child = $(children[index]);
1897
+
1898
+ hb = child.offset().top + child.outerHeight(true);
1899
+
1900
+ // if this is the last child lets also make sure select2-more-results is visible
1901
+ if (index === children.length - 1) {
1902
+ more = results.find("li.select2-more-results");
1903
+ if (more.length > 0) {
1904
+ hb = more.offset().top + more.outerHeight(true);
1905
+ }
1906
+ }
1907
+
1908
+ rb = results.offset().top + results.outerHeight(true);
1909
+ if (hb > rb) {
1910
+ results.scrollTop(results.scrollTop() + (hb - rb));
1911
+ }
1912
+ y = child.offset().top - results.offset().top;
1913
+
1914
+ // make sure the top of the element is visible
1915
+ if (y < 0 && child.css('display') != 'none' ) {
1916
+ results.scrollTop(results.scrollTop() + y); // y is negative
1917
+ }
1918
+ },
1919
+
1920
+ // abstract
1921
+ findHighlightableChoices: function() {
1922
+ return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)");
1923
+ },
1924
+
1925
+ // abstract
1926
+ moveHighlight: function (delta) {
1927
+ var choices = this.findHighlightableChoices(),
1928
+ index = this.highlight();
1929
+
1930
+ while (index > -1 && index < choices.length) {
1931
+ index += delta;
1932
+ var choice = $(choices[index]);
1933
+ if (choice.hasClass("select2-result-selectable") && !choice.hasClass("select2-disabled") && !choice.hasClass("select2-selected")) {
1934
+ this.highlight(index);
1935
+ break;
1936
+ }
1937
+ }
1938
+ },
1939
+
1940
+ // abstract
1941
+ highlight: function (index) {
1942
+ var choices = this.findHighlightableChoices(),
1943
+ choice,
1944
+ data;
1945
+
1946
+ if (arguments.length === 0) {
1947
+ return indexOf(choices.filter(".select2-highlighted")[0], choices.get());
1948
+ }
1949
+
1950
+ if (index >= choices.length) index = choices.length - 1;
1951
+ if (index < 0) index = 0;
1952
+
1953
+ this.removeHighlight();
1954
+
1955
+ choice = $(choices[index]);
1956
+ choice.addClass("select2-highlighted");
1957
+
1958
+ // ensure assistive technology can determine the active choice
1959
+ this.search.attr("aria-activedescendant", choice.find(".select2-result-label").attr("id"));
1960
+
1961
+ this.ensureHighlightVisible();
1962
+
1963
+ this.liveRegion.text(choice.text());
1964
+
1965
+ data = choice.data("select2-data");
1966
+ if (data) {
1967
+ this.opts.element.trigger({ type: "select2-highlight", val: this.id(data), choice: data });
1968
+ }
1969
+ },
1970
+
1971
+ removeHighlight: function() {
1972
+ this.results.find(".select2-highlighted").removeClass("select2-highlighted");
1973
+ },
1974
+
1975
+ touchMoved: function() {
1976
+ this._touchMoved = true;
1977
+ },
1978
+
1979
+ clearTouchMoved: function() {
1980
+ this._touchMoved = false;
1981
+ },
1982
+
1983
+ // abstract
1984
+ countSelectableResults: function() {
1985
+ return this.findHighlightableChoices().length;
1986
+ },
1987
+
1988
+ // abstract
1989
+ highlightUnderEvent: function (event) {
1990
+ var el = $(event.target).closest(".select2-result-selectable");
1991
+ if (el.length > 0 && !el.is(".select2-highlighted")) {
1992
+ var choices = this.findHighlightableChoices();
1993
+ this.highlight(choices.index(el));
1994
+ } else if (el.length == 0) {
1995
+ // if we are over an unselectable item remove all highlights
1996
+ this.removeHighlight();
1997
+ }
1998
+ },
1999
+
2000
+ // abstract
2001
+ loadMoreIfNeeded: function () {
2002
+ var results = this.results,
2003
+ more = results.find("li.select2-more-results"),
2004
+ below, // pixels the element is below the scroll fold, below==0 is when the element is starting to be visible
2005
+ page = this.resultsPage + 1,
2006
+ self=this,
2007
+ term=this.search.val(),
2008
+ context=this.context;
2009
+
2010
+ if (more.length === 0) return;
2011
+ below = more.offset().top - results.offset().top - results.height();
2012
+
2013
+ if (below <= this.opts.loadMorePadding) {
2014
+ more.addClass("select2-active");
2015
+ this.opts.query({
2016
+ element: this.opts.element,
2017
+ term: term,
2018
+ page: page,
2019
+ context: context,
2020
+ matcher: this.opts.matcher,
2021
+ callback: this.bind(function (data) {
2022
+
2023
+ // ignore a response if the select2 has been closed before it was received
2024
+ if (!self.opened()) return;
2025
+
2026
+
2027
+ self.opts.populateResults.call(this, results, data.results, {term: term, page: page, context:context});
2028
+ self.postprocessResults(data, false, false);
2029
+
2030
+ if (data.more===true) {
2031
+ more.detach().appendTo(results).text(evaluate(self.opts.formatLoadMore, page+1));
2032
+ window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10);
2033
+ } else {
2034
+ more.remove();
2035
+ }
2036
+ self.positionDropdown();
2037
+ self.resultsPage = page;
2038
+ self.context = data.context;
2039
+ this.opts.element.trigger({ type: "select2-loaded", items: data });
2040
+ })});
2041
+ }
2042
+ },
2043
+
2044
+ /**
2045
+ * Default tokenizer function which does nothing
2046
+ */
2047
+ tokenize: function() {
2048
+
2049
+ },
2050
+
2051
+ /**
2052
+ * @param initial whether or not this is the call to this method right after the dropdown has been opened
2053
+ */
2054
+ // abstract
2055
+ updateResults: function (initial) {
2056
+ var search = this.search,
2057
+ results = this.results,
2058
+ opts = this.opts,
2059
+ data,
2060
+ self = this,
2061
+ input,
2062
+ term = search.val(),
2063
+ lastTerm = $.data(this.container, "select2-last-term"),
2064
+ // sequence number used to drop out-of-order responses
2065
+ queryNumber;
2066
+
2067
+ // prevent duplicate queries against the same term
2068
+ if (initial !== true && lastTerm && equal(term, lastTerm)) return;
2069
+
2070
+ $.data(this.container, "select2-last-term", term);
2071
+
2072
+ // if the search is currently hidden we do not alter the results
2073
+ if (initial !== true && (this.showSearchInput === false || !this.opened())) {
2074
+ return;
2075
+ }
2076
+
2077
+ function postRender() {
2078
+ search.removeClass("select2-active");
2079
+ self.positionDropdown();
2080
+ if (results.find('.select2-no-results,.select2-selection-limit,.select2-searching').length) {
2081
+ self.liveRegion.text(results.text());
2082
+ }
2083
+ else {
2084
+ self.liveRegion.text(self.opts.formatMatches(results.find('.select2-result-selectable').length));
2085
+ }
2086
+ }
2087
+
2088
+ function render(html) {
2089
+ results.html(html);
2090
+ postRender();
2091
+ }
2092
+
2093
+ queryNumber = ++this.queryCount;
2094
+
2095
+ var maxSelSize = this.getMaximumSelectionSize();
2096
+ if (maxSelSize >=1) {
2097
+ data = this.data();
2098
+ if ($.isArray(data) && data.length >= maxSelSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) {
2099
+ render("<li class='select2-selection-limit'>" + evaluate(opts.formatSelectionTooBig, maxSelSize) + "</li>");
2100
+ return;
2101
+ }
2102
+ }
2103
+
2104
+ if (search.val().length < opts.minimumInputLength) {
2105
+ if (checkFormatter(opts.formatInputTooShort, "formatInputTooShort")) {
2106
+ render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooShort, search.val(), opts.minimumInputLength) + "</li>");
2107
+ } else {
2108
+ render("");
2109
+ }
2110
+ if (initial && this.showSearch) this.showSearch(true);
2111
+ return;
2112
+ }
2113
+
2114
+ if (opts.maximumInputLength && search.val().length > opts.maximumInputLength) {
2115
+ if (checkFormatter(opts.formatInputTooLong, "formatInputTooLong")) {
2116
+ render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooLong, search.val(), opts.maximumInputLength) + "</li>");
2117
+ } else {
2118
+ render("");
2119
+ }
2120
+ return;
2121
+ }
2122
+
2123
+ if (opts.formatSearching && this.findHighlightableChoices().length === 0) {
2124
+ render("<li class='select2-searching'>" + evaluate(opts.formatSearching) + "</li>");
2125
+ }
2126
+
2127
+ search.addClass("select2-active");
2128
+
2129
+ this.removeHighlight();
2130
+
2131
+ // give the tokenizer a chance to pre-process the input
2132
+ input = this.tokenize();
2133
+ if (input != undefined && input != null) {
2134
+ search.val(input);
2135
+ }
2136
+
2137
+ this.resultsPage = 1;
2138
+
2139
+ opts.query({
2140
+ element: opts.element,
2141
+ term: search.val(),
2142
+ page: this.resultsPage,
2143
+ context: null,
2144
+ matcher: opts.matcher,
2145
+ callback: this.bind(function (data) {
2146
+ var def; // default choice
2147
+
2148
+ // ignore old responses
2149
+ if (queryNumber != this.queryCount) {
2150
+ return;
2151
+ }
2152
+
2153
+ // ignore a response if the select2 has been closed before it was received
2154
+ if (!this.opened()) {
2155
+ this.search.removeClass("select2-active");
2156
+ return;
2157
+ }
2158
+
2159
+ // save context, if any
2160
+ this.context = (data.context===undefined) ? null : data.context;
2161
+ // create a default choice and prepend it to the list
2162
+ if (this.opts.createSearchChoice && search.val() !== "") {
2163
+ def = this.opts.createSearchChoice.call(self, search.val(), data.results);
2164
+ if (def !== undefined && def !== null && self.id(def) !== undefined && self.id(def) !== null) {
2165
+ if ($(data.results).filter(
2166
+ function () {
2167
+ return equal(self.id(this), self.id(def));
2168
+ }).length === 0) {
2169
+ this.opts.createSearchChoicePosition(data.results, def);
2170
+ }
2171
+ }
2172
+ }
2173
+
2174
+ if (data.results.length === 0 && checkFormatter(opts.formatNoMatches, "formatNoMatches")) {
2175
+ render("<li class='select2-no-results'>" + evaluate(opts.formatNoMatches, search.val()) + "</li>");
2176
+ return;
2177
+ }
2178
+
2179
+ results.empty();
2180
+ self.opts.populateResults.call(this, results, data.results, {term: search.val(), page: this.resultsPage, context:null});
2181
+
2182
+ if (data.more === true && checkFormatter(opts.formatLoadMore, "formatLoadMore")) {
2183
+ results.append("<li class='select2-more-results'>" + self.opts.escapeMarkup(evaluate(opts.formatLoadMore, this.resultsPage)) + "</li>");
2184
+ window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10);
2185
+ }
2186
+
2187
+ this.postprocessResults(data, initial);
2188
+
2189
+ postRender();
2190
+
2191
+ this.opts.element.trigger({ type: "select2-loaded", items: data });
2192
+ })});
2193
+ },
2194
+
2195
+ // abstract
2196
+ cancel: function () {
2197
+ this.close();
2198
+ },
2199
+
2200
+ // abstract
2201
+ blur: function () {
2202
+ // if selectOnBlur == true, select the currently highlighted option
2203
+ if (this.opts.selectOnBlur)
2204
+ this.selectHighlighted({noFocus: true});
2205
+
2206
+ this.close();
2207
+ this.container.removeClass("select2-container-active");
2208
+ // synonymous to .is(':focus'), which is available in jquery >= 1.6
2209
+ if (this.search[0] === document.activeElement) { this.search.blur(); }
2210
+ this.clearSearch();
2211
+ this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
2212
+ },
2213
+
2214
+ // abstract
2215
+ focusSearch: function () {
2216
+ focus(this.search);
2217
+ },
2218
+
2219
+ // abstract
2220
+ selectHighlighted: function (options) {
2221
+ if (this._touchMoved) {
2222
+ this.clearTouchMoved();
2223
+ return;
2224
+ }
2225
+ var index=this.highlight(),
2226
+ highlighted=this.results.find(".select2-highlighted"),
2227
+ data = highlighted.closest('.select2-result').data("select2-data");
2228
+
2229
+ if (data) {
2230
+ this.highlight(index);
2231
+ this.onSelect(data, options);
2232
+ } else if (options && options.noFocus) {
2233
+ this.close();
2234
+ }
2235
+ },
2236
+
2237
+ // abstract
2238
+ getPlaceholder: function () {
2239
+ var placeholderOption;
2240
+ return this.opts.element.attr("placeholder") ||
2241
+ this.opts.element.attr("data-placeholder") || // jquery 1.4 compat
2242
+ this.opts.element.data("placeholder") ||
2243
+ this.opts.placeholder ||
2244
+ ((placeholderOption = this.getPlaceholderOption()) !== undefined ? placeholderOption.text() : undefined);
2245
+ },
2246
+
2247
+ // abstract
2248
+ getPlaceholderOption: function() {
2249
+ if (this.select) {
2250
+ var firstOption = this.select.children('option').first();
2251
+ if (this.opts.placeholderOption !== undefined ) {
2252
+ //Determine the placeholder option based on the specified placeholderOption setting
2253
+ return (this.opts.placeholderOption === "first" && firstOption) ||
2254
+ (typeof this.opts.placeholderOption === "function" && this.opts.placeholderOption(this.select));
2255
+ } else if ($.trim(firstOption.text()) === "" && firstOption.val() === "") {
2256
+ //No explicit placeholder option specified, use the first if it's blank
2257
+ return firstOption;
2258
+ }
2259
+ }
2260
+ },
2261
+
2262
+ /**
2263
+ * Get the desired width for the container element. This is
2264
+ * derived first from option `width` passed to select2, then
2265
+ * the inline 'style' on the original element, and finally
2266
+ * falls back to the jQuery calculated element width.
2267
+ */
2268
+ // abstract
2269
+ initContainerWidth: function () {
2270
+ function resolveContainerWidth() {
2271
+ var style, attrs, matches, i, l, attr;
2272
+
2273
+ if (this.opts.width === "off") {
2274
+ return null;
2275
+ } else if (this.opts.width === "element"){
2276
+ return this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px';
2277
+ } else if (this.opts.width === "copy" || this.opts.width === "resolve") {
2278
+ // check if there is inline style on the element that contains width
2279
+ style = this.opts.element.attr('style');
2280
+ if (style !== undefined) {
2281
+ attrs = style.split(';');
2282
+ for (i = 0, l = attrs.length; i < l; i = i + 1) {
2283
+ attr = attrs[i].replace(/\s/g, '');
2284
+ matches = attr.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i);
2285
+ if (matches !== null && matches.length >= 1)
2286
+ return matches[1];
2287
+ }
2288
+ }
2289
+
2290
+ if (this.opts.width === "resolve") {
2291
+ // next check if css('width') can resolve a width that is percent based, this is sometimes possible
2292
+ // when attached to input type=hidden or elements hidden via css
2293
+ style = this.opts.element.css('width');
2294
+ if (style.indexOf("%") > 0) return style;
2295
+
2296
+ // finally, fallback on the calculated width of the element
2297
+ return (this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px');
2298
+ }
2299
+
2300
+ return null;
2301
+ } else if ($.isFunction(this.opts.width)) {
2302
+ return this.opts.width();
2303
+ } else {
2304
+ return this.opts.width;
2305
+ }
2306
+ };
2307
+
2308
+ var width = resolveContainerWidth.call(this);
2309
+ if (width !== null) {
2310
+ this.container.css("width", width);
2311
+ }
2312
+ }
2313
+ });
2314
+
2315
+ SingleSelect2 = clazz(AbstractSelect2, {
2316
+
2317
+ // single
2318
+
2319
+ createContainer: function () {
2320
+ var container = $(document.createElement("div")).attr({
2321
+ "class": "select2-container"
2322
+ }).html([
2323
+ "<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>",
2324
+ " <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>",
2325
+ " <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>",
2326
+ "</a>",
2327
+ "<label for='' class='select2-offscreen'></label>",
2328
+ "<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />",
2329
+ "<div class='select2-drop select2-display-none'>",
2330
+ " <div class='select2-search'>",
2331
+ " <label for='' class='select2-offscreen'></label>",
2332
+ " <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'",
2333
+ " aria-autocomplete='list' />",
2334
+ " </div>",
2335
+ " <ul class='select2-results' role='listbox'>",
2336
+ " </ul>",
2337
+ "</div>"].join(""));
2338
+ return container;
2339
+ },
2340
+
2341
+ // single
2342
+ enableInterface: function() {
2343
+ if (this.parent.enableInterface.apply(this, arguments)) {
2344
+ this.focusser.prop("disabled", !this.isInterfaceEnabled());
2345
+ }
2346
+ },
2347
+
2348
+ // single
2349
+ opening: function () {
2350
+ var el, range, len;
2351
+
2352
+ if (this.opts.minimumResultsForSearch >= 0) {
2353
+ this.showSearch(true);
2354
+ }
2355
+
2356
+ this.parent.opening.apply(this, arguments);
2357
+
2358
+ if (this.showSearchInput !== false) {
2359
+ // IE appends focusser.val() at the end of field :/ so we manually insert it at the beginning using a range
2360
+ // all other browsers handle this just fine
2361
+
2362
+ this.search.val(this.focusser.val());
2363
+ }
2364
+ if (this.opts.shouldFocusInput(this)) {
2365
+ this.search.focus();
2366
+ // move the cursor to the end after focussing, otherwise it will be at the beginning and
2367
+ // new text will appear *before* focusser.val()
2368
+ el = this.search.get(0);
2369
+ if (el.createTextRange) {
2370
+ range = el.createTextRange();
2371
+ range.collapse(false);
2372
+ range.select();
2373
+ } else if (el.setSelectionRange) {
2374
+ len = this.search.val().length;
2375
+ el.setSelectionRange(len, len);
2376
+ }
2377
+ }
2378
+
2379
+ // initializes search's value with nextSearchTerm (if defined by user)
2380
+ // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
2381
+ if(this.search.val() === "") {
2382
+ if(this.nextSearchTerm != undefined){
2383
+ this.search.val(this.nextSearchTerm);
2384
+ this.search.select();
2385
+ }
2386
+ }
2387
+
2388
+ this.focusser.prop("disabled", true).val("");
2389
+ this.updateResults(true);
2390
+ this.opts.element.trigger($.Event("select2-open"));
2391
+ },
2392
+
2393
+ // single
2394
+ close: function () {
2395
+ if (!this.opened()) return;
2396
+ this.parent.close.apply(this, arguments);
2397
+
2398
+ this.focusser.prop("disabled", false);
2399
+
2400
+ if (this.opts.shouldFocusInput(this)) {
2401
+ this.focusser.focus();
2402
+ }
2403
+ },
2404
+
2405
+ // single
2406
+ focus: function () {
2407
+ if (this.opened()) {
2408
+ this.close();
2409
+ } else {
2410
+ this.focusser.prop("disabled", false);
2411
+ if (this.opts.shouldFocusInput(this)) {
2412
+ this.focusser.focus();
2413
+ }
2414
+ }
2415
+ },
2416
+
2417
+ // single
2418
+ isFocused: function () {
2419
+ return this.container.hasClass("select2-container-active");
2420
+ },
2421
+
2422
+ // single
2423
+ cancel: function () {
2424
+ this.parent.cancel.apply(this, arguments);
2425
+ this.focusser.prop("disabled", false);
2426
+
2427
+ if (this.opts.shouldFocusInput(this)) {
2428
+ this.focusser.focus();
2429
+ }
2430
+ },
2431
+
2432
+ // single
2433
+ destroy: function() {
2434
+ $("label[for='" + this.focusser.attr('id') + "']")
2435
+ .attr('for', this.opts.element.attr("id"));
2436
+ this.parent.destroy.apply(this, arguments);
2437
+
2438
+ cleanupJQueryElements.call(this,
2439
+ "selection",
2440
+ "focusser"
2441
+ );
2442
+ },
2443
+
2444
+ // single
2445
+ initContainer: function () {
2446
+
2447
+ var selection,
2448
+ container = this.container,
2449
+ dropdown = this.dropdown,
2450
+ idSuffix = nextUid(),
2451
+ elementLabel;
2452
+
2453
+ if (this.opts.minimumResultsForSearch < 0) {
2454
+ this.showSearch(false);
2455
+ } else {
2456
+ this.showSearch(true);
2457
+ }
2458
+
2459
+ this.selection = selection = container.find(".select2-choice");
2460
+
2461
+ this.focusser = container.find(".select2-focusser");
2462
+
2463
+ // add aria associations
2464
+ selection.find(".select2-chosen").attr("id", "select2-chosen-"+idSuffix);
2465
+ this.focusser.attr("aria-labelledby", "select2-chosen-"+idSuffix);
2466
+ this.results.attr("id", "select2-results-"+idSuffix);
2467
+ this.search.attr("aria-owns", "select2-results-"+idSuffix);
2468
+
2469
+ // rewrite labels from original element to focusser
2470
+ this.focusser.attr("id", "s2id_autogen"+idSuffix);
2471
+
2472
+ elementLabel = $("label[for='" + this.opts.element.attr("id") + "']");
2473
+
2474
+ this.focusser.prev()
2475
+ .text(elementLabel.text())
2476
+ .attr('for', this.focusser.attr('id'));
2477
+
2478
+ // Ensure the original element retains an accessible name
2479
+ var originalTitle = this.opts.element.attr("title");
2480
+ this.opts.element.attr("title", (originalTitle || elementLabel.text()));
2481
+
2482
+ this.focusser.attr("tabindex", this.elementTabIndex);
2483
+
2484
+ // write label for search field using the label from the focusser element
2485
+ this.search.attr("id", this.focusser.attr('id') + '_search');
2486
+
2487
+ this.search.prev()
2488
+ .text($("label[for='" + this.focusser.attr('id') + "']").text())
2489
+ .attr('for', this.search.attr('id'));
2490
+
2491
+ this.search.on("keydown", this.bind(function (e) {
2492
+ if (!this.isInterfaceEnabled()) return;
2493
+
2494
+ if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
2495
+ // prevent the page from scrolling
2496
+ killEvent(e);
2497
+ return;
2498
+ }
2499
+
2500
+ switch (e.which) {
2501
+ case KEY.UP:
2502
+ case KEY.DOWN:
2503
+ this.moveHighlight((e.which === KEY.UP) ? -1 : 1);
2504
+ killEvent(e);
2505
+ return;
2506
+ case KEY.ENTER:
2507
+ this.selectHighlighted();
2508
+ killEvent(e);
2509
+ return;
2510
+ case KEY.TAB:
2511
+ this.selectHighlighted({noFocus: true});
2512
+ return;
2513
+ case KEY.ESC:
2514
+ this.cancel(e);
2515
+ killEvent(e);
2516
+ return;
2517
+ }
2518
+ }));
2519
+
2520
+ this.search.on("blur", this.bind(function(e) {
2521
+ // a workaround for chrome to keep the search field focussed when the scroll bar is used to scroll the dropdown.
2522
+ // without this the search field loses focus which is annoying
2523
+ if (document.activeElement === this.body.get(0)) {
2524
+ window.setTimeout(this.bind(function() {
2525
+ if (this.opened()) {
2526
+ this.search.focus();
2527
+ }
2528
+ }), 0);
2529
+ }
2530
+ }));
2531
+
2532
+ this.focusser.on("keydown", this.bind(function (e) {
2533
+ if (!this.isInterfaceEnabled()) return;
2534
+
2535
+ if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC) {
2536
+ return;
2537
+ }
2538
+
2539
+ if (this.opts.openOnEnter === false && e.which === KEY.ENTER) {
2540
+ killEvent(e);
2541
+ return;
2542
+ }
2543
+
2544
+ if (e.which == KEY.DOWN || e.which == KEY.UP
2545
+ || (e.which == KEY.ENTER && this.opts.openOnEnter)) {
2546
+
2547
+ if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) return;
2548
+
2549
+ this.open();
2550
+ killEvent(e);
2551
+ return;
2552
+ }
2553
+
2554
+ if (e.which == KEY.DELETE || e.which == KEY.BACKSPACE) {
2555
+ if (this.opts.allowClear) {
2556
+ this.clear();
2557
+ }
2558
+ killEvent(e);
2559
+ return;
2560
+ }
2561
+ }));
2562
+
2563
+
2564
+ installKeyUpChangeEvent(this.focusser);
2565
+ this.focusser.on("keyup-change input", this.bind(function(e) {
2566
+ if (this.opts.minimumResultsForSearch >= 0) {
2567
+ e.stopPropagation();
2568
+ if (this.opened()) return;
2569
+ this.open();
2570
+ }
2571
+ }));
2572
+
2573
+ selection.on("mousedown touchstart", "abbr", this.bind(function (e) {
2574
+ if (!this.isInterfaceEnabled()) return;
2575
+ this.clear();
2576
+ killEventImmediately(e);
2577
+ this.close();
2578
+ this.selection.focus();
2579
+ }));
2580
+
2581
+ selection.on("mousedown touchstart", this.bind(function (e) {
2582
+ // Prevent IE from generating a click event on the body
2583
+ reinsertElement(selection);
2584
+
2585
+ if (!this.container.hasClass("select2-container-active")) {
2586
+ this.opts.element.trigger($.Event("select2-focus"));
2587
+ }
2588
+
2589
+ if (this.opened()) {
2590
+ this.close();
2591
+ } else if (this.isInterfaceEnabled()) {
2592
+ this.open();
2593
+ }
2594
+
2595
+ killEvent(e);
2596
+ }));
2597
+
2598
+ dropdown.on("mousedown touchstart", this.bind(function() {
2599
+ if (this.opts.shouldFocusInput(this)) {
2600
+ this.search.focus();
2601
+ }
2602
+ }));
2603
+
2604
+ selection.on("focus", this.bind(function(e) {
2605
+ killEvent(e);
2606
+ }));
2607
+
2608
+ this.focusser.on("focus", this.bind(function(){
2609
+ if (!this.container.hasClass("select2-container-active")) {
2610
+ this.opts.element.trigger($.Event("select2-focus"));
2611
+ }
2612
+ this.container.addClass("select2-container-active");
2613
+ })).on("blur", this.bind(function() {
2614
+ if (!this.opened()) {
2615
+ this.container.removeClass("select2-container-active");
2616
+ this.opts.element.trigger($.Event("select2-blur"));
2617
+ }
2618
+ }));
2619
+ this.search.on("focus", this.bind(function(){
2620
+ if (!this.container.hasClass("select2-container-active")) {
2621
+ this.opts.element.trigger($.Event("select2-focus"));
2622
+ }
2623
+ this.container.addClass("select2-container-active");
2624
+ }));
2625
+
2626
+ this.initContainerWidth();
2627
+ this.opts.element.addClass("select2-offscreen");
2628
+ this.setPlaceholder();
2629
+
2630
+ },
2631
+
2632
+ // single
2633
+ clear: function(triggerChange) {
2634
+ var data=this.selection.data("select2-data");
2635
+ if (data) { // guard against queued quick consecutive clicks
2636
+ var evt = $.Event("select2-clearing");
2637
+ this.opts.element.trigger(evt);
2638
+ if (evt.isDefaultPrevented()) {
2639
+ return;
2640
+ }
2641
+ var placeholderOption = this.getPlaceholderOption();
2642
+ this.opts.element.val(placeholderOption ? placeholderOption.val() : "");
2643
+ this.selection.find(".select2-chosen").empty();
2644
+ this.selection.removeData("select2-data");
2645
+ this.setPlaceholder();
2646
+
2647
+ if (triggerChange !== false){
2648
+ this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
2649
+ this.triggerChange({removed:data});
2650
+ }
2651
+ }
2652
+ },
2653
+
2654
+ /**
2655
+ * Sets selection based on source element's value
2656
+ */
2657
+ // single
2658
+ initSelection: function () {
2659
+ var selected;
2660
+ if (this.isPlaceholderOptionSelected()) {
2661
+ this.updateSelection(null);
2662
+ this.close();
2663
+ this.setPlaceholder();
2664
+ } else {
2665
+ var self = this;
2666
+ this.opts.initSelection.call(null, this.opts.element, function(selected){
2667
+ if (selected !== undefined && selected !== null) {
2668
+ self.updateSelection(selected);
2669
+ self.close();
2670
+ self.setPlaceholder();
2671
+ self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val());
2672
+ }
2673
+ });
2674
+ }
2675
+ },
2676
+
2677
+ isPlaceholderOptionSelected: function() {
2678
+ var placeholderOption;
2679
+ if (this.getPlaceholder() === undefined) return false; // no placeholder specified so no option should be considered
2680
+ return ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.prop("selected"))
2681
+ || (this.opts.element.val() === "")
2682
+ || (this.opts.element.val() === undefined)
2683
+ || (this.opts.element.val() === null);
2684
+ },
2685
+
2686
+ // single
2687
+ prepareOpts: function () {
2688
+ var opts = this.parent.prepareOpts.apply(this, arguments),
2689
+ self=this;
2690
+
2691
+ if (opts.element.get(0).tagName.toLowerCase() === "select") {
2692
+ // install the selection initializer
2693
+ opts.initSelection = function (element, callback) {
2694
+ var selected = element.find("option").filter(function() { return this.selected && !this.disabled });
2695
+ // a single select box always has a value, no need to null check 'selected'
2696
+ callback(self.optionToData(selected));
2697
+ };
2698
+ } else if ("data" in opts) {
2699
+ // install default initSelection when applied to hidden input and data is local
2700
+ opts.initSelection = opts.initSelection || function (element, callback) {
2701
+ var id = element.val();
2702
+ //search in data by id, storing the actual matching item
2703
+ var match = null;
2704
+ opts.query({
2705
+ matcher: function(term, text, el){
2706
+ var is_match = equal(id, opts.id(el));
2707
+ if (is_match) {
2708
+ match = el;
2709
+ }
2710
+ return is_match;
2711
+ },
2712
+ callback: !$.isFunction(callback) ? $.noop : function() {
2713
+ callback(match);
2714
+ }
2715
+ });
2716
+ };
2717
+ }
2718
+
2719
+ return opts;
2720
+ },
2721
+
2722
+ // single
2723
+ getPlaceholder: function() {
2724
+ // if a placeholder is specified on a single select without a valid placeholder option ignore it
2725
+ if (this.select) {
2726
+ if (this.getPlaceholderOption() === undefined) {
2727
+ return undefined;
2728
+ }
2729
+ }
2730
+
2731
+ return this.parent.getPlaceholder.apply(this, arguments);
2732
+ },
2733
+
2734
+ // single
2735
+ setPlaceholder: function () {
2736
+ var placeholder = this.getPlaceholder();
2737
+
2738
+ if (this.isPlaceholderOptionSelected() && placeholder !== undefined) {
2739
+
2740
+ // check for a placeholder option if attached to a select
2741
+ if (this.select && this.getPlaceholderOption() === undefined) return;
2742
+
2743
+ this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(placeholder));
2744
+
2745
+ this.selection.addClass("select2-default");
2746
+
2747
+ this.container.removeClass("select2-allowclear");
2748
+ }
2749
+ },
2750
+
2751
+ // single
2752
+ postprocessResults: function (data, initial, noHighlightUpdate) {
2753
+ var selected = 0, self = this, showSearchInput = true;
2754
+
2755
+ // find the selected element in the result list
2756
+
2757
+ this.findHighlightableChoices().each2(function (i, elm) {
2758
+ if (equal(self.id(elm.data("select2-data")), self.opts.element.val())) {
2759
+ selected = i;
2760
+ return false;
2761
+ }
2762
+ });
2763
+
2764
+ // and highlight it
2765
+ if (noHighlightUpdate !== false) {
2766
+ if (initial === true && selected >= 0) {
2767
+ this.highlight(selected);
2768
+ } else {
2769
+ this.highlight(0);
2770
+ }
2771
+ }
2772
+
2773
+ // hide the search box if this is the first we got the results and there are enough of them for search
2774
+
2775
+ if (initial === true) {
2776
+ var min = this.opts.minimumResultsForSearch;
2777
+ if (min >= 0) {
2778
+ this.showSearch(countResults(data.results) >= min);
2779
+ }
2780
+ }
2781
+ },
2782
+
2783
+ // single
2784
+ showSearch: function(showSearchInput) {
2785
+ if (this.showSearchInput === showSearchInput) return;
2786
+
2787
+ this.showSearchInput = showSearchInput;
2788
+
2789
+ this.dropdown.find(".select2-search").toggleClass("select2-search-hidden", !showSearchInput);
2790
+ this.dropdown.find(".select2-search").toggleClass("select2-offscreen", !showSearchInput);
2791
+ //add "select2-with-searchbox" to the container if search box is shown
2792
+ $(this.dropdown, this.container).toggleClass("select2-with-searchbox", showSearchInput);
2793
+ },
2794
+
2795
+ // single
2796
+ onSelect: function (data, options) {
2797
+
2798
+ if (!this.triggerSelect(data)) { return; }
2799
+
2800
+ var old = this.opts.element.val(),
2801
+ oldData = this.data();
2802
+
2803
+ this.opts.element.val(this.id(data));
2804
+ this.updateSelection(data);
2805
+
2806
+ this.opts.element.trigger({ type: "select2-selected", val: this.id(data), choice: data });
2807
+
2808
+ this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val());
2809
+ this.close();
2810
+
2811
+ if ((!options || !options.noFocus) && this.opts.shouldFocusInput(this)) {
2812
+ this.focusser.focus();
2813
+ }
2814
+
2815
+ if (!equal(old, this.id(data))) {
2816
+ this.triggerChange({ added: data, removed: oldData });
2817
+ }
2818
+ },
2819
+
2820
+ // single
2821
+ updateSelection: function (data) {
2822
+
2823
+ var container=this.selection.find(".select2-chosen"), formatted, cssClass;
2824
+
2825
+ this.selection.data("select2-data", data);
2826
+
2827
+ container.empty();
2828
+ if (data !== null) {
2829
+ formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup);
2830
+ }
2831
+ if (formatted !== undefined) {
2832
+ container.append(formatted);
2833
+ }
2834
+ cssClass=this.opts.formatSelectionCssClass(data, container);
2835
+ if (cssClass !== undefined) {
2836
+ container.addClass(cssClass);
2837
+ }
2838
+
2839
+ this.selection.removeClass("select2-default");
2840
+
2841
+ if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
2842
+ this.container.addClass("select2-allowclear");
2843
+ }
2844
+ },
2845
+
2846
+ // single
2847
+ val: function () {
2848
+ var val,
2849
+ triggerChange = false,
2850
+ data = null,
2851
+ self = this,
2852
+ oldData = this.data();
2853
+
2854
+ if (arguments.length === 0) {
2855
+ return this.opts.element.val();
2856
+ }
2857
+
2858
+ val = arguments[0];
2859
+
2860
+ if (arguments.length > 1) {
2861
+ triggerChange = arguments[1];
2862
+ }
2863
+
2864
+ if (this.select) {
2865
+ this.select
2866
+ .val(val)
2867
+ .find("option").filter(function() { return this.selected }).each2(function (i, elm) {
2868
+ data = self.optionToData(elm);
2869
+ return false;
2870
+ });
2871
+ this.updateSelection(data);
2872
+ this.setPlaceholder();
2873
+ if (triggerChange) {
2874
+ this.triggerChange({added: data, removed:oldData});
2875
+ }
2876
+ } else {
2877
+ // val is an id. !val is true for [undefined,null,'',0] - 0 is legal
2878
+ if (!val && val !== 0) {
2879
+ this.clear(triggerChange);
2880
+ return;
2881
+ }
2882
+ if (this.opts.initSelection === undefined) {
2883
+ throw new Error("cannot call val() if initSelection() is not defined");
2884
+ }
2885
+ this.opts.element.val(val);
2886
+ this.opts.initSelection(this.opts.element, function(data){
2887
+ self.opts.element.val(!data ? "" : self.id(data));
2888
+ self.updateSelection(data);
2889
+ self.setPlaceholder();
2890
+ if (triggerChange) {
2891
+ self.triggerChange({added: data, removed:oldData});
2892
+ }
2893
+ });
2894
+ }
2895
+ },
2896
+
2897
+ // single
2898
+ clearSearch: function () {
2899
+ this.search.val("");
2900
+ this.focusser.val("");
2901
+ },
2902
+
2903
+ // single
2904
+ data: function(value) {
2905
+ var data,
2906
+ triggerChange = false;
2907
+
2908
+ if (arguments.length === 0) {
2909
+ data = this.selection.data("select2-data");
2910
+ if (data == undefined) data = null;
2911
+ return data;
2912
+ } else {
2913
+ if (arguments.length > 1) {
2914
+ triggerChange = arguments[1];
2915
+ }
2916
+ if (!value) {
2917
+ this.clear(triggerChange);
2918
+ } else {
2919
+ data = this.data();
2920
+ this.opts.element.val(!value ? "" : this.id(value));
2921
+ this.updateSelection(value);
2922
+ if (triggerChange) {
2923
+ this.triggerChange({added: value, removed:data});
2924
+ }
2925
+ }
2926
+ }
2927
+ }
2928
+ });
2929
+
2930
+ MultiSelect2 = clazz(AbstractSelect2, {
2931
+
2932
+ // multi
2933
+ createContainer: function () {
2934
+ var container = $(document.createElement("div")).attr({
2935
+ "class": "select2-container select2-container-multi"
2936
+ }).html([
2937
+ "<ul class='select2-choices'>",
2938
+ " <li class='select2-search-field'>",
2939
+ " <label for='' class='select2-offscreen'></label>",
2940
+ " <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>",
2941
+ " </li>",
2942
+ "</ul>",
2943
+ "<div class='select2-drop select2-drop-multi select2-display-none'>",
2944
+ " <ul class='select2-results'>",
2945
+ " </ul>",
2946
+ "</div>"].join(""));
2947
+ return container;
2948
+ },
2949
+
2950
+ // multi
2951
+ prepareOpts: function () {
2952
+ var opts = this.parent.prepareOpts.apply(this, arguments),
2953
+ self=this;
2954
+
2955
+ // TODO validate placeholder is a string if specified
2956
+
2957
+ if (opts.element.get(0).tagName.toLowerCase() === "select") {
2958
+ // install the selection initializer
2959
+ opts.initSelection = function (element, callback) {
2960
+
2961
+ var data = [];
2962
+
2963
+ element.find("option").filter(function() { return this.selected && !this.disabled }).each2(function (i, elm) {
2964
+ data.push(self.optionToData(elm));
2965
+ });
2966
+ callback(data);
2967
+ };
2968
+ } else if ("data" in opts) {
2969
+ // install default initSelection when applied to hidden input and data is local
2970
+ opts.initSelection = opts.initSelection || function (element, callback) {
2971
+ var ids = splitVal(element.val(), opts.separator);
2972
+ //search in data by array of ids, storing matching items in a list
2973
+ var matches = [];
2974
+ opts.query({
2975
+ matcher: function(term, text, el){
2976
+ var is_match = $.grep(ids, function(id) {
2977
+ return equal(id, opts.id(el));
2978
+ }).length;
2979
+ if (is_match) {
2980
+ matches.push(el);
2981
+ }
2982
+ return is_match;
2983
+ },
2984
+ callback: !$.isFunction(callback) ? $.noop : function() {
2985
+ // reorder matches based on the order they appear in the ids array because right now
2986
+ // they are in the order in which they appear in data array
2987
+ var ordered = [];
2988
+ for (var i = 0; i < ids.length; i++) {
2989
+ var id = ids[i];
2990
+ for (var j = 0; j < matches.length; j++) {
2991
+ var match = matches[j];
2992
+ if (equal(id, opts.id(match))) {
2993
+ ordered.push(match);
2994
+ matches.splice(j, 1);
2995
+ break;
2996
+ }
2997
+ }
2998
+ }
2999
+ callback(ordered);
3000
+ }
3001
+ });
3002
+ };
3003
+ }
3004
+
3005
+ return opts;
3006
+ },
3007
+
3008
+ // multi
3009
+ selectChoice: function (choice) {
3010
+
3011
+ var selected = this.container.find(".select2-search-choice-focus");
3012
+ if (selected.length && choice && choice[0] == selected[0]) {
3013
+
3014
+ } else {
3015
+ if (selected.length) {
3016
+ this.opts.element.trigger("choice-deselected", selected);
3017
+ }
3018
+ selected.removeClass("select2-search-choice-focus");
3019
+ if (choice && choice.length) {
3020
+ this.close();
3021
+ choice.addClass("select2-search-choice-focus");
3022
+ this.opts.element.trigger("choice-selected", choice);
3023
+ }
3024
+ }
3025
+ },
3026
+
3027
+ // multi
3028
+ destroy: function() {
3029
+ $("label[for='" + this.search.attr('id') + "']")
3030
+ .attr('for', this.opts.element.attr("id"));
3031
+ this.parent.destroy.apply(this, arguments);
3032
+
3033
+ cleanupJQueryElements.call(this,
3034
+ "searchContainer",
3035
+ "selection"
3036
+ );
3037
+ },
3038
+
3039
+ // multi
3040
+ initContainer: function () {
3041
+
3042
+ var selector = ".select2-choices", selection;
3043
+
3044
+ this.searchContainer = this.container.find(".select2-search-field");
3045
+ this.selection = selection = this.container.find(selector);
3046
+
3047
+ var _this = this;
3048
+ this.selection.on("click", ".select2-search-choice:not(.select2-locked)", function (e) {
3049
+ //killEvent(e);
3050
+ _this.search[0].focus();
3051
+ _this.selectChoice($(this));
3052
+ });
3053
+
3054
+ // rewrite labels from original element to focusser
3055
+ this.search.attr("id", "s2id_autogen"+nextUid());
3056
+
3057
+ this.search.prev()
3058
+ .text($("label[for='" + this.opts.element.attr("id") + "']").text())
3059
+ .attr('for', this.search.attr('id'));
3060
+
3061
+ this.search.on("input paste", this.bind(function() {
3062
+ if (!this.isInterfaceEnabled()) return;
3063
+ if (!this.opened()) {
3064
+ this.open();
3065
+ }
3066
+ }));
3067
+
3068
+ this.search.attr("tabindex", this.elementTabIndex);
3069
+
3070
+ this.keydowns = 0;
3071
+ this.search.on("keydown", this.bind(function (e) {
3072
+ if (!this.isInterfaceEnabled()) return;
3073
+
3074
+ ++this.keydowns;
3075
+ var selected = selection.find(".select2-search-choice-focus");
3076
+ var prev = selected.prev(".select2-search-choice:not(.select2-locked)");
3077
+ var next = selected.next(".select2-search-choice:not(.select2-locked)");
3078
+ var pos = getCursorInfo(this.search);
3079
+
3080
+ if (selected.length &&
3081
+ (e.which == KEY.LEFT || e.which == KEY.RIGHT || e.which == KEY.BACKSPACE || e.which == KEY.DELETE || e.which == KEY.ENTER)) {
3082
+ var selectedChoice = selected;
3083
+ if (e.which == KEY.LEFT && prev.length) {
3084
+ selectedChoice = prev;
3085
+ }
3086
+ else if (e.which == KEY.RIGHT) {
3087
+ selectedChoice = next.length ? next : null;
3088
+ }
3089
+ else if (e.which === KEY.BACKSPACE) {
3090
+ if (this.unselect(selected.first())) {
3091
+ this.search.width(10);
3092
+ selectedChoice = prev.length ? prev : next;
3093
+ }
3094
+ } else if (e.which == KEY.DELETE) {
3095
+ if (this.unselect(selected.first())) {
3096
+ this.search.width(10);
3097
+ selectedChoice = next.length ? next : null;
3098
+ }
3099
+ } else if (e.which == KEY.ENTER) {
3100
+ selectedChoice = null;
3101
+ }
3102
+
3103
+ this.selectChoice(selectedChoice);
3104
+ killEvent(e);
3105
+ if (!selectedChoice || !selectedChoice.length) {
3106
+ this.open();
3107
+ }
3108
+ return;
3109
+ } else if (((e.which === KEY.BACKSPACE && this.keydowns == 1)
3110
+ || e.which == KEY.LEFT) && (pos.offset == 0 && !pos.length)) {
3111
+
3112
+ this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last());
3113
+ killEvent(e);
3114
+ return;
3115
+ } else {
3116
+ this.selectChoice(null);
3117
+ }
3118
+
3119
+ if (this.opened()) {
3120
+ switch (e.which) {
3121
+ case KEY.UP:
3122
+ case KEY.DOWN:
3123
+ this.moveHighlight((e.which === KEY.UP) ? -1 : 1);
3124
+ killEvent(e);
3125
+ return;
3126
+ case KEY.ENTER:
3127
+ this.selectHighlighted();
3128
+ killEvent(e);
3129
+ return;
3130
+ case KEY.TAB:
3131
+ this.selectHighlighted({noFocus:true});
3132
+ this.close();
3133
+ return;
3134
+ case KEY.ESC:
3135
+ this.cancel(e);
3136
+ killEvent(e);
3137
+ return;
3138
+ }
3139
+ }
3140
+
3141
+ if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e)
3142
+ || e.which === KEY.BACKSPACE || e.which === KEY.ESC) {
3143
+ return;
3144
+ }
3145
+
3146
+ if (e.which === KEY.ENTER) {
3147
+ if (this.opts.openOnEnter === false) {
3148
+ return;
3149
+ } else if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
3150
+ return;
3151
+ }
3152
+ }
3153
+
3154
+ this.open();
3155
+
3156
+ if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
3157
+ // prevent the page from scrolling
3158
+ killEvent(e);
3159
+ }
3160
+
3161
+ if (e.which === KEY.ENTER) {
3162
+ // prevent form from being submitted
3163
+ killEvent(e);
3164
+ }
3165
+
3166
+ }));
3167
+
3168
+ this.search.on("keyup", this.bind(function (e) {
3169
+ this.keydowns = 0;
3170
+ this.resizeSearch();
3171
+ })
3172
+ );
3173
+
3174
+ this.search.on("blur", this.bind(function(e) {
3175
+ this.container.removeClass("select2-container-active");
3176
+ this.search.removeClass("select2-focused");
3177
+ this.selectChoice(null);
3178
+ if (!this.opened()) this.clearSearch();
3179
+ e.stopImmediatePropagation();
3180
+ this.opts.element.trigger($.Event("select2-blur"));
3181
+ }));
3182
+
3183
+ this.container.on("click", selector, this.bind(function (e) {
3184
+ if (!this.isInterfaceEnabled()) return;
3185
+ if ($(e.target).closest(".select2-search-choice").length > 0) {
3186
+ // clicked inside a select2 search choice, do not open
3187
+ return;
3188
+ }
3189
+ this.selectChoice(null);
3190
+ this.clearPlaceholder();
3191
+ if (!this.container.hasClass("select2-container-active")) {
3192
+ this.opts.element.trigger($.Event("select2-focus"));
3193
+ }
3194
+ this.open();
3195
+ this.focusSearch();
3196
+ e.preventDefault();
3197
+ }));
3198
+
3199
+ this.container.on("focus", selector, this.bind(function () {
3200
+ if (!this.isInterfaceEnabled()) return;
3201
+ if (!this.container.hasClass("select2-container-active")) {
3202
+ this.opts.element.trigger($.Event("select2-focus"));
3203
+ }
3204
+ this.container.addClass("select2-container-active");
3205
+ this.dropdown.addClass("select2-drop-active");
3206
+ this.clearPlaceholder();
3207
+ }));
3208
+
3209
+ this.initContainerWidth();
3210
+ this.opts.element.addClass("select2-offscreen");
3211
+
3212
+ // set the placeholder if necessary
3213
+ this.clearSearch();
3214
+ },
3215
+
3216
+ // multi
3217
+ enableInterface: function() {
3218
+ if (this.parent.enableInterface.apply(this, arguments)) {
3219
+ this.search.prop("disabled", !this.isInterfaceEnabled());
3220
+ }
3221
+ },
3222
+
3223
+ // multi
3224
+ initSelection: function () {
3225
+ var data;
3226
+ if (this.opts.element.val() === "" && this.opts.element.text() === "") {
3227
+ this.updateSelection([]);
3228
+ this.close();
3229
+ // set the placeholder if necessary
3230
+ this.clearSearch();
3231
+ }
3232
+ if (this.select || this.opts.element.val() !== "") {
3233
+ var self = this;
3234
+ this.opts.initSelection.call(null, this.opts.element, function(data){
3235
+ if (data !== undefined && data !== null) {
3236
+ self.updateSelection(data);
3237
+ self.close();
3238
+ // set the placeholder if necessary
3239
+ self.clearSearch();
3240
+ }
3241
+ });
3242
+ }
3243
+ },
3244
+
3245
+ // multi
3246
+ clearSearch: function () {
3247
+ var placeholder = this.getPlaceholder(),
3248
+ maxWidth = this.getMaxSearchWidth();
3249
+
3250
+ if (placeholder !== undefined && this.getVal().length === 0 && this.search.hasClass("select2-focused") === false) {
3251
+ this.search.val(placeholder).addClass("select2-default");
3252
+ // stretch the search box to full width of the container so as much of the placeholder is visible as possible
3253
+ // we could call this.resizeSearch(), but we do not because that requires a sizer and we do not want to create one so early because of a firefox bug, see #944
3254
+ this.search.width(maxWidth > 0 ? maxWidth : this.container.css("width"));
3255
+ } else {
3256
+ this.search.val("").width(10);
3257
+ }
3258
+ },
3259
+
3260
+ // multi
3261
+ clearPlaceholder: function () {
3262
+ if (this.search.hasClass("select2-default")) {
3263
+ this.search.val("").removeClass("select2-default");
3264
+ }
3265
+ },
3266
+
3267
+ // multi
3268
+ opening: function () {
3269
+ this.clearPlaceholder(); // should be done before super so placeholder is not used to search
3270
+ this.resizeSearch();
3271
+
3272
+ this.parent.opening.apply(this, arguments);
3273
+
3274
+ this.focusSearch();
3275
+
3276
+ // initializes search's value with nextSearchTerm (if defined by user)
3277
+ // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
3278
+ if(this.search.val() === "") {
3279
+ if(this.nextSearchTerm != undefined){
3280
+ this.search.val(this.nextSearchTerm);
3281
+ this.search.select();
3282
+ }
3283
+ }
3284
+
3285
+ this.updateResults(true);
3286
+ if (this.opts.shouldFocusInput(this)) {
3287
+ this.search.focus();
3288
+ }
3289
+ this.opts.element.trigger($.Event("select2-open"));
3290
+ },
3291
+
3292
+ // multi
3293
+ close: function () {
3294
+ if (!this.opened()) return;
3295
+ this.parent.close.apply(this, arguments);
3296
+ },
3297
+
3298
+ // multi
3299
+ focus: function () {
3300
+ this.close();
3301
+ this.search.focus();
3302
+ },
3303
+
3304
+ // multi
3305
+ isFocused: function () {
3306
+ return this.search.hasClass("select2-focused");
3307
+ },
3308
+
3309
+ // multi
3310
+ updateSelection: function (data) {
3311
+ var ids = [], filtered = [], self = this;
3312
+
3313
+ // filter out duplicates
3314
+ $(data).each(function () {
3315
+ if (indexOf(self.id(this), ids) < 0) {
3316
+ ids.push(self.id(this));
3317
+ filtered.push(this);
3318
+ }
3319
+ });
3320
+ data = filtered;
3321
+
3322
+ this.selection.find(".select2-search-choice").remove();
3323
+ $(data).each(function () {
3324
+ self.addSelectedChoice(this);
3325
+ });
3326
+ self.postprocessResults();
3327
+ },
3328
+
3329
+ // multi
3330
+ tokenize: function() {
3331
+ var input = this.search.val();
3332
+ input = this.opts.tokenizer.call(this, input, this.data(), this.bind(this.onSelect), this.opts);
3333
+ if (input != null && input != undefined) {
3334
+ this.search.val(input);
3335
+ if (input.length > 0) {
3336
+ this.open();
3337
+ }
3338
+ }
3339
+
3340
+ },
3341
+
3342
+ // multi
3343
+ onSelect: function (data, options) {
3344
+
3345
+ if (!this.triggerSelect(data)) { return; }
3346
+
3347
+ this.addSelectedChoice(data);
3348
+
3349
+ this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data });
3350
+
3351
+ // keep track of the search's value before it gets cleared
3352
+ this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val());
3353
+
3354
+ this.clearSearch();
3355
+ this.updateResults();
3356
+
3357
+ if (this.select || !this.opts.closeOnSelect) this.postprocessResults(data, false, this.opts.closeOnSelect===true);
3358
+
3359
+ if (this.opts.closeOnSelect) {
3360
+ this.close();
3361
+ this.search.width(10);
3362
+ } else {
3363
+ if (this.countSelectableResults()>0) {
3364
+ this.search.width(10);
3365
+ this.resizeSearch();
3366
+ if (this.getMaximumSelectionSize() > 0 && this.val().length >= this.getMaximumSelectionSize()) {
3367
+ // if we reached max selection size repaint the results so choices
3368
+ // are replaced with the max selection reached message
3369
+ this.updateResults(true);
3370
+ } else {
3371
+ // initializes search's value with nextSearchTerm and update search result
3372
+ if(this.nextSearchTerm != undefined){
3373
+ this.search.val(this.nextSearchTerm);
3374
+ this.updateResults();
3375
+ this.search.select();
3376
+ }
3377
+ }
3378
+ this.positionDropdown();
3379
+ } else {
3380
+ // if nothing left to select close
3381
+ this.close();
3382
+ this.search.width(10);
3383
+ }
3384
+ }
3385
+
3386
+ // since its not possible to select an element that has already been
3387
+ // added we do not need to check if this is a new element before firing change
3388
+ this.triggerChange({ added: data });
3389
+
3390
+ if (!options || !options.noFocus)
3391
+ this.focusSearch();
3392
+ },
3393
+
3394
+ // multi
3395
+ cancel: function () {
3396
+ this.close();
3397
+ this.focusSearch();
3398
+ },
3399
+
3400
+ addSelectedChoice: function (data) {
3401
+ var enableChoice = !data.locked,
3402
+ enabledItem = $(
3403
+ "<li class='select2-search-choice'>" +
3404
+ " <div></div>" +
3405
+ " <a href='#' class='select2-search-choice-close' tabindex='-1'></a>" +
3406
+ "</li>"),
3407
+ disabledItem = $(
3408
+ "<li class='select2-search-choice select2-locked'>" +
3409
+ "<div></div>" +
3410
+ "</li>");
3411
+ var choice = enableChoice ? enabledItem : disabledItem,
3412
+ id = this.id(data),
3413
+ val = this.getVal(),
3414
+ formatted,
3415
+ cssClass;
3416
+
3417
+ formatted=this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup);
3418
+ if (formatted != undefined) {
3419
+ choice.find("div").replaceWith("<div>"+formatted+"</div>");
3420
+ }
3421
+ cssClass=this.opts.formatSelectionCssClass(data, choice.find("div"));
3422
+ if (cssClass != undefined) {
3423
+ choice.addClass(cssClass);
3424
+ }
3425
+
3426
+ if(enableChoice){
3427
+ choice.find(".select2-search-choice-close")
3428
+ .on("mousedown", killEvent)
3429
+ .on("click dblclick", this.bind(function (e) {
3430
+ if (!this.isInterfaceEnabled()) return;
3431
+
3432
+ this.unselect($(e.target));
3433
+ this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
3434
+ killEvent(e);
3435
+ this.close();
3436
+ this.focusSearch();
3437
+ })).on("focus", this.bind(function () {
3438
+ if (!this.isInterfaceEnabled()) return;
3439
+ this.container.addClass("select2-container-active");
3440
+ this.dropdown.addClass("select2-drop-active");
3441
+ }));
3442
+ }
3443
+
3444
+ choice.data("select2-data", data);
3445
+ choice.insertBefore(this.searchContainer);
3446
+
3447
+ val.push(id);
3448
+ this.setVal(val);
3449
+ },
3450
+
3451
+ // multi
3452
+ unselect: function (selected) {
3453
+ var val = this.getVal(),
3454
+ data,
3455
+ index;
3456
+ selected = selected.closest(".select2-search-choice");
3457
+
3458
+ if (selected.length === 0) {
3459
+ throw "Invalid argument: " + selected + ". Must be .select2-search-choice";
3460
+ }
3461
+
3462
+ data = selected.data("select2-data");
3463
+
3464
+ if (!data) {
3465
+ // prevent a race condition when the 'x' is clicked really fast repeatedly the event can be queued
3466
+ // and invoked on an element already removed
3467
+ return;
3468
+ }
3469
+
3470
+ var evt = $.Event("select2-removing");
3471
+ evt.val = this.id(data);
3472
+ evt.choice = data;
3473
+ this.opts.element.trigger(evt);
3474
+
3475
+ if (evt.isDefaultPrevented()) {
3476
+ return false;
3477
+ }
3478
+
3479
+ while((index = indexOf(this.id(data), val)) >= 0) {
3480
+ val.splice(index, 1);
3481
+ this.setVal(val);
3482
+ if (this.select) this.postprocessResults();
3483
+ }
3484
+
3485
+ selected.remove();
3486
+
3487
+ this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
3488
+ this.triggerChange({ removed: data });
3489
+
3490
+ return true;
3491
+ },
3492
+
3493
+ // multi
3494
+ postprocessResults: function (data, initial, noHighlightUpdate) {
3495
+ var val = this.getVal(),
3496
+ choices = this.results.find(".select2-result"),
3497
+ compound = this.results.find(".select2-result-with-children"),
3498
+ self = this;
3499
+
3500
+ choices.each2(function (i, choice) {
3501
+ var id = self.id(choice.data("select2-data"));
3502
+ if (indexOf(id, val) >= 0) {
3503
+ choice.addClass("select2-selected");
3504
+ // mark all children of the selected parent as selected
3505
+ choice.find(".select2-result-selectable").addClass("select2-selected");
3506
+ }
3507
+ });
3508
+
3509
+ compound.each2(function(i, choice) {
3510
+ // hide an optgroup if it doesn't have any selectable children
3511
+ if (!choice.is('.select2-result-selectable')
3512
+ && choice.find(".select2-result-selectable:not(.select2-selected)").length === 0) {
3513
+ choice.addClass("select2-selected");
3514
+ }
3515
+ });
3516
+
3517
+ if (this.highlight() == -1 && noHighlightUpdate !== false){
3518
+ self.highlight(0);
3519
+ }
3520
+
3521
+ //If all results are chosen render formatNoMatches
3522
+ if(!this.opts.createSearchChoice && !choices.filter('.select2-result:not(.select2-selected)').length > 0){
3523
+ if(!data || data && !data.more && this.results.find(".select2-no-results").length === 0) {
3524
+ if (checkFormatter(self.opts.formatNoMatches, "formatNoMatches")) {
3525
+ this.results.append("<li class='select2-no-results'>" + evaluate(self.opts.formatNoMatches, self.search.val()) + "</li>");
3526
+ }
3527
+ }
3528
+ }
3529
+
3530
+ },
3531
+
3532
+ // multi
3533
+ getMaxSearchWidth: function() {
3534
+ return this.selection.width() - getSideBorderPadding(this.search);
3535
+ },
3536
+
3537
+ // multi
3538
+ resizeSearch: function () {
3539
+ var minimumWidth, left, maxWidth, containerLeft, searchWidth,
3540
+ sideBorderPadding = getSideBorderPadding(this.search);
3541
+
3542
+ minimumWidth = measureTextWidth(this.search) + 10;
3543
+
3544
+ left = this.search.offset().left;
3545
+
3546
+ maxWidth = this.selection.width();
3547
+ containerLeft = this.selection.offset().left;
3548
+
3549
+ searchWidth = maxWidth - (left - containerLeft) - sideBorderPadding;
3550
+
3551
+ if (searchWidth < minimumWidth) {
3552
+ searchWidth = maxWidth - sideBorderPadding;
3553
+ }
3554
+
3555
+ if (searchWidth < 40) {
3556
+ searchWidth = maxWidth - sideBorderPadding;
3557
+ }
3558
+
3559
+ if (searchWidth <= 0) {
3560
+ searchWidth = minimumWidth;
3561
+ }
3562
+
3563
+ this.search.width(Math.floor(searchWidth));
3564
+ },
3565
+
3566
+ // multi
3567
+ getVal: function () {
3568
+ var val;
3569
+ if (this.select) {
3570
+ val = this.select.val();
3571
+ return val === null ? [] : val;
3572
+ } else {
3573
+ val = this.opts.element.val();
3574
+ return splitVal(val, this.opts.separator);
3575
+ }
3576
+ },
3577
+
3578
+ // multi
3579
+ setVal: function (val) {
3580
+ var unique;
3581
+ if (this.select) {
3582
+ this.select.val(val);
3583
+ } else {
3584
+ unique = [];
3585
+ // filter out duplicates
3586
+ $(val).each(function () {
3587
+ if (indexOf(this, unique) < 0) unique.push(this);
3588
+ });
3589
+ this.opts.element.val(unique.length === 0 ? "" : unique.join(this.opts.separator));
3590
+ }
3591
+ },
3592
+
3593
+ // multi
3594
+ buildChangeDetails: function (old, current) {
3595
+ var current = current.slice(0),
3596
+ old = old.slice(0);
3597
+
3598
+ // remove intersection from each array
3599
+ for (var i = 0; i < current.length; i++) {
3600
+ for (var j = 0; j < old.length; j++) {
3601
+ if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) {
3602
+ current.splice(i, 1);
3603
+ if(i>0){
3604
+ i--;
3605
+ }
3606
+ old.splice(j, 1);
3607
+ j--;
3608
+ }
3609
+ }
3610
+ }
3611
+
3612
+ return {added: current, removed: old};
3613
+ },
3614
+
3615
+
3616
+ // multi
3617
+ val: function (val, triggerChange) {
3618
+ var oldData, self=this;
3619
+
3620
+ if (arguments.length === 0) {
3621
+ return this.getVal();
3622
+ }
3623
+
3624
+ oldData=this.data();
3625
+ if (!oldData.length) oldData=[];
3626
+
3627
+ // val is an id. !val is true for [undefined,null,'',0] - 0 is legal
3628
+ if (!val && val !== 0) {
3629
+ this.opts.element.val("");
3630
+ this.updateSelection([]);
3631
+ this.clearSearch();
3632
+ if (triggerChange) {
3633
+ this.triggerChange({added: this.data(), removed: oldData});
3634
+ }
3635
+ return;
3636
+ }
3637
+
3638
+ // val is a list of ids
3639
+ this.setVal(val);
3640
+
3641
+ if (this.select) {
3642
+ this.opts.initSelection(this.select, this.bind(this.updateSelection));
3643
+ if (triggerChange) {
3644
+ this.triggerChange(this.buildChangeDetails(oldData, this.data()));
3645
+ }
3646
+ } else {
3647
+ if (this.opts.initSelection === undefined) {
3648
+ throw new Error("val() cannot be called if initSelection() is not defined");
3649
+ }
3650
+
3651
+ this.opts.initSelection(this.opts.element, function(data){
3652
+ var ids=$.map(data, self.id);
3653
+ self.setVal(ids);
3654
+ self.updateSelection(data);
3655
+ self.clearSearch();
3656
+ if (triggerChange) {
3657
+ self.triggerChange(self.buildChangeDetails(oldData, self.data()));
3658
+ }
3659
+ });
3660
+ }
3661
+ this.clearSearch();
3662
+ },
3663
+
3664
+ // multi
3665
+ onSortStart: function() {
3666
+ if (this.select) {
3667
+ throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");
3668
+ }
3669
+
3670
+ // collapse search field into 0 width so its container can be collapsed as well
3671
+ this.search.width(0);
3672
+ // hide the container
3673
+ this.searchContainer.hide();
3674
+ },
3675
+
3676
+ // multi
3677
+ onSortEnd:function() {
3678
+
3679
+ var val=[], self=this;
3680
+
3681
+ // show search and move it to the end of the list
3682
+ this.searchContainer.show();
3683
+ // make sure the search container is the last item in the list
3684
+ this.searchContainer.appendTo(this.searchContainer.parent());
3685
+ // since we collapsed the width in dragStarted, we resize it here
3686
+ this.resizeSearch();
3687
+
3688
+ // update selection
3689
+ this.selection.find(".select2-search-choice").each(function() {
3690
+ val.push(self.opts.id($(this).data("select2-data")));
3691
+ });
3692
+ this.setVal(val);
3693
+ this.triggerChange();
3694
+ },
3695
+
3696
+ // multi
3697
+ data: function(values, triggerChange) {
3698
+ var self=this, ids, old;
3699
+ if (arguments.length === 0) {
3700
+ return this.selection
3701
+ .children(".select2-search-choice")
3702
+ .map(function() { return $(this).data("select2-data"); })
3703
+ .get();
3704
+ } else {
3705
+ old = this.data();
3706
+ if (!values) { values = []; }
3707
+ ids = $.map(values, function(e) { return self.opts.id(e); });
3708
+ this.setVal(ids);
3709
+ this.updateSelection(values);
3710
+ this.clearSearch();
3711
+ if (triggerChange) {
3712
+ this.triggerChange(this.buildChangeDetails(old, this.data()));
3713
+ }
3714
+ }
3715
+ }
3716
+ });
3717
+
3718
+ $.fn.select2 = function () {
3719
+
3720
+ var args = Array.prototype.slice.call(arguments, 0),
3721
+ opts,
3722
+ select2,
3723
+ method, value, multiple,
3724
+ allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "disable", "readonly", "positionDropdown", "data", "search"],
3725
+ valueMethods = ["opened", "isFocused", "container", "dropdown"],
3726
+ propertyMethods = ["val", "data"],
3727
+ methodsMap = { search: "externalSearch" };
3728
+
3729
+ this.each(function () {
3730
+ if (args.length === 0 || typeof(args[0]) === "object") {
3731
+ opts = args.length === 0 ? {} : $.extend({}, args[0]);
3732
+ opts.element = $(this);
3733
+
3734
+ if (opts.element.get(0).tagName.toLowerCase() === "select") {
3735
+ multiple = opts.element.prop("multiple");
3736
+ } else {
3737
+ multiple = opts.multiple || false;
3738
+ if ("tags" in opts) {opts.multiple = multiple = true;}
3739
+ }
3740
+
3741
+ select2 = multiple ? new window.Select2["class"].multi() : new window.Select2["class"].single();
3742
+ select2.init(opts);
3743
+ } else if (typeof(args[0]) === "string") {
3744
+
3745
+ if (indexOf(args[0], allowedMethods) < 0) {
3746
+ throw "Unknown method: " + args[0];
3747
+ }
3748
+
3749
+ value = undefined;
3750
+ select2 = $(this).data("select2");
3751
+ if (select2 === undefined) return;
3752
+
3753
+ method=args[0];
3754
+
3755
+ if (method === "container") {
3756
+ value = select2.container;
3757
+ } else if (method === "dropdown") {
3758
+ value = select2.dropdown;
3759
+ } else {
3760
+ if (methodsMap[method]) method = methodsMap[method];
3761
+
3762
+ value = select2[method].apply(select2, args.slice(1));
3763
+ }
3764
+ if (indexOf(args[0], valueMethods) >= 0
3765
+ || (indexOf(args[0], propertyMethods) >= 0 && args.length == 1)) {
3766
+ return false; // abort the iteration, ready to return first matched value
3767
+ }
3768
+ } else {
3769
+ throw "Invalid arguments to select2 plugin: " + args;
3770
+ }
3771
+ });
3772
+ return (value === undefined) ? this : value;
3773
+ };
3774
+
3775
+ // plugin defaults, accessible to users
3776
+ $.fn.select2.defaults = {
3777
+ width: "copy",
3778
+ loadMorePadding: 0,
3779
+ closeOnSelect: true,
3780
+ openOnEnter: true,
3781
+ containerCss: {},
3782
+ dropdownCss: {},
3783
+ containerCssClass: "",
3784
+ dropdownCssClass: "",
3785
+ formatResult: function(result, container, query, escapeMarkup) {
3786
+ var markup=[];
3787
+ markMatch(result.text, query.term, markup, escapeMarkup);
3788
+ return markup.join("");
3789
+ },
3790
+ formatSelection: function (data, container, escapeMarkup) {
3791
+ return data ? escapeMarkup(data.text) : undefined;
3792
+ },
3793
+ sortResults: function (results, container, query) {
3794
+ return results;
3795
+ },
3796
+ formatResultCssClass: function(data) {return data.css;},
3797
+ formatSelectionCssClass: function(data, container) {return undefined;},
3798
+ formatMatches: function (matches) { return matches + " results are available, use up and down arrow keys to navigate."; },
3799
+ formatNoMatches: function () { return "No matches found"; },
3800
+ formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1? "" : "s"); },
3801
+ formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1? "" : "s"); },
3802
+ formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); },
3803
+ formatLoadMore: function (pageNumber) { return "Loading more results…"; },
3804
+ formatSearching: function () { return "Searching…"; },
3805
+ minimumResultsForSearch: 0,
3806
+ minimumInputLength: 0,
3807
+ maximumInputLength: null,
3808
+ maximumSelectionSize: 0,
3809
+ id: function (e) { return e == undefined ? null : e.id; },
3810
+ matcher: function(term, text) {
3811
+ return stripDiacritics(''+text).toUpperCase().indexOf(stripDiacritics(''+term).toUpperCase()) >= 0;
3812
+ },
3813
+ separator: ",",
3814
+ tokenSeparators: [],
3815
+ tokenizer: defaultTokenizer,
3816
+ escapeMarkup: defaultEscapeMarkup,
3817
+ blurOnChange: false,
3818
+ selectOnBlur: false,
3819
+ adaptContainerCssClass: function(c) { return c; },
3820
+ adaptDropdownCssClass: function(c) { return null; },
3821
+ nextSearchTerm: function(selectedObject, currentSearchTerm) { return undefined; },
3822
+ searchInputPlaceholder: '',
3823
+ createSearchChoicePosition: 'top',
3824
+ shouldFocusInput: function (instance) {
3825
+ // Attempt to detect touch devices
3826
+ var supportsTouchEvents = (('ontouchstart' in window) ||
3827
+ (navigator.msMaxTouchPoints > 0));
3828
+
3829
+ // Only devices which support touch events should be special cased
3830
+ if (!supportsTouchEvents) {
3831
+ return true;
3832
+ }
3833
+
3834
+ // Never focus the input if search is disabled
3835
+ if (instance.opts.minimumResultsForSearch < 0) {
3836
+ return false;
3837
+ }
3838
+
3839
+ return true;
3840
+ }
3841
+ };
3842
+
3843
+ $.fn.select2.ajaxDefaults = {
3844
+ transport: $.ajax,
3845
+ params: {
3846
+ type: "GET",
3847
+ cache: false,
3848
+ dataType: "json"
3849
+ }
3850
+ };
3851
+
3852
+ // exports
3853
+ window.Select2 = {
3854
+ query: {
3855
+ ajax: ajax,
3856
+ local: local,
3857
+ tags: tags
3858
+ }, util: {
3859
+ debounce: debounce,
3860
+ markMatch: markMatch,
3861
+ escapeMarkup: defaultEscapeMarkup,
3862
+ stripDiacritics: stripDiacritics
3863
+ }, "class": {
3864
+ "abstract": AbstractSelect2,
3865
+ "single": SingleSelect2,
3866
+ "multi": MultiSelect2
3867
+ }
3868
+ };
3869
+
3870
+ }(jQuery));
3871
+
3872
+ jQuery(document).ready( function ( $ ) {
3873
+ $('#filter_action, #filter_content').change(function() {
3874
+ $('#leadin-contacts-filter-button').addClass('button-primary');
3875
+ });
3876
  });
assets/js/build/leadin-admin.min.js CHANGED
@@ -1 +1,7 @@
1
- !function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("<img />").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document),jQuery(document).ready(function(a){a(".show_all_faces").on("click",function(){var b=a(this);b.closest("td").find(".hidden_face").removeClass("hidden_face"),b.remove(),a("html,body").trigger("scroll")}),a("img.lazy").lazyload({effect:"fadeIn"})}),jQuery(document).ready(function(a){a("#leadin-contacts input:checkbox").not("thead input:checkbox, tfoot input:checkbox").bind("change",function(){var b=0,c="",d=a("#leadin-export-selected-leads"),e=a("#leadin-selected-contacts"),f=a("#leadin-contacts input:checkbox:checked").not("thead input:checkbox, tfoot input:checkbox");f.length>0?d.attr("disabled",!1):d.attr("disabled",!0),f.each(function(){c+=a(this).val(),b!=f.length-1&&(c+=","),b++}),e.val(c)}),a("#cb-select-all-1, #cb-select-all-2").bind("change",function(){var b=0,c="",d=a(this),e=a("#leadin-export-selected-leads"),f=a("#leadin-contacts input:checkbox").not("thead input:checkbox, tfoot input:checkbox"),g=a("#leadin-selected-contacts");f.each(function(){c+=a(this).val(),b!=f.length-1&&(c+=","),b++}),g.val(c),d.is(":checked")?e.attr("disabled",!1):e.attr("disabled",!0)}),a(".postbox .handlediv").bind("click",function(){var b=a(this).parent();b.hasClass("closed")?b.removeClass("closed"):b.addClass("closed")})});
 
 
 
 
 
 
1
+ !function(){function q(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function w(){var a,c,b=arguments,d={},e=function(a,b){var c,d;"object"!=typeof a&&(a={});for(d in b)b.hasOwnProperty(d)&&(c=b[d],a[d]=c&&"object"==typeof c&&"[object Array]"!==Object.prototype.toString.call(c)&&"renderTo"!==d&&"number"!=typeof c.nodeType?e(a[d]||{},c):b[d]);return a};for(b[0]===!0&&(d=b[1],b=Array.prototype.slice.call(b,2)),c=b.length,a=0;c>a;a++)d=e(d,b[a]);return d}function z(a,b){return parseInt(a,b||10)}function Fa(a){return"string"==typeof a}function ca(a){return"object"==typeof a}function La(a){return"[object Array]"===Object.prototype.toString.call(a)}function ha(a){return"number"==typeof a}function za(a){return U.log(a)/U.LN10}function ia(a){return U.pow(10,a)}function ja(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function r(a){return a!==t&&null!==a}function H(a,b,c){var d,e;if(Fa(b))r(c)?a.setAttribute(b,c):a&&a.getAttribute&&(e=a.getAttribute(b));else if(r(b)&&ca(b))for(d in b)a.setAttribute(d,b[d]);return e}function qa(a){return La(a)?a:[a]}function m(){var b,c,a=arguments,d=a.length;for(b=0;d>b;b++)if(c=a[b],"undefined"!=typeof c&&null!==c)return c}function G(a,b){Aa&&!aa&&b&&b.opacity!==t&&(b.filter="alpha(opacity="+100*b.opacity+")"),q(a.style,b)}function Y(a,b,c,d,e){return a=y.createElement(a),b&&q(a,b),e&&G(a,{padding:0,border:Q,margin:0}),c&&G(a,c),d&&d.appendChild(a),a}function ka(a,b){var c=function(){};return c.prototype=new a,q(c.prototype,b),c}function Ga(a,b,c,d){var e=E.lang,a=+a||0,f=-1===b?(a.toString().split(".")[1]||"").length:isNaN(b=M(b))?2:b,b=void 0===c?e.decimalPoint:c,d=void 0===d?e.thousandsSep:d,e=0>a?"-":"",c=String(z(a=M(a).toFixed(f))),g=c.length>3?c.length%3:0;return e+(g?c.substr(0,g)+d:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?b+M(a-c).toFixed(f).slice(2):"")}function Ha(a,b){return Array((b||2)+1-String(a).length).join(0)+a}function Ma(a,b,c){var d=a[b];a[b]=function(){var a=Array.prototype.slice.call(arguments);return a.unshift(d),c.apply(this,a)}}function Ia(a,b){for(var e,f,g,h,i,c="{",d=!1,j=[];-1!==(c=a.indexOf(c));){if(e=a.slice(0,c),d){for(f=e.split(":"),g=f.shift().split("."),i=g.length,e=b,h=0;i>h;h++)e=e[g[h]];f.length&&(f=f.join(":"),g=/\.([0-9])/,h=E.lang,i=void 0,/f$/.test(f)?(i=(i=f.match(g))?i[1]:-1,null!==e&&(e=Ga(e,i,h.decimalPoint,f.indexOf(",")>-1?h.thousandsSep:""))):e=cb(f,e))}j.push(e),a=a.slice(c+1),c=(d=!d)?"}":"{"}return j.push(a),j.join("")}function mb(a){return U.pow(10,T(U.log(a)/U.LN10))}function nb(a,b,c,d){var e,c=m(c,1);for(e=a/c,b||(b=[1,2,2.5,5,10],d&&d.allowDecimals===!1&&(1===c?b=[1,2,5,10]:.1>=c&&(b=[1/c]))),d=0;d<b.length&&(a=b[d],!(e<=(b[d]+(b[d+1]||b[d]))/2));d++);return a*=c}function Bb(){this.symbol=this.color=0}function ob(a,b){var d,e,c=a.length;for(e=0;c>e;e++)a[e].ss_i=e;for(a.sort(function(a,c){return d=b(a,c),0===d?a.ss_i-c.ss_i:d}),e=0;c>e;e++)delete a[e].ss_i}function Na(a){for(var b=a.length,c=a[0];b--;)a[b]<c&&(c=a[b]);return c}function Ba(a){for(var b=a.length,c=a[0];b--;)a[b]>c&&(c=a[b]);return c}function Oa(a,b){for(var c in a)a[c]&&a[c]!==b&&a[c].destroy&&a[c].destroy(),delete a[c]}function Pa(a){db||(db=Y(Ja)),a&&db.appendChild(a),db.innerHTML=""}function ra(a,b){var c="Highcharts error #"+a+": www.highcharts.com/errors/"+a;if(b)throw c;I.console&&console.log(c)}function da(a){return parseFloat(a.toPrecision(14))}function Qa(a,b){va=m(a,b.animation)}function Cb(){var a=E.global.useUTC,b=a?"getUTC":"get",c=a?"setUTC":"set";Ra=6e4*(a&&E.global.timezoneOffset||0),eb=a?Date.UTC:function(a,b,c,g,h,i){return new Date(a,b,m(c,1),m(g,0),m(h,0),m(i,0)).getTime()},pb=b+"Minutes",qb=b+"Hours",rb=b+"Day",Xa=b+"Date",fb=b+"Month",gb=b+"FullYear",Db=c+"Minutes",Eb=c+"Hours",sb=c+"Date",Fb=c+"Month",Gb=c+"FullYear"}function P(){}function Sa(a,b,c,d){this.axis=a,this.pos=b,this.type=c||"",this.isNew=!0,!c&&!d&&this.addLabel()}function la(){this.init.apply(this,arguments)}function Ya(){this.init.apply(this,arguments)}function Hb(a,b,c,d,e){var f=a.chart.inverted;this.axis=a,this.isNegative=c,this.options=b,this.x=d,this.total=null,this.points={},this.stack=e,this.alignOptions={align:b.align||(f?c?"left":"right":"center"),verticalAlign:b.verticalAlign||(f?"middle":c?"bottom":"top"),y:m(b.y,f?4:c?14:-6),x:m(b.x,f?c?-6:6:0)},this.textAlign=b.textAlign||(f?c?"right":"left":"center")}var t,Za,$a,db,E,cb,va,ub,A,eb,Ra,pb,qb,rb,Xa,fb,gb,Db,Eb,sb,Fb,Gb,y=document,I=window,U=Math,u=U.round,T=U.floor,Ka=U.ceil,v=U.max,C=U.min,M=U.abs,Z=U.cos,ea=U.sin,ma=U.PI,Ca=2*ma/360,wa=navigator.userAgent,Ib=I.opera,Aa=/msie/i.test(wa)&&!Ib,hb=8===y.documentMode,ib=/AppleWebKit/.test(wa),Ta=/Firefox/.test(wa),Jb=/(Mobile|Android|Windows Phone)/.test(wa),xa="http://www.w3.org/2000/svg",aa=!!y.createElementNS&&!!y.createElementNS(xa,"svg").createSVGRect,Nb=Ta&&parseInt(wa.split("Firefox/")[1],10)<4,fa=!aa&&!Aa&&!!y.createElement("canvas").getContext,Kb={},tb=0,sa=function(){},V=[],ab=0,Ja="div",Q="none",Ob=/^[0-9]+$/,Pb="stroke-width",F={},R=I.Highcharts=I.Highcharts?ra(16,!0):{};cb=function(a,b,c){if(!r(b)||isNaN(b))return"Invalid date";var e,a=m(a,"%Y-%m-%d %H:%M:%S"),d=new Date(b-Ra),f=d[qb](),g=d[rb](),h=d[Xa](),i=d[fb](),j=d[gb](),k=E.lang,l=k.weekdays,d=q({a:l[g].substr(0,3),A:l[g],d:Ha(h),e:h,b:k.shortMonths[i],B:k.months[i],m:Ha(i+1),y:j.toString().substr(2,2),Y:j,H:Ha(f),I:Ha(f%12||12),l:f%12||12,M:Ha(d[pb]()),p:12>f?"AM":"PM",P:12>f?"am":"pm",S:Ha(d.getSeconds()),L:Ha(u(b%1e3),3)},R.dateFormats);for(e in d)for(;-1!==a.indexOf("%"+e);)a=a.replace("%"+e,"function"==typeof d[e]?d[e](b):d[e]);return c?a.substr(0,1).toUpperCase()+a.substr(1):a},Bb.prototype={wrapColor:function(a){this.color>=a&&(this.color=0)},wrapSymbol:function(a){this.symbol>=a&&(this.symbol=0)}},A=function(){for(var a=0,b=arguments,c=b.length,d={};c>a;a++)d[b[a++]]=b[a];return d}("millisecond",1,"second",1e3,"minute",6e4,"hour",36e5,"day",864e5,"week",6048e5,"month",26784e5,"year",31556952e3),ub={init:function(a,b,c){var g,h,i,b=b||"",d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,b=b.split(" "),c=[].concat(c),j=function(a){for(g=a.length;g--;)"M"===a[g]&&a.splice(g+1,0,a[g+1],a[g+2],a[g+1],a[g+2])};if(e&&(j(b),j(c)),a.isArea&&(h=b.splice(b.length-6,6),i=c.splice(c.length-6,6)),d<=c.length/f&&b.length===c.length)for(;d--;)c=[].concat(c).splice(0,f).concat(c);if(a.shift=0,b.length)for(a=c.length;b.length<a;)d=[].concat(b).splice(b.length-f,f),e&&(d[f-6]=d[f-2],d[f-5]=d[f-1]),b=b.concat(d);return h&&(b=b.concat(h),c=c.concat(i)),[b,c]},step:function(a,b,c,d){var e=[],f=a.length;if(1===c)e=d;else if(f===b.length&&1>c)for(;f--;)d=parseFloat(a[f]),e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d;else e=b;return e}},function(a){I.HighchartsAdapter=I.HighchartsAdapter||a&&{init:function(b){var e,c=a.fx,d=c.step,f=a.Tween,g=f&&f.propHooks;e=a.cssHooks.opacity,a.extend(a.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}}),a.each(["cur","_default","width","height","opacity"],function(a,b){var k,e=d;"cur"===b?e=c.prototype:"_default"===b&&f&&(e=g[b],b="set"),(k=e[b])&&(e[b]=function(c){var d,c=a?c:this;return"align"!==c.prop?(d=c.elem,d.attr?d.attr(c.prop,"cur"===b?t:c.now):k.apply(this,arguments)):void 0})}),Ma(e,"get",function(a,b,c){return b.attr?b.opacity||0:a.call(this,b,c)}),e=function(a){var d,c=a.elem;a.started||(d=b.init(c,c.d,c.toD),a.start=d[0],a.end=d[1],a.started=!0),c.attr("d",b.step(a.start,a.end,a.pos,c.toD))},f?g.d={set:e}:d.d=e,this.each=Array.prototype.forEach?function(a,b){return Array.prototype.forEach.call(a,b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(b.call(a[c],a[c],c,a)===!1)return c},a.fn.highcharts=function(){var c,d,a="Chart",b=arguments;return this[0]&&(Fa(b[0])&&(a=b[0],b=Array.prototype.slice.call(b,1)),c=b[0],c!==t&&(c.chart=c.chart||{},c.chart.renderTo=this[0],new R[a](c,b[1]),d=this),c===t&&(d=V[H(this[0],"data-highcharts-chart")])),d}},getScript:a.getScript,inArray:a.inArray,adapterRun:function(b,c){return a(b)[c]()},grep:a.grep,map:function(a,c){for(var d=[],e=0,f=a.length;f>e;e++)d[e]=c.call(a[e],a[e],e,a);return d},offset:function(b){return a(b).offset()},addEvent:function(b,c,d){a(b).bind(c,d)},removeEvent:function(b,c,d){var e=y.removeEventListener?"removeEventListener":"detachEvent";y[e]&&b&&!b[e]&&(b[e]=function(){}),a(b).unbind(c,d)},fireEvent:function(b,c,d,e){var h,f=a.Event(c),g="detached"+c;!Aa&&d&&(delete d.layerX,delete d.layerY,delete d.returnValue),q(f,d),b[c]&&(b[g]=b[c],b[c]=null),a.each(["preventDefault","stopPropagation"],function(a,b){var c=f[b];f[b]=function(){try{c.call(f)}catch(a){"preventDefault"===b&&(h=!0)}}}),a(b).trigger(f),b[g]&&(b[c]=b[g],b[g]=null),e&&!f.isDefaultPrevented()&&!h&&e(f)},washMouseEvent:function(a){var c=a.originalEvent||a;return c.pageX===t&&(c.pageX=a.pageX,c.pageY=a.pageY),c},animate:function(b,c,d){var e=a(b);b.style||(b.style={}),c.d&&(b.toD=c.d,c.d=1),e.stop(),c.opacity!==t&&b.attr&&(c.opacity+="px"),e.animate(c,d)},stop:function(b){a(b).stop()}}}(I.jQuery);var S=I.HighchartsAdapter,N=S||{};S&&S.init.call(S,ub);var jb=N.adapterRun,Qb=N.getScript,Da=N.inArray,p=N.each,vb=N.grep,Rb=N.offset,Ua=N.map,K=N.addEvent,W=N.removeEvent,D=N.fireEvent,Sb=N.washMouseEvent,kb=N.animate,bb=N.stop,N={enabled:!0,x:0,y:15,style:{color:"#606060",cursor:"default",fontSize:"11px"}};E={colors:"#7cb5ec,#434348,#90ed7d,#f7a35c,#8085e9,#f15c80,#e4d354,#8085e8,#8d4653,#91e8e1".split(","),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),shortMonths:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),decimalPoint:".",numericSymbols:"k,M,G,T,P,E".split(","),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:!0,canvasToolsURL:"http://code.highcharts.com/4.0.1/modules/canvas-tools.js",VMLRadialGradientURL:"http://code.highcharts.com/4.0.1/gfx/vml-radial-gradient.png"},chart:{borderColor:"#4572A7",borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0",resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}}},title:{text:"Chart title",align:"center",margin:15,style:{color:"#333333",fontSize:"18px"}},subtitle:{text:"",align:"center",style:{color:"#555555"}},plotOptions:{line:{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1e3},events:{},lineWidth:2,marker:{lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{enabled:!0},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:w(N,{align:"center",enabled:!1,formatter:function(){return null===this.y?"":Ga(this.y,-1)},verticalAlign:"bottom",y:0}),cropThreshold:300,pointRange:0,states:{hover:{marker:{},halo:{size:10,opacity:.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1e3}},labels:{style:{position:"absolute",color:"#3E576F"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#909090",borderRadius:0,navigation:{activeColor:"#274b6d",inactiveColor:"#CCC"},shadow:!1,itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},itemHoverStyle:{color:"#000"},itemHiddenStyle:{color:"#CCC"},itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"1em"},style:{position:"absolute",backgroundColor:"white",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:aa,backgroundColor:"rgba(249, 249, 249, .85)",borderWidth:1,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{series.color}">●</span> {series.name}: <b>{point.y}</b><br/>',shadow:!0,snap:Jb?25:10,style:{color:"#333333",cursor:"default",fontSize:"12px",padding:"8px",whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"9px"}}};var ba=E.plotOptions,S=ba.line;Cb();var Tb=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,Ub=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,Vb=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,ya=function(a){var c,d,b=[];return function(a){a&&a.stops?d=Ua(a.stops,function(a){return ya(a[1])}):(c=Tb.exec(a))?b=[z(c[1]),z(c[2]),z(c[3]),parseFloat(c[4],10)]:(c=Ub.exec(a))?b=[z(c[1],16),z(c[2],16),z(c[3],16),1]:(c=Vb.exec(a))&&(b=[z(c[1]),z(c[2]),z(c[3]),1])}(a),{get:function(c){var f;return d?(f=w(a),f.stops=[].concat(f.stops),p(d,function(a,b){f.stops[b]=[f.stops[b][0],a.get(c)]})):f=b&&!isNaN(b[0])?"rgb"===c?"rgb("+b[0]+","+b[1]+","+b[2]+")":"a"===c?b[3]:"rgba("+b.join(",")+")":a,f},brighten:function(a){if(d)p(d,function(b){b.brighten(a)});else if(ha(a)&&0!==a){var c;for(c=0;3>c;c++)b[c]+=z(255*a),b[c]<0&&(b[c]=0),b[c]>255&&(b[c]=255)}return this},rgba:b,setOpacity:function(a){return b[3]=a,this}}};P.prototype={init:function(a,b){this.element="span"===b?Y(b):y.createElementNS(xa,b),this.renderer=a},opacity:1,animate:function(a,b,c){b=m(b,va,!0),bb(this),b?(b=w(b,{}),c&&(b.complete=c),kb(this,a,b)):(this.attr(a),c&&c())},colorGradient:function(a,b,c){var e,f,g,h,i,j,k,l,o,n,d=this.renderer,s=[];if(a.linearGradient?f="linearGradient":a.radialGradient&&(f="radialGradient"),f){g=a[f],h=d.gradients,j=a.stops,o=c.radialReference,La(g)&&(a[f]=g={x1:g[0],y1:g[1],x2:g[2],y2:g[3],gradientUnits:"userSpaceOnUse"}),"radialGradient"===f&&o&&!r(g.gradientUnits)&&(g=w(g,{cx:o[0]-o[2]/2+g.cx*o[2],cy:o[1]-o[2]/2+g.cy*o[2],r:g.r*o[2],gradientUnits:"userSpaceOnUse"}));for(n in g)"id"!==n&&s.push(n,g[n]);for(n in j)s.push(j[n]);s=s.join(","),h[s]?a=h[s].attr("id"):(g.id=a="highcharts-"+tb++,h[s]=i=d.createElement(f).attr(g).add(d.defs),i.stops=[],p(j,function(a){0===a[1].indexOf("rgba")?(e=ya(a[1]),k=e.get("rgb"),l=e.get("a")):(k=a[1],l=1),a=d.createElement("stop").attr({offset:a[0],"stop-color":k,"stop-opacity":l}).add(i),i.stops.push(a)})),c.setAttribute(b,"url("+d.url+"#"+a+")")}},attr:function(a,b){var c,d,f,h,e=this.element,g=this;if("string"==typeof a&&b!==t&&(c=a,a={},a[c]=b),"string"==typeof a)g=(this[a+"Getter"]||this._defaultGetter).call(this,a,e);else{for(c in a)d=a[c],h=!1,this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(c)&&(f||(this.symbolAttr(a),f=!0),h=!0),!this.rotation||"x"!==c&&"y"!==c||(this.doTransform=!0),h||(this[c+"Setter"]||this._defaultSetter).call(this,d,c,e),this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(c)&&this.updateShadows(c,d);this.doTransform&&(this.updateTransform(),this.doTransform=!1)}return g},updateShadows:function(a,b){for(var c=this.shadows,d=c.length;d--;)c[d].setAttribute(a,"height"===a?v(b-(c[d].cutHeight||0),0):"d"===a?this.d:b)},addClass:function(a){var b=this.element,c=H(b,"class")||"";return-1===c.indexOf(a)&&H(b,"class",c+" "+a),this},symbolAttr:function(a){var b=this;p("x,y,r,start,end,width,height,innerR,anchorX,anchorY".split(","),function(c){b[c]=m(a[c],b[c])}),b.attr({d:b.renderer.symbols[b.symbolName](b.x,b.y,b.width,b.height,b)})},clip:function(a){return this.attr("clip-path",a?"url("+this.renderer.url+"#"+a.id+")":Q)},crisp:function(a){var b,d,c={},e=a.strokeWidth||this.strokeWidth||this.attr&&this.attr("stroke-width")||0;d=u(e)%2/2,a.x=T(a.x||this.x||0)+d,a.y=T(a.y||this.y||0)+d,a.width=T((a.width||this.width||0)-2*d),a.height=T((a.height||this.height||0)-2*d),a.strokeWidth=e;for(b in a)this[b]!==a[b]&&(this[b]=c[b]=a[b]);return c},css:function(a){var e,f,b=this.styles,c={},d=this.element,g="";if(e=!b,a&&a.color&&(a.fill=a.color),b)for(f in a)a[f]!==b[f]&&(c[f]=a[f],e=!0);if(e){if(e=this.textWidth=a&&a.width&&"text"===d.nodeName.toLowerCase()&&z(a.width),b&&(a=q(b,c)),this.styles=a,e&&(fa||!aa&&this.renderer.forExport)&&delete a.width,Aa&&!aa)G(this.element,a);else{b=function(a,b){return"-"+b.toLowerCase()};for(f in a)g+=f.replace(/([A-Z])/g,b)+":"+a[f]+";";H(d,"style",g)}e&&this.added&&this.renderer.buildText(this)}return this},on:function(a,b){var c=this,d=c.element;return $a&&"click"===a?(d.ontouchstart=function(a){c.touchEventFired=Date.now(),a.preventDefault(),b.call(d,a)},d.onclick=function(a){(-1===wa.indexOf("Android")||Date.now()-(c.touchEventFired||0)>1100)&&b.call(d,a)}):d["on"+a]=b,this},setRadialReference:function(a){return this.element.radialReference=a,this},translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(){return this.inverted=!0,this.updateTransform(),this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.scaleX,d=this.scaleY,e=this.inverted,f=this.rotation,g=this.element;e&&(a+=this.attr("width"),b+=this.attr("height")),a=["translate("+a+","+b+")"],e?a.push("rotate(90) scale(-1,1)"):f&&a.push("rotate("+f+" "+(g.getAttribute("x")||0)+" "+(g.getAttribute("y")||0)+")"),(r(c)||r(d))&&a.push("scale("+m(c,1)+" "+m(d,1)+")"),a.length&&g.setAttribute("transform",a.join(" "))},toFront:function(){var a=this.element;return a.parentNode.appendChild(a),this},align:function(a,b,c){var d,e,f,g,h={};return e=this.renderer,f=e.alignedObjects,a?(this.alignOptions=a,this.alignByTranslate=b,(!c||Fa(c))&&(this.alignTo=d=c||"renderer",ja(f,this),f.push(this),c=null)):(a=this.alignOptions,b=this.alignByTranslate,d=this.alignTo),c=m(c,e[d],e),d=a.align,e=a.verticalAlign,f=(c.x||0)+(a.x||0),g=(c.y||0)+(a.y||0),("right"===d||"center"===d)&&(f+=(c.width-(a.width||0))/{right:1,center:2}[d]),h[b?"translateX":"x"]=u(f),("bottom"===e||"middle"===e)&&(g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||1)),h[b?"translateY":"y"]=u(g),this[this.placed?"animate":"attr"](h),this.placed=!0,this.alignAttr=h,this},getBBox:function(){var c,d,a=this.bBox,b=this.renderer,e=this.rotation;c=this.element;var f=this.styles,g=e*Ca;d=this.textStr;var h;if((""===d||Ob.test(d))&&(h="num."+d.toString().length+(f?"|"+f.fontSize+"|"+f.fontFamily:"")),h&&(a=b.cache[h]),!a){if(c.namespaceURI===xa||b.forExport){try{a=c.getBBox?q({},c.getBBox()):{width:c.offsetWidth,height:c.offsetHeight}}catch(i){}(!a||a.width<0)&&(a={width:0,height:0})}else a=this.htmlGetBBox();b.isSVG&&(c=a.width,d=a.height,Aa&&f&&"11px"===f.fontSize&&"16.9"===d.toPrecision(3)&&(a.height=d=14),e&&(a.width=M(d*ea(g))+M(c*Z(g)),a.height=M(d*Z(g))+M(c*ea(g)))),this.bBox=a,h&&(b.cache[h]=a)}return a},show:function(a){return a&&this.element.namespaceURI===xa?(this.element.removeAttribute("visibility"),this):this.attr({visibility:a?"inherit":"visible"})},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var b=this;b.animate({opacity:0},{duration:a||150,complete:function(){b.hide()}})},add:function(a){var g,h,b=this.renderer,c=a||b,d=c.element||b.box,e=this.element,f=this.zIndex;if(a&&(this.parentGroup=a),this.parentInverted=a&&a.inverted,void 0!==this.textStr&&b.buildText(this),f&&(c.handleZ=!0,f=z(f)),c.handleZ)for(a=d.childNodes,g=0;g<a.length;g++)if(b=a[g],c=H(b,"zIndex"),b!==e&&(z(c)>f||!r(f)&&r(c))){d.insertBefore(e,b),h=!0;break}return h||d.appendChild(e),this.added=!0,this.onAdd&&this.onAdd(),this},safeRemoveChild:function(a){var b=a.parentNode;b&&b.removeChild(a)},destroy:function(){var e,f,a=this,b=a.element||{},c=a.shadows,d=a.renderer.isSVG&&"SPAN"===b.nodeName&&a.parentGroup;if(b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=b.point=null,bb(a),a.clipPath&&(a.clipPath=a.clipPath.destroy()),a.stops){for(f=0;f<a.stops.length;f++)a.stops[f]=a.stops[f].destroy();a.stops=null}for(a.safeRemoveChild(b),c&&p(c,function(b){a.safeRemoveChild(b)});d&&0===d.div.childNodes.length;)b=d.parentGroup,a.safeRemoveChild(d.div),delete d.div,d=b;a.alignTo&&ja(a.renderer.alignedObjects,a);for(e in a)delete a[e];return null},shadow:function(a,b,c){var e,f,h,i,j,k,d=[],g=this.element;if(a){for(i=m(a.width,3),j=(a.opacity||.15)/i,k=this.parentInverted?"(-1,-1)":"("+m(a.offsetX,1)+", "+m(a.offsetY,1)+")",e=1;i>=e;e++)f=g.cloneNode(0),h=2*i+1-2*e,H(f,{isShadow:"true",stroke:a.color||"black","stroke-opacity":j*e,"stroke-width":h,transform:"translate"+k,fill:Q}),c&&(H(f,"height",v(H(f,"height")-h,0)),f.cutHeight=h),b?b.element.appendChild(f):g.parentNode.insertBefore(f,g),d.push(f);this.shadows=d}return this},xGetter:function(a){return"circle"===this.element.nodeName&&(a={x:"cx",y:"cy"}[a]||a),this._defaultGetter(a)},_defaultGetter:function(a){return a=m(this[a],this.element?this.element.getAttribute(a):null,0),/^[0-9\.]+$/.test(a)&&(a=parseFloat(a)),a},dSetter:function(a,b,c){a&&a.join&&(a=a.join(" ")),/(NaN| {2}|^$)/.test(a)&&(a="M 0 0"),c.setAttribute(b,a),this[b]=a},dashstyleSetter:function(a){var b;if(a=a&&a.toLowerCase()){for(a=a.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(","),b=a.length;b--;)a[b]=z(a[b])*this.element.getAttribute("stroke-width");a=a.join(","),this.element.setAttribute("stroke-dasharray",a)}},alignSetter:function(a){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[a])},opacitySetter:function(a,b,c){this[b]=a,c.setAttribute(b,a)},"stroke-widthSetter":function(a,b,c){0===a&&(a=1e-5),this.strokeWidth=a,c.setAttribute(b,a)},titleSetter:function(a){var b=this.element.getElementsByTagName("title")[0];b||(b=y.createElementNS(xa,"title"),this.element.appendChild(b)),b.textContent=a},textSetter:function(a){a!==this.textStr&&(delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this))},fillSetter:function(a,b,c){"string"==typeof a?c.setAttribute(b,a):a&&this.colorGradient(a,b,c)},zIndexSetter:function(a,b,c){c.setAttribute(b,a),this[b]=a},_defaultSetter:function(a,b,c){c.setAttribute(b,a)}},P.prototype.yGetter=P.prototype.xGetter,P.prototype.translateXSetter=P.prototype.translateYSetter=P.prototype.rotationSetter=P.prototype.verticalAlignSetter=P.prototype.scaleXSetter=P.prototype.scaleYSetter=function(a,b){this[b]=a,this.doTransform=!0},P.prototype.strokeSetter=P.prototype.fillSetter;var ta=function(){this.init.apply(this,arguments)};ta.prototype={Element:P,init:function(a,b,c,d,e){var g,f=location,d=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(d));g=d.element,a.appendChild(g),-1===a.innerHTML.indexOf("xmlns")&&H(g,"xmlns",xa),this.isSVG=!0,this.box=g,this.boxWrapper=d,this.alignedObjects=[],this.url=(Ta||ib)&&y.getElementsByTagName("base").length?f.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"",this.createElement("desc").add().element.appendChild(y.createTextNode("Created with Highcharts 4.0.1")),this.defs=this.createElement("defs").add(),this.forExport=e,this.gradients={},this.cache={},this.setSize(b,c,!1);var h;Ta&&a.getBoundingClientRect&&(this.subPixelFix=b=function(){G(a,{left:0,top:0}),h=a.getBoundingClientRect(),G(a,{left:Ka(h.left)-h.left+"px",top:Ka(h.top)-h.top+"px"})},b(),K(I,"resize",b))},getStyle:function(a){return this.style=q({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},a)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),Oa(this.gradients||{}),this.gradients=null,a&&(this.defs=a.destroy()),this.subPixelFix&&W(I,"resize",this.subPixelFix),this.alignedObjects=null},createElement:function(a){var b=new this.Element;return b.init(this,a),b},draw:function(){},buildText:function(a){for(var h,i,b=a.element,c=this,d=c.forExport,e=m(a.textStr,"").toString(),f=-1!==e.indexOf("<"),g=b.childNodes,j=H(b,"x"),k=a.styles,l=a.textWidth,o=k&&k.lineHeight,n=g.length,s=function(a){return o?z(o):c.fontMetrics(/(px|em)$/.test(a&&a.style.fontSize)?a.style.fontSize:k&&k.fontSize||c.style.fontSize||12).h};n--;)b.removeChild(g[n]);f||-1!==e.indexOf(" ")?(h=/<.*style="([^"]+)".*>/,i=/<.*href="(http[^"]+)".*>/,l&&!a.added&&this.box.appendChild(b),e=f?e.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g):[e],""===e[e.length-1]&&e.pop(),p(e,function(e,f){var g,n=0,e=e.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");g=e.split("|||"),p(g,function(e){if(""!==e||1===g.length){var p,o={},m=y.createElementNS(xa,"tspan");if(h.test(e)&&(p=e.match(h)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),H(m,"style",p)),i.test(e)&&!d&&(H(m,"onclick",'location.href="'+e.match(i)[1]+'"'),G(m,{cursor:"pointer"})),e=(e.replace(/<(.|\n)*?>/g,"")||" ").replace(/&lt;/g,"<").replace(/&gt;/g,">")," "!==e&&(m.appendChild(y.createTextNode(e)),n?o.dx=0:f&&null!==j&&(o.x=j),H(m,o),!n&&f&&(!aa&&d&&G(m,{display:"block"}),H(m,"dy",s(m),ib&&m.offsetHeight)),b.appendChild(m),n++,l))for(var $,r,e=e.replace(/([^\^])-/g,"$1- ").split(" "),o=e.length>1&&"nowrap"!==k.whiteSpace,B=a._clipHeight,q=[],v=s(),t=1;o&&(e.length||q.length);)delete a.bBox,$=a.getBBox(),r=$.width,!aa&&c.forExport&&(r=c.measureSpanWidth(m.firstChild.data,a.styles)),$=r>l,$&&1!==e.length?(m.removeChild(m.firstChild),q.unshift(e.pop())):(e=q,q=[],e.length&&(t++,B&&t*v>B?(e=["..."],a.attr("title",a.textStr)):(m=y.createElementNS(xa,"tspan"),H(m,{dy:v,x:j}),p&&H(m,"style",p),b.appendChild(m),r>l&&(l=r)))),e.length&&m.appendChild(y.createTextNode(e.join(" ").replace(/- /g,"-")))}})})):b.appendChild(y.createTextNode(e))},button:function(a,b,c,d,e,f,g,h,i){var l,o,n,s,m,p,j=this.label(a,b,c,i,null,null,null,null,"button"),k=0,a={x1:0,y1:0,x2:0,y2:1},e=w({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:a,stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},r:2,padding:5,style:{color:"black"}},e);return n=e.style,delete e.style,f=w(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#FFF"],[1,"#ACF"]]}},f),s=f.style,delete f.style,g=w(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#9BD"],[1,"#CDF"]]}},g),m=g.style,delete g.style,h=w(e,{style:{color:"#CCC"}},h),p=h.style,delete h.style,K(j.element,Aa?"mouseover":"mouseenter",function(){3!==k&&j.attr(f).css(s)}),K(j.element,Aa?"mouseout":"mouseleave",function(){3!==k&&(l=[e,f,g][k],o=[n,s,m][k],j.attr(l).css(o))}),j.setState=function(a){(j.state=k=a)?2===a?j.attr(g).css(m):3===a&&j.attr(h).css(p):j.attr(e).css(n)},j.on("click",function(){3!==k&&d.call(j)}).attr(e).css(q({cursor:"default"},n))},crispLine:function(a,b){return a[1]===a[4]&&(a[1]=a[4]=u(a[1])-b%2/2),a[2]===a[5]&&(a[2]=a[5]=u(a[2])+b%2/2),a},path:function(a){var b={fill:Q};return La(a)?b.d=a:ca(a)&&q(b,a),this.createElement("path").attr(b)},circle:function(a,b,c){return a=ca(a)?a:{x:a,y:b,r:c},b=this.createElement("circle"),b.xSetter=function(a){this.element.setAttribute("cx",a)},b.ySetter=function(a){this.element.setAttribute("cy",a)},b.attr(a)},arc:function(a,b,c,d,e,f){return ca(a)&&(b=a.y,c=a.r,d=a.innerR,e=a.start,f=a.end,a=a.x),a=this.symbol("arc",a||0,b||0,c||0,c||0,{innerR:d||0,start:e||0,end:f||0}),a.r=c,a},rect:function(a,b,c,d,e,f){var e=ca(a)?a.r:e,g=this.createElement("rect"),a=ca(a)?a:a===t?{}:{x:a,y:b,width:v(c,0),height:v(d,0)};return f!==t&&(a.strokeWidth=f,a=g.crisp(a)),e&&(a.r=e),g.rSetter=function(a){H(this.element,{rx:a,ry:a})},g.attr(a)},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;for(this.width=a,this.height=b,this.boxWrapper[m(c,!0)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){var b=this.createElement("g");return r(a)?b.attr({"class":"highcharts-"+a}):b},image:function(a,b,c,d,e){var f={preserveAspectRatio:Q};return arguments.length>1&&q(f,{x:b,y:c,width:d,height:e}),f=this.createElement("image").attr(f),f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a),f},symbol:function(a,b,c,d,e,f){var g,j,k,h=this.symbols[a],h=h&&h(u(b),u(c),d,e,f),i=/^url\((.*?)\)$/;return h?(g=this.path(h),q(g,{symbolName:a,x:b,y:c,width:d,height:e}),f&&q(g,f)):i.test(a)&&(k=function(a,b){a.element&&(a.attr({width:b[0],height:b[1]}),a.alignByTranslate||a.translate(u((d-b[0])/2),u((e-b[1])/2)))},j=a.match(i)[1],a=Kb[j],g=this.image(j).attr({x:b,y:c}),g.isImg=!0,a?k(g,a):(g.attr({width:0,height:0}),Y("img",{onload:function(){k(g,Kb[j]=[this.width,this.height])},src:j}))),g},symbols:{circle:function(a,b,c,d){var e=.166*c;return["M",a+c/2,b,"C",a+c+e,b,a+c+e,b+d,a+c/2,b+d,"C",a-e,b+d,a-e,b,a+c/2,b,"Z"]},square:function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c,b+d,a,b+d,"Z"]},triangle:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d,a,b+d,"Z"]},"triangle-down":function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c/2,b+d,"Z"]},diamond:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d/2,a+c/2,b+d,a,b+d/2,"Z"]},arc:function(a,b,c,d,e){var f=e.start,c=e.r||c||d,g=e.end-.001,d=e.innerR,h=e.open,i=Z(f),j=ea(f),k=Z(g),g=ea(g),e=e.end-f<ma?0:1;return["M",a+c*i,b+c*j,"A",c,c,0,e,1,a+c*k,b+c*g,h?"M":"L",a+d*k,b+d*g,"A",d,d,0,e,0,a+d*i,b+d*j,h?"":"Z"]},callout:function(a,b,c,d,e){var f=C(e&&e.r||0,c,d),g=f+6,h=e&&e.anchorX,i=e&&e.anchorY,e=u(e.strokeWidth||0)%2/2;return a+=e,b+=e,e=["M",a+f,b,"L",a+c-f,b,"C",a+c,b,a+c,b,a+c,b+f,"L",a+c,b+d-f,"C",a+c,b+d,a+c,b+d,a+c-f,b+d,"L",a+f,b+d,"C",a,b+d,a,b+d,a,b+d-f,"L",a,b+f,"C",a,b,a,b,a+f,b],h&&h>c&&i>b+g&&b+d-g>i?e.splice(13,3,"L",a+c,i-6,a+c+6,i,a+c,i+6,a+c,b+d-f):h&&0>h&&i>b+g&&b+d-g>i?e.splice(33,3,"L",a,i+6,a-6,i,a,i-6,a,b+f):i&&i>d&&h>a+g&&a+c-g>h?e.splice(23,3,"L",h+6,b+d,h,b+d+6,h-6,b+d,a+f,b+d):i&&0>i&&h>a+g&&a+c-g>h&&e.splice(3,3,"L",h-6,b,h,b-6,h+6,b,c-f,b),e}},clipRect:function(a,b,c,d){var e="highcharts-"+tb++,f=this.createElement("clipPath").attr({id:e}).add(this.defs),a=this.rect(a,b,c,d,0).add(f);return a.id=e,a.clipPath=f,a},text:function(a,b,c,d){var e=fa||!aa&&this.forExport,f={};return d&&!this.forExport?this.html(a,b,c):(f.x=Math.round(b||0),c&&(f.y=Math.round(c)),(a||0===a)&&(f.text=a),a=this.createElement("text").attr(f),e&&a.css({position:"absolute"}),d||(a.xSetter=function(a,b,c){var e,f,d=c.childNodes;for(f=1;f<d.length;f++)e=d[f],e.getAttribute("x")===c.getAttribute("x")&&e.setAttribute("x",a);c.setAttribute(b,a)}),a)},fontMetrics:function(a){var a=a||this.style.fontSize,a=/px/.test(a)?z(a):/em/.test(a)?12*parseFloat(a):12,a=24>a?a+4:u(1.2*a),b=u(.8*a);return{h:a,b:b}},label:function(a,b,c,d,e,f,g,h,i){function j(){var a,b;a=s.element.style,J=(void 0===Va||void 0===wb||n.styles.textAlign)&&s.textStr&&s.getBBox(),n.width=(Va||J.width||0)+2*x+v,n.height=(wb||J.height||0)+2*x,na=x+o.fontMetrics(a&&a.fontSize).b,z&&(m||(a=u(-L*x),b=h?-na:0,n.box=m=d?o.symbol(d,a,b,n.width,n.height,B):o.rect(a,b,n.width,n.height,0,B[Pb]),m.attr("fill",Q).add(n)),m.isImg||m.attr(q({width:u(n.width),height:u(n.height)},B)),B=null)}function k(){var c,a=n.styles,a=a&&a.textAlign,b=v+x*(1-L);c=h?0:na,r(Va)&&J&&("center"===a||"right"===a)&&(b+={center:.5,right:1}[a]*(Va-J.width)),(b!==s.x||c!==s.y)&&(s.attr("x",b),c!==t&&s.attr("y",c)),s.x=b,s.y=c}function l(a,b){m?m.attr(a,b):B[a]=b}var m,J,Va,wb,xb,yb,na,z,o=this,n=o.g(i),s=o.text("",0,0,g).attr({zIndex:1}),L=0,x=3,v=0,y=0,B={};n.onAdd=function(){s.add(n),n.attr({text:a||"",x:b,y:c}),m&&r(e)&&n.attr({anchorX:e,anchorY:f})},n.widthSetter=function(a){Va=a},n.heightSetter=function(a){wb=a},n.paddingSetter=function(a){r(a)&&a!==x&&(x=a,k())},n.paddingLeftSetter=function(a){r(a)&&a!==v&&(v=a,k())},n.alignSetter=function(a){L={left:0,center:.5,right:1}[a]},n.textSetter=function(a){a!==t&&s.textSetter(a),j(),k()},n["stroke-widthSetter"]=function(a,b){a&&(z=!0),y=a%2/2,l(b,a)},n.strokeSetter=n.fillSetter=n.rSetter=function(a,b){"fill"===b&&a&&(z=!0),l(b,a)
2
+ },n.anchorXSetter=function(a,b){e=a,l(b,a+y-xb)},n.anchorYSetter=function(a,b){f=a,l(b,a-yb)},n.xSetter=function(a){n.x=a,L&&(a-=L*((Va||J.width)+x)),xb=u(a),n.attr("translateX",xb)},n.ySetter=function(a){yb=n.y=u(a),n.attr("translateY",yb)};var A=n.css;return q(n,{css:function(a){if(a){var b={},a=w(a);p("fontSize,fontWeight,fontFamily,color,lineHeight,width,textDecoration,textShadow".split(","),function(c){a[c]!==t&&(b[c]=a[c],delete a[c])}),s.css(b)}return A.call(n,a)},getBBox:function(){return{width:J.width+2*x,height:J.height+2*x,x:J.x-x,y:J.y-x}},shadow:function(a){return m&&m.shadow(a),n},destroy:function(){W(n.element,"mouseenter"),W(n.element,"mouseleave"),s&&(s=s.destroy()),m&&(m=m.destroy()),P.prototype.destroy.call(n),n=o=j=k=l=null}})}},Za=ta,q(P.prototype,{htmlCss:function(a){var b=this.element;return(b=a&&"SPAN"===b.tagName&&a.width)&&(delete a.width,this.textWidth=b,this.updateTransform()),this.styles=q(this.styles,a),G(this.element,a),this},htmlGetBBox:function(){var a=this.element,b=this.bBox;return b||("text"===a.nodeName&&(a.style.position="absolute"),b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}),b},htmlUpdateTransform:function(){if(this.added){var a=this.renderer,b=this.element,c=this.translateX||0,d=this.translateY||0,e=this.x||0,f=this.y||0,g=this.textAlign||"left",h={left:0,center:.5,right:1}[g],i=this.shadows;if(G(b,{marginLeft:c,marginTop:d}),i&&p(i,function(a){G(a,{marginLeft:c+1,marginTop:d+1})}),this.inverted&&p(b.childNodes,function(c){a.invertChild(c,b)}),"SPAN"===b.tagName){var k,j=this.rotation,l=z(this.textWidth),o=[j,g,b.innerHTML,this.textWidth].join(",");o!==this.cTT&&(k=a.fontMetrics(b.style.fontSize).b,r(j)&&this.setSpanRotation(j,h,k),i=m(this.elemWidth,b.offsetWidth),i>l&&/[ \-]/.test(b.textContent||b.innerText)&&(G(b,{width:l+"px",display:"block",whiteSpace:"normal"}),i=l),this.getSpanCorrection(i,k,h,j,g)),G(b,{left:e+(this.xCorr||0)+"px",top:f+(this.yCorr||0)+"px"}),ib&&(k=b.offsetHeight),this.cTT=o}}else this.alignOnAdd=!0},setSpanRotation:function(a,b,c){var d={},e=Aa?"-ms-transform":ib?"-webkit-transform":Ta?"MozTransform":Ib?"-o-transform":"";d[e]=d.transform="rotate("+a+"deg)",d[e+(Ta?"Origin":"-origin")]=d.transformOrigin=100*b+"% "+c+"px",G(this.element,d)},getSpanCorrection:function(a,b,c){this.xCorr=-a*c,this.yCorr=-b}}),q(ta.prototype,{html:function(a,b,c){var d=this.createElement("span"),e=d.element,f=d.renderer;return d.textSetter=function(a){a!==e.innerHTML&&delete this.bBox,e.innerHTML=this.textStr=a},d.xSetter=d.ySetter=d.alignSetter=d.rotationSetter=function(a,b){"align"===b&&(b="textAlign"),d[b]=a,d.htmlUpdateTransform()},d.attr({text:a,x:u(b),y:u(c)}).css({position:"absolute",whiteSpace:"nowrap",fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),d.css=d.htmlCss,f.isSVG&&(d.add=function(a){var b,c=f.box.parentNode,j=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)j.push(a),a=a.parentGroup;p(j.reverse(),function(a){var d;b=a.div=a.div||Y(Ja,{className:H(a.element,"class")},{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px"},b||c),d=b.style,q(a,{translateXSetter:function(b,c){d.left=b+"px",a[c]=b,a.doTransform=!0},translateYSetter:function(b,c){d.top=b+"px",a[c]=b,a.doTransform=!0},visibilitySetter:function(a,b){d[b]=a}})})}}else b=c;return b.appendChild(e),d.added=!0,d.alignOnAdd&&d.htmlUpdateTransform(),d}),d}});var X;if(!aa&&!fa){R.VMLElement=X={init:function(a,b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ","absolute",";"],e=b===Ja;("shape"===b||e)&&d.push("left:0;top:0;width:1px;height:1px;"),d.push("visibility: ",e?"hidden":"visible"),c.push(' style="',d.join(""),'"/>'),b&&(c=e||"span"===b||"img"===b?c.join(""):a.prepVML(c),this.element=Y(c)),this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box,d=a?a.element||a:d;return a&&a.inverted&&b.invertChild(c,d),d.appendChild(c),this.added=!0,this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform(),this.onAdd&&this.onAdd(),this},updateTransform:P.prototype.htmlUpdateTransform,setSpanRotation:function(){var a=this.rotation,b=Z(a*Ca),c=ea(a*Ca);G(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11=",b,", M12=",-c,", M21=",c,", M22=",b,", sizingMethod='auto expand')"].join(""):Q})},getSpanCorrection:function(a,b,c,d,e){var i,f=d?Z(d*Ca):1,g=d?ea(d*Ca):0,h=m(this.elemHeight,this.element.offsetHeight);this.xCorr=0>f&&-a,this.yCorr=0>g&&-h,i=0>f*g,this.xCorr+=g*b*(i?1-c:c),this.yCorr-=f*b*(d?i?c:1-c:1),e&&"left"!==e&&(this.xCorr-=a*c*(0>f?-1:1),d&&(this.yCorr-=h*c*(0>g?-1:1)),G(this.element,{textAlign:e}))},pathToVML:function(a){for(var b=a.length,c=[];b--;)ha(a[b])?c[b]=u(10*a[b])-5:"Z"===a[b]?c[b]="x":(c[b]=a[b],!a.isArc||"wa"!==a[b]&&"at"!==a[b]||(c[b+5]===c[b+7]&&(c[b+7]+=a[b+7]>a[b+5]?1:-1),c[b+6]===c[b+8]&&(c[b+8]+=a[b+8]>a[b+6]?1:-1)));return c.join(" ")||"x"},clip:function(a){var c,b=this;return a?(c=a.members,ja(c,b),c.push(b),b.destroyClip=function(){ja(c,b)},a=a.getCSS(b)):(b.destroyClip&&b.destroyClip(),a={clip:hb?"inherit":"rect(auto)"}),b.css(a)},css:P.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&Pa(a)},destroy:function(){return this.destroyClip&&this.destroyClip(),P.prototype.destroy.apply(this)},on:function(a,b){return this.element["on"+a]=function(){var a=I.event;a.target=a.srcElement,b(a)},this},cutOffPath:function(a,b){var c,a=a.split(/[ ,]/);return c=a.length,(9===c||11===c)&&(a[c-4]=a[c-2]=z(a[c-2])-10*b),a.join(" ")},shadow:function(a,b,c){var e,h,j,l,o,n,s,d=[],f=this.element,g=this.renderer,i=f.style,k=f.path;if(k&&"string"!=typeof k.value&&(k="x"),o=k,a){for(n=m(a.width,3),s=(a.opacity||.15)/n,e=1;3>=e;e++)l=2*n+1-2*e,c&&(o=this.cutOffPath(k.value,l+.5)),j=['<shape isShadow="true" strokeweight="',l,'" filled="false" path="',o,'" coordsize="10 10" style="',f.style.cssText,'" />'],h=Y(g.prepVML(j),null,{left:z(i.left)+m(a.offsetX,1),top:z(i.top)+m(a.offsetY,1)}),c&&(h.cutOff=l+1),j=['<stroke color="',a.color||"black",'" opacity="',s*e,'"/>'],Y(g.prepVML(j),null,null,h),b?b.element.appendChild(h):f.parentNode.insertBefore(h,f),d.push(h);this.shadows=d}return this},updateShadows:sa,setAttr:function(a,b){hb?this.element[a]=b:this.element.setAttribute(a,b)},classSetter:function(a){this.element.className=a},dashstyleSetter:function(a,b,c){(c.getElementsByTagName("stroke")[0]||Y(this.renderer.prepVML(["<stroke/>"]),null,null,c))[b]=a||"solid",this[b]=a},dSetter:function(a,b,c){var d=this.shadows,a=a||[];if(this.d=a.join(" "),c.path=a=this.pathToVML(a),d)for(c=d.length;c--;)d[c].path=d[c].cutOff?this.cutOffPath(a,d[c].cutOff):a;this.setAttr(b,a)},fillSetter:function(a,b,c){var d=c.nodeName;"SPAN"===d?c.style.color=a:"IMG"!==d&&(c.filled=a!==Q,this.setAttr("fillcolor",this.renderer.color(a,c,b,this)))},opacitySetter:sa,rotationSetter:function(a,b,c){c=c.style,this[b]=c[b]=a,c.left=-u(ea(a*Ca)+1)+"px",c.top=u(Z(a*Ca))+"px"},strokeSetter:function(a,b,c){this.setAttr("strokecolor",this.renderer.color(a,c,b))},"stroke-widthSetter":function(a,b,c){c.stroked=!!a,this[b]=a,ha(a)&&(a+="px"),this.setAttr("strokeweight",a)},titleSetter:function(a,b){this.setAttr(b,a)},visibilitySetter:function(a,b,c){"inherit"===a&&(a="visible"),this.shadows&&p(this.shadows,function(c){c.style[b]=a}),"DIV"===c.nodeName&&(a="hidden"===a?"-999em":0,hb||(c.style[b]=a?"visible":"hidden"),b="top"),c.style[b]=a},xSetter:function(a,b,c){this[b]=a,"x"===b?b="left":"y"===b&&(b="top"),this.updateClipping?(this[b]=a,this.updateClipping()):c.style[b]=a},zIndexSetter:function(a,b,c){c.style[b]=a}},X=ka(P,X),X.prototype.ySetter=X.prototype.widthSetter=X.prototype.heightSetter=X.prototype.xSetter;var ga={Element:X,isIE8:wa.indexOf("MSIE 8.0")>-1,init:function(a,b,c,d){var e;if(this.alignedObjects=[],d=this.createElement(Ja).css(q(this.getStyle(d),{position:"relative"})),e=d.element,a.appendChild(d.element),this.isVML=!0,this.box=e,this.boxWrapper=d,this.cache={},this.setSize(b,c,!1),!y.namespaces.hcv){y.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{y.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(f){y.styleSheets[0].cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}},isHidden:function(){return!this.box.offsetWidth},clipRect:function(a,b,c,d){var e=this.createElement(),f=ca(a);return q(e,{members:[],left:(f?a.x:a)+1,top:(f?a.y:b)+1,width:(f?a.width:c)-1,height:(f?a.height:d)-1,getCSS:function(a){var b=a.element,c=b.nodeName,a=a.inverted,d=this.top-("shape"===c?b.offsetTop:0),e=this.left,b=e+this.width,f=d+this.height,d={clip:"rect("+u(a?e:d)+"px,"+u(a?f:b)+"px,"+u(a?b:f)+"px,"+u(a?d:e)+"px)"};return!a&&hb&&"DIV"===c&&q(d,{width:b+"px",height:f+"px"}),d},updateClipping:function(){p(e.members,function(a){a.element&&a.css(e.getCSS(a))})}})},color:function(a,b,c,d){var f,h,i,e=this,g=/^rgba/,j=Q;if(a&&a.linearGradient?i="gradient":a&&a.radialGradient&&(i="pattern"),i){var k,l,n,s,m,J,L,r,o=a.linearGradient||a.radialGradient,x="",a=a.stops,v=[],q=function(){h=['<fill colors="'+v.join(",")+'" opacity="',m,'" o:opacity2="',s,'" type="',i,'" ',x,'focus="100%" method="any" />'],Y(e.prepVML(h),null,null,b)};if(n=a[0],r=a[a.length-1],n[0]>0&&a.unshift([0,n[1]]),r[0]<1&&a.push([1,r[1]]),p(a,function(a,b){g.test(a[1])?(f=ya(a[1]),k=f.get("rgb"),l=f.get("a")):(k=a[1],l=1),v.push(100*a[0]+"% "+k),b?(m=l,J=k):(s=l,L=k)}),"fill"===c)if("gradient"===i)c=o.x1||o[0]||0,a=o.y1||o[1]||0,n=o.x2||o[2]||0,o=o.y2||o[3]||0,x='angle="'+(90-180*U.atan((o-a)/(n-c))/ma)+'"',q();else{var w,j=o.r,t=2*j,u=2*j,y=o.cx,B=o.cy,na=b.radialReference,j=function(){na&&(w=d.getBBox(),y+=(na[0]-w.x)/w.width-.5,B+=(na[1]-w.y)/w.height-.5,t*=na[2]/w.width,u*=na[2]/w.height),x='src="'+E.global.VMLRadialGradientURL+'" size="'+t+","+u+'" origin="0.5,0.5" position="'+y+","+B+'" color2="'+L+'" ',q()};d.added?j():d.onAdd=j,j=J}else j=k}else g.test(a)&&"IMG"!==b.tagName?(f=ya(a),h=["<",c,' opacity="',f.get("a"),'"/>'],Y(this.prepVML(h),null,null,b),j=f.get("rgb")):(j=b.getElementsByTagName(c),j.length&&(j[0].opacity=1,j[0].type="solid"),j=a);return j},prepVML:function(a){var b=this.isIE8,a=a.join("");return b?(a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),a=-1===a.indexOf('style="')?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):a=a.replace("<","<hcv:"),a},text:ta.prototype.html,path:function(a){var b={coordsize:"10 10"};return La(a)?b.d=a:ca(a)&&q(b,a),this.createElement("shape").attr(b)},circle:function(a,b,c){var d=this.symbol("circle");return ca(a)&&(c=a.r,b=a.y,a=a.x),d.isCircle=!0,d.r=c,d.attr({x:a,y:b})},g:function(a){var b;return a&&(b={className:"highcharts-"+a,"class":"highcharts-"+a}),this.createElement(Ja).attr(b)},image:function(a,b,c,d,e){var f=this.createElement("img").attr({src:a});return arguments.length>1&&f.attr({x:b,y:c,width:d,height:e}),f},createElement:function(a){return"rect"===a?this.symbol(a):ta.prototype.createElement.call(this,a)},invertChild:function(a,b){var c=this,d=b.style,e="IMG"===a.tagName&&a.style;G(a,{flip:"x",left:z(d.width)-(e?z(e.top):1),top:z(d.height)-(e?z(e.left):1),rotation:-90}),p(a.childNodes,function(b){c.invertChild(b,a)})},symbols:{arc:function(a,b,c,d,e){var f=e.start,g=e.end,h=e.r||c||d,c=e.innerR,d=Z(f),i=ea(f),j=Z(g),k=ea(g);return g-f===0?["x"]:(f=["wa",a-h,b-h,a+h,b+h,a+h*d,b+h*i,a+h*j,b+h*k],e.open&&!c&&f.push("e","M",a,b),f.push("at",a-c,b-c,a+c,b+c,a+c*j,b+c*k,a+c*d,b+c*i,"x","e"),f.isArc=!0,f)},circle:function(a,b,c,d,e){return e&&(c=d=2*e.r),e&&e.isCircle&&(a-=c/2,b-=d/2),["wa",a,b,a+c,b+d,a+c,b+d/2,a+c,b+d/2,"e"]},rect:function(a,b,c,d,e){return ta.prototype.symbols[r(e)&&e.r?"callout":"square"].call(0,a,b,c,d,e)}}};R.VMLRenderer=X=function(){this.init.apply(this,arguments)},X.prototype=w(ta.prototype,ga),Za=X}ta.prototype.measureSpanWidth=function(a,b){var d,c=y.createElement("span");return d=y.createTextNode(a),c.appendChild(d),G(c,b),this.box.appendChild(c),d=c.offsetWidth,Pa(c),d};var Lb;fa&&(R.CanVGRenderer=X=function(){xa="http://www.w3.org/1999/xhtml"},X.prototype.symbols={},Lb=function(){function a(){var d,a=b.length;for(d=0;a>d;d++)b[d]();b=[]}var b=[];return{push:function(c,d){0===b.length&&Qb(d,a),b.push(c)}}}(),Za=X),Sa.prototype={addLabel:function(){var l,a=this.axis,b=a.options,c=a.chart,d=a.horiz,e=a.categories,f=a.names,g=this.pos,h=b.labels,i=a.tickPositions,d=d&&e&&!h.step&&!h.staggerLines&&!h.rotation&&c.plotWidth/i.length||!d&&(c.margin[3]||.33*c.chartWidth),j=g===i[0],k=g===i[i.length-1],f=e?m(e[g],f[g],g):g,e=this.label,o=i.info;a.isDatetimeAxis&&o&&(l=b.dateTimeLabelFormats[o.higherRanks[g]||o.unitName]),this.isFirst=j,this.isLast=k,b=a.labelFormatter.call({axis:a,chart:c,isFirst:j,isLast:k,dateTimeLabelFormat:l,value:a.isLog?da(ia(f)):f}),g=d&&{width:v(1,u(d-2*(h.padding||10)))+"px"},g=q(g,h.style),r(e)?e&&e.attr({text:b}).css(g):(l={align:a.labelAlign},ha(h.rotation)&&(l.rotation=h.rotation),d&&h.ellipsis&&(l._clipHeight=a.len/i.length),this.label=r(b)&&h.enabled?c.renderer.text(b,0,0,h.useHTML).attr(l).css(g).add(a.labelGroup):null)},getLabelSize:function(){var a=this.label,b=this.axis;return a?a.getBBox()[b.horiz?"height":"width"]:0},getLabelSides:function(){var a=this.label.getBBox(),b=this.axis,c=b.horiz,d=b.options.labels,a=c?a.width:a.height,b=c?d.x-a*{left:0,center:.5,right:1}[b.labelAlign]:0;return[b,c?a+b:a]},handleOverflow:function(a,b){var l,o,n,c=!0,d=this.axis,e=this.isFirst,f=this.isLast,g=d.horiz?b.x:b.y,h=d.reversed,i=d.tickPositions,j=this.getLabelSides(),k=j[0],j=j[1],s=this.label.line||0;if(l=d.labelEdge,o=d.justifyLabels&&(e||f),l[s]===t||g+k>l[s]?l[s]=g+j:o||(c=!1),o){l=(o=d.justifyToPlot)?d.pos:0,o=o?l+d.len:d.chart.chartWidth;do a+=e?1:-1,n=d.ticks[i[a]];while(i[a]&&(!n||n.label.line!==s));d=n&&n.label.xy&&n.label.xy.x+n.getLabelSides()[e?0:1],e&&!h||f&&h?l>g+k&&(g=l-k,n&&g+j>d&&(c=!1)):g+j>o&&(g=o-j,n&&d>g+k&&(c=!1)),b.x=g}return c},getPosition:function(a,b,c,d){var e=this.axis,f=e.chart,g=d&&f.oldChartHeight||f.chartHeight;return{x:a?e.translate(b+c,null,null,d)+e.transB:e.left+e.offset+(e.opposite?(d&&f.oldChartWidth||f.chartWidth)-e.right-e.left:0),y:a?g-e.bottom+e.offset-(e.opposite?e.height:0):g-e.translate(b+c,null,null,d)-e.transB}},getLabelPosition:function(a,b,c,d,e,f,g,h){var i=this.axis,j=i.transA,k=i.reversed,l=i.staggerLines,o=i.chart.renderer.fontMetrics(e.style.fontSize).b,n=e.rotation,a=a+e.x-(f&&d?f*j*(k?-1:1):0),b=b+e.y-(f&&!d?f*j*(k?1:-1):0);return n&&2===i.side&&(b-=o-o*Z(n*Ca)),!r(e.y)&&!n&&(b+=o-c.getBBox().height/2),l&&(c.line=g/(h||1)%l,b+=c.line*(i.labelOffset/l)),{x:a,y:b}},getMarkPath:function(a,b,c,d,e,f){return f.crispLine(["M",a,b,"L",a+(e?0:-c),b+(e?c:0)],d)},render:function(a,b,c){var d=this.axis,e=d.options,f=d.chart.renderer,g=d.horiz,h=this.type,i=this.label,j=this.pos,k=e.labels,l=this.gridLine,o=h?h+"Grid":"grid",n=h?h+"Tick":"tick",s=e[o+"LineWidth"],p=e[o+"LineColor"],J=e[o+"LineDashStyle"],L=e[n+"Length"],o=e[n+"Width"]||0,x=e[n+"Color"],r=e[n+"Position"],n=this.mark,v=k.step,q=!0,u=d.tickmarkOffset,w=this.getPosition(g,j,u,b),y=w.x,w=w.y,B=g&&y===d.pos+d.len||!g&&w===d.pos?-1:1;this.isActive=!0,s&&(j=d.getPlotLinePath(j+u,s*B,b,!0),l===t&&(l={stroke:p,"stroke-width":s},J&&(l.dashstyle=J),h||(l.zIndex=1),b&&(l.opacity=0),this.gridLine=l=s?f.path(j).attr(l).add(d.gridGroup):null),!b&&l&&j&&l[this.isNew?"attr":"animate"]({d:j,opacity:c})),o&&L&&("inside"===r&&(L=-L),d.opposite&&(L=-L),h=this.getMarkPath(y,w,L,o*B,g,f),n?n.animate({d:h,opacity:c}):this.mark=f.path(h).attr({stroke:x,"stroke-width":o,opacity:c}).add(d.axisGroup)),i&&!isNaN(y)&&(i.xy=w=this.getLabelPosition(y,w,i,g,k,u,a,v),this.isFirst&&!this.isLast&&!m(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!m(e.showLastLabel,1)?q=!1:!d.isRadial&&!k.step&&!k.rotation&&!b&&0!==c&&(q=this.handleOverflow(a,w)),v&&a%v&&(q=!1),q&&!isNaN(w.y)?(w.opacity=c,i[this.isNew?"attr":"animate"](w),this.isNew=!1):i.attr("y",-9999))},destroy:function(){Oa(this,this.axis)}},R.PlotLineOrBand=function(a,b){this.axis=a,b&&(this.options=b,this.id=b.id)},R.PlotLineOrBand.prototype={render:function(){var p,a=this,b=a.axis,c=b.horiz,d=(b.pointRange||0)/2,e=a.options,f=e.label,g=a.label,h=e.width,i=e.to,j=e.from,k=r(j)&&r(i),l=e.value,o=e.dashStyle,n=a.svgElem,s=[],J=e.color,L=e.zIndex,x=e.events,q={},t=b.chart.renderer;if(b.isLog&&(j=za(j),i=za(i),l=za(l)),h)s=b.getPlotLinePath(l,h),q={stroke:J,"stroke-width":h},o&&(q.dashstyle=o);else{if(!k)return;j=v(j,b.min-d),i=C(i,b.max+d),s=b.getPlotBandPath(j,i,e),J&&(q.fill=J),e.borderWidth&&(q.stroke=e.borderColor,q["stroke-width"]=e.borderWidth)}if(r(L)&&(q.zIndex=L),n)s?n.animate({d:s},null,n.onGetPath):(n.hide(),n.onGetPath=function(){n.show()},g&&(a.label=g=g.destroy()));else if(s&&s.length&&(a.svgElem=n=t.path(s).attr(q).add(),x))for(p in d=function(b){n.on(b,function(c){x[b].apply(a,[c])})},x)d(p);return f&&r(f.text)&&s&&s.length&&b.width>0&&b.height>0?(f=w({align:c&&k&&"center",x:c?!k&&4:10,verticalAlign:!c&&k&&"middle",y:c?k?16:10:k?6:-4,rotation:c&&!k&&90},f),g||(q={align:f.textAlign||f.align,rotation:f.rotation},r(L)&&(q.zIndex=L),a.label=g=t.text(f.text,0,0,f.useHTML).attr(q).css(f.style).add()),b=[s[1],s[4],m(s[6],s[1])],s=[s[2],s[5],m(s[7],s[2])],c=Na(b),k=Na(s),g.align(f,!1,{x:c,y:k,width:Ba(b)-c,height:Ba(s)-k}),g.show()):g&&g.hide(),a},destroy:function(){ja(this.axis.plotLinesAndBands,this),delete this.axis,Oa(this)}},la.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#C0C0C0",labels:N,lineColor:"#C0D0E0",lineWidth:1,minPadding:.01,maxPadding:.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:.05,minPadding:.05,startOnTick:!0,tickWidth:0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return Ga(this.total,-1)},style:N.style}},defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{x:0,y:20},title:{rotation:0}},defaultTopAxisOptions:{labels:{x:0,y:-15},title:{rotation:0}},init:function(a,b){var c=b.isX;this.horiz=a.inverted?!c:c,this.coll=(this.isXAxis=c)?"xAxis":"yAxis",this.opposite=b.opposite,this.side=b.side||(this.horiz?this.opposite?0:2:this.opposite?1:3),this.setOptions(b);var d=this.options,e=d.type;this.labelFormatter=d.labels.formatter||this.defaultLabelFormatter,this.userOptions=b,this.minPixelPadding=0,this.chart=a,this.reversed=d.reversed,this.zoomEnabled=d.zoomEnabled!==!1,this.categories=d.categories||"category"===e,this.names=[],this.isLog="logarithmic"===e,this.isDatetimeAxis="datetime"===e,this.isLinked=r(d.linkedTo),this.tickmarkOffset=this.categories&&"between"===d.tickmarkPlacement?.5:0,this.ticks={},this.labelEdge=[],this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len=0,this.minRange=this.userMinRange=d.minRange||d.maxZoom,this.range=d.range,this.offset=d.offset||0,this.stacks={},this.oldStacks={},this.min=this.max=null,this.crosshair=m(d.crosshair,qa(a.options.tooltip.crosshairs)[c?0:1],!1);var f,d=this.options.events;-1===Da(this,a.axes)&&(c&&!this.isColorAxis?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this)),this.series=this.series||[],a.inverted&&c&&this.reversed===t&&(this.reversed=!0),this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(f in d)K(this,f,d[f]);this.isLog&&(this.val2lin=za,this.lin2val=ia)},setOptions:function(a){this.options=w(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],w(E[this.coll],a))},defaultLabelFormatter:function(){var g,a=this.axis,b=this.value,c=a.categories,d=this.dateTimeLabelFormat,e=E.lang.numericSymbols,f=e&&e.length,h=a.options.labels.format,a=a.isLog?b:a.tickInterval;if(h)g=Ia(h,this);else if(c)g=b;else if(d)g=cb(d,b);else if(f&&a>=1e3)for(;f--&&g===t;)c=Math.pow(1e3,f+1),a>=c&&null!==e[f]&&(g=Ga(b/c,-1)+e[f]);return g===t&&(g=M(b)>=1e4?Ga(b,0):Ga(b,-1,t,"")),g},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1,a.dataMin=a.dataMax=null,a.buildStacks&&a.buildStacks(),p(a.series,function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries){var d;d=c.options.threshold;var e;a.hasVisibleSeries=!0,a.isLog&&0>=d&&(d=null),a.isXAxis?(d=c.xData,d.length&&(a.dataMin=C(m(a.dataMin,d[0]),Na(d)),a.dataMax=v(m(a.dataMax,d[0]),Ba(d)))):(c.getExtremes(),e=c.dataMax,c=c.dataMin,r(c)&&r(e)&&(a.dataMin=C(m(a.dataMin,c),c),a.dataMax=v(m(a.dataMax,e),e)),r(d)&&(a.dataMin>=d?(a.dataMin=d,a.ignoreMinPadding=!0):a.dataMax<d&&(a.dataMax=d,a.ignoreMaxPadding=!0)))}})},translate:function(a,b,c,d,e,f){var g=1,h=0,i=d?this.oldTransA:this.transA,d=d?this.oldMin:this.min,j=this.minPixelPadding,e=(this.options.ordinal||this.isLog&&e)&&this.lin2val;return i||(i=this.transA),c&&(g*=-1,h=this.len),this.reversed&&(g*=-1,h-=g*(this.sector||this.len)),b?(a=a*g+h,a-=j,a=a/i+d,e&&(a=this.lin2val(a))):(e&&(a=this.val2lin(a)),"between"===f&&(f=.5),a=g*(a-d)*i+h+g*j+(ha(f)?i*f*this.pointRange:0)),a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,b){return this.translate(a-(b?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,b,c,d,e){var i,j,o,f=this.chart,g=this.left,h=this.top,k=c&&f.oldChartHeight||f.chartHeight,l=c&&f.oldChartWidth||f.chartWidth;return i=this.transB,e=m(e,this.translate(a,null,null,c)),a=c=u(e+i),i=j=u(k-e-i),isNaN(e)?o=!0:this.horiz?(i=h,j=k-this.bottom,(g>a||a>g+this.width)&&(o=!0)):(a=g,c=l-this.right,(h>i||i>h+this.height)&&(o=!0)),o&&!d?null:f.renderer.crispLine(["M",a,i,"L",c,j],b||1)},getLinearTickPositions:function(a,b,c){var d,e=da(T(b/a)*a),f=da(Ka(c/a)*a),g=[];if(b===c&&ha(b))return[b];for(b=e;f>=b&&(g.push(b),b=da(b+a),b!==d);)d=b;return g},getMinorTickPositions:function(){var e,a=this.options,b=this.tickPositions,c=this.minorTickInterval,d=[];if(this.isLog)for(e=b.length,a=1;e>a;a++)d=d.concat(this.getLogTickPositions(c,b[a-1],b[a],!0));else if(this.isDatetimeAxis&&"auto"===a.minorTickInterval)d=d.concat(this.getTimeTicks(this.normalizeTimeTickInterval(c),this.min,this.max,a.startOfWeek)),d[0]<this.min&&d.shift();else for(b=this.min+(b[0]-this.min)%c;b<=this.max;b+=c)d.push(b);return d},adjustForMinRange:function(){var d,f,g,h,i,j,a=this.options,b=this.min,c=this.max,e=this.dataMax-this.dataMin>=this.minRange;if(this.isXAxis&&this.minRange===t&&!this.isLog&&(r(a.min)||r(a.max)?this.minRange=null:(p(this.series,function(a){for(i=a.xData,g=j=a.xIncrement?1:i.length-1;g>0;g--)h=i[g]-i[g-1],(f===t||f>h)&&(f=h)}),this.minRange=C(5*f,this.dataMax-this.dataMin))),c-b<this.minRange){var k=this.minRange;d=(k-c+b)/2,d=[b-d,m(a.min,b-d)],e&&(d[2]=this.dataMin),b=Ba(d),c=[b+k,m(a.max,b+k)],e&&(c[2]=this.dataMax),c=Na(c),k>c-b&&(d[0]=c-k,d[1]=m(a.min,c-k),b=Ba(d))}this.min=b,this.max=c},setAxisTranslation:function(a){var e,b=this,c=b.max-b.min,d=b.axisPointRange||0,f=0,g=0,h=b.linkedParent,i=!!b.categories,j=b.transA;(b.isXAxis||i||d)&&(h?(f=h.minPointOffset,g=h.pointRangePadding):p(b.series,function(a){var h=i?1:b.isXAxis?a.pointRange:b.axisPointRange||0,j=a.options.pointPlacement,n=a.closestPointRange;h>c&&(h=0),d=v(d,h),f=v(f,Fa(j)?0:h/2),g=v(g,"on"===j?0:h),!a.noSharedTooltip&&r(n)&&(e=r(e)?C(e,n):n)}),h=b.ordinalSlope&&e?b.ordinalSlope/e:1,b.minPointOffset=f*=h,b.pointRangePadding=g*=h,b.pointRange=C(d,c),b.closestPointRange=e),a&&(b.oldTransA=j),b.translationSlope=b.transA=j=b.len/(c+g||1),b.transB=b.horiz?b.left:b.bottom,b.minPixelPadding=j*f},setTickPositions:function(a){var s,b=this,c=b.chart,d=b.options,e=b.isLog,f=b.isDatetimeAxis,g=b.isXAxis,h=b.isLinked,i=b.options.tickPositioner,j=d.maxPadding,k=d.minPadding,l=d.tickInterval,o=d.minTickInterval,n=d.tickPixelInterval,$=b.categories;h?(b.linkedParent=c[b.coll][d.linkedTo],c=b.linkedParent.getExtremes(),b.min=m(c.min,c.dataMin),b.max=m(c.max,c.dataMax),d.type!==b.linkedParent.options.type&&ra(11,1)):(b.min=m(b.userMin,d.min,b.dataMin),b.max=m(b.userMax,d.max,b.dataMax)),e&&(!a&&C(b.min,m(b.dataMin,b.min))<=0&&ra(10,1),b.min=da(za(b.min)),b.max=da(za(b.max))),b.range&&r(b.max)&&(b.userMin=b.min=v(b.min,b.max-b.range),b.userMax=b.max,b.range=null),b.beforePadding&&b.beforePadding(),b.adjustForMinRange(),$||b.axisPointRange||b.usePercentage||h||!r(b.min)||!r(b.max)||!(c=b.max-b.min)||(r(d.min)||r(b.userMin)||!k||!(b.dataMin<0)&&b.ignoreMinPadding||(b.min-=c*k),r(d.max)||r(b.userMax)||!j||!(b.dataMax>0)&&b.ignoreMaxPadding||(b.max+=c*j)),ha(d.floor)&&(b.min=v(b.min,d.floor)),ha(d.ceiling)&&(b.max=C(b.max,d.ceiling)),b.min===b.max||void 0===b.min||void 0===b.max?b.tickInterval=1:h&&!l&&n===b.linkedParent.options.tickPixelInterval?b.tickInterval=b.linkedParent.tickInterval:(b.tickInterval=m(l,$?1:(b.max-b.min)*n/v(b.len,n)),!r(l)&&b.len<n&&!this.isRadial&&!this.isLog&&!$&&d.startOnTick&&d.endOnTick&&(s=!0,b.tickInterval/=4)),g&&!a&&p(b.series,function(a){a.processData(b.min!==b.oldMin||b.max!==b.oldMax)}),b.setAxisTranslation(!0),b.beforeSetTickPositions&&b.beforeSetTickPositions(),b.postProcessTickInterval&&(b.tickInterval=b.postProcessTickInterval(b.tickInterval)),b.pointRange&&(b.tickInterval=v(b.pointRange,b.tickInterval)),!l&&b.tickInterval<o&&(b.tickInterval=o),f||e||l||(b.tickInterval=nb(b.tickInterval,null,mb(b.tickInterval),d)),b.minorTickInterval="auto"===d.minorTickInterval&&b.tickInterval?b.tickInterval/5:d.minorTickInterval,b.tickPositions=a=d.tickPositions?[].concat(d.tickPositions):i&&i.apply(b,[b.min,b.max]),a||(!b.ordinalPositions&&(b.max-b.min)/b.tickInterval>v(2*b.len,200)&&ra(19,!0),a=f?b.getTimeTicks(b.normalizeTimeTickInterval(b.tickInterval,d.units),b.min,b.max,d.startOfWeek,b.ordinalPositions,b.closestPointRange,!0):e?b.getLogTickPositions(b.tickInterval,b.min,b.max):b.getLinearTickPositions(b.tickInterval,b.min,b.max),s&&a.splice(1,a.length-2),b.tickPositions=a),h||(e=a[0],f=a[a.length-1],h=b.minPointOffset||0,d.startOnTick?b.min=e:b.min-h>e&&a.shift(),d.endOnTick?b.max=f:b.max+h<f&&a.pop(),1===a.length&&(d=M(b.max)>1e13?1:.001,b.min-=d,b.max+=d))},setMaxTicks:function(){var a=this.chart,b=a.maxTicks||{},c=this.tickPositions,d=this._maxTicksKey=[this.coll,this.pos,this.len].join("-");!this.isLinked&&!this.isDatetimeAxis&&c&&c.length>(b[d]||0)&&this.options.alignTicks!==!1&&(b[d]=c.length),a.maxTicks=b},adjustTickAmount:function(){var a=this._maxTicksKey,b=this.tickPositions,c=this.chart.maxTicks;if(c&&c[a]&&!this.isDatetimeAxis&&!this.categories&&!this.isLinked&&this.options.alignTicks!==!1&&this.min!==t){var d=this.tickAmount,e=b.length;if(this.tickAmount=a=c[a],a>e){for(;b.length<a;)b.push(da(b[b.length-1]+this.tickInterval));this.transA*=(e-1)/(a-1),this.max=b[b.length-1]}r(d)&&a!==d&&(this.isDirty=!0)}},setScale:function(){var b,c,d,e,a=this.stacks;if(this.oldMin=this.min,this.oldMax=this.max,this.oldAxisLength=this.len,this.setAxisSize(),e=this.len!==this.oldAxisLength,p(this.series,function(a){(a.isDirtyData||a.isDirty||a.xAxis.isDirty)&&(d=!0)}),e||d||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax){if(!this.isXAxis)for(b in a)for(c in a[b])a[b][c].total=null,a[b][c].cum=0;this.forceRedraw=!1,this.getSeriesExtremes(),this.setTickPositions(),this.oldUserMin=this.userMin,this.oldUserMax=this.userMax,this.isDirty||(this.isDirty=e||this.min!==this.oldMin||this.max!==this.oldMax)}else if(!this.isXAxis){this.oldStacks&&(a=this.stacks=this.oldStacks);for(b in a)for(c in a[b])a[b][c].cum=a[b][c].total}this.setMaxTicks()},setExtremes:function(a,b,c,d,e){var f=this,g=f.chart,c=m(c,!0),e=q(e,{min:a,max:b});D(f,"setExtremes",e,function(){f.userMin=a,f.userMax=b,f.eventArgs=e,f.isDirtyExtremes=!0,c&&g.redraw(d)})},zoom:function(a,b){var c=this.dataMin,d=this.dataMax,e=this.options;return this.allowZoomOutside||(r(c)&&a<=C(c,m(e.min,c))&&(a=t),r(d)&&b>=v(d,m(e.max,d))&&(b=t)),this.displayBtn=a!==t||b!==t,this.setExtremes(a,b,!1,t,{trigger:"zoom"}),!0},setAxisSize:function(){var a=this.chart,b=this.options,c=b.offsetLeft||0,d=this.horiz,e=m(b.width,a.plotWidth-c+(b.offsetRight||0)),f=m(b.height,a.plotHeight),g=m(b.top,a.plotTop),b=m(b.left,a.plotLeft+c),c=/%$/;c.test(f)&&(f=parseInt(f,10)/100*a.plotHeight),c.test(g)&&(g=parseInt(g,10)/100*a.plotHeight+a.plotTop),this.left=b,this.top=g,this.width=e,this.height=f,this.bottom=a.chartHeight-f-g,this.right=a.chartWidth-e-b,this.len=v(d?e:f,0),this.pos=d?b:g},getExtremes:function(){var a=this.isLog;return{min:a?da(ia(this.min)):this.min,max:a?da(ia(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,c=b?ia(this.min):this.min,b=b?ia(this.max):this.max;return c>a||null===a?a=c:a>b&&(a=b),this.translate(a,0,1,0,1)},autoLabelAlign:function(a){return a=(m(a,0)-90*this.side+720)%360,a>15&&165>a?"right":a>195&&345>a?"left":"center"},getOffset:function(){var j,l,q,y,z,A,B,a=this,b=a.chart,c=b.renderer,d=a.options,e=a.tickPositions,f=a.ticks,g=a.horiz,h=a.side,i=b.inverted?[1,0,3,2][h]:h,k=0,o=0,n=d.title,s=d.labels,$=0,J=b.axisOffset,L=b.clipOffset,x=[-1,1,1,-1][h],u=1,w=m(s.maxStaggerLines,5),na=2===h?c.fontMetrics(s.style.fontSize).b:0;if(a.hasData=j=a.hasVisibleSeries||r(a.min)&&r(a.max)&&!!e,a.showAxis=b=j||m(d.showEmpty,!0),a.staggerLines=a.horiz&&s.staggerLines,a.axisGroup||(a.gridGroup=c.g("grid").attr({zIndex:d.gridZIndex||1}).add(),a.axisGroup=c.g("axis").attr({zIndex:d.zIndex||2}).add(),a.labelGroup=c.g("axis-labels").attr({zIndex:s.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels").add()),j||a.isLinked){if(a.labelAlign=m(s.align||a.autoLabelAlign(s.rotation)),p(e,function(b){f[b]?f[b].addLabel():f[b]=new Sa(a,b)}),a.horiz&&!a.staggerLines&&w&&!s.rotation){for(q=a.reversed?[].concat(e).reverse():e;w>u;){for(j=[],y=!1,s=0;s<q.length;s++)z=q[s],A=(A=f[z].label&&f[z].label.getBBox())?A.width:0,B=s%u,A&&(z=a.translate(z),j[B]!==t&&z<j[B]&&(y=!0),j[B]=z+A);if(!y)break;u++}u>1&&(a.staggerLines=u)}p(e,function(b){(0===h||2===h||{1:"left",3:"right"}[h]===a.labelAlign)&&($=v(f[b].getLabelSize(),$))}),a.staggerLines&&($*=a.staggerLines,a.labelOffset=$)}else for(q in f)f[q].destroy(),delete f[q];n&&n.text&&n.enabled!==!1&&(a.axisTitle||(a.axisTitle=c.text(n.text,0,0,n.useHTML).attr({zIndex:7,rotation:n.rotation||0,align:n.textAlign||{low:"left",middle:"center",high:"right"}[n.align]}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(n.style).add(a.axisGroup),a.axisTitle.isNew=!0),b&&(k=a.axisTitle.getBBox()[g?"height":"width"],o=m(n.margin,g?5:10),l=n.offset),a.axisTitle[b?"show":"hide"]()),a.offset=x*m(d.offset,J[h]),a.axisTitleMargin=m(l,$+o+($&&x*d.labels[g?"y":"x"]-na)),J[h]=v(J[h],a.axisTitleMargin+k+x*a.offset),L[i]=v(L[i],2*T(d.lineWidth/2))},getLinePath:function(a){var b=this.chart,c=this.opposite,d=this.offset,e=this.horiz,f=this.left+(c?this.width:0)+d,d=b.chartHeight-this.bottom-(c?this.height:0)+d;return c&&(a*=-1),b.renderer.crispLine(["M",e?this.left:f,e?d:this.top,"L",e?b.chartWidth-this.right:f,e?d:b.chartHeight-this.bottom],a)},getTitlePosition:function(){var a=this.horiz,b=this.left,c=this.top,d=this.len,e=this.options.title,f=a?b:c,g=this.opposite,h=this.offset,i=z(e.style.fontSize||12),d={low:f+(a?0:d),middle:f+d/2,high:f+(a?d:0)}[e.align],b=(a?c+this.height:b)+(a?1:-1)*(g?-1:1)*this.axisTitleMargin+(2===this.side?i:0);
3
+ return{x:a?d:b+(g?this.width:0)+h+(e.x||0),y:a?b-(g?this.height:0)+h:d+(e.y||0)}},render:function(){var j,u,z,a=this,b=a.horiz,c=a.reversed,d=a.chart,e=d.renderer,f=a.options,g=a.isLog,h=a.isLinked,i=a.tickPositions,k=a.axisTitle,l=a.ticks,o=a.minorTicks,n=a.alternateBands,s=f.stackLabels,m=f.alternateGridColor,J=a.tickmarkOffset,L=f.lineWidth,x=d.hasRendered&&r(a.oldMin)&&!isNaN(a.oldMin),q=a.hasData,v=a.showAxis,w=f.labels.overflow,y=a.justifyLabels=b&&w!==!1;a.labelEdge.length=0,a.justifyToPlot="justify"===w,p([l,o,n],function(a){for(var b in a)a[b].isActive=!1}),(q||h)&&(a.minorTickInterval&&!a.categories&&p(a.getMinorTickPositions(),function(b){o[b]||(o[b]=new Sa(a,b,"minor")),x&&o[b].isNew&&o[b].render(null,!0),o[b].render(null,!1,1)}),i.length&&(j=i.slice(),(b&&c||!b&&!c)&&j.reverse(),y&&(j=j.slice(1).concat([j[0]])),p(j,function(b,c){y&&(c=c===j.length-1?0:c+1),(!h||b>=a.min&&b<=a.max)&&(l[b]||(l[b]=new Sa(a,b)),x&&l[b].isNew&&l[b].render(c,!0,.1),l[b].render(c,!1,1))}),J&&0===a.min&&(l[-1]||(l[-1]=new Sa(a,-1,null,!0)),l[-1].render(-1))),m&&p(i,function(b,c){c%2===0&&b<a.max&&(n[b]||(n[b]=new R.PlotLineOrBand(a)),u=b+J,z=i[c+1]!==t?i[c+1]+J:a.max,n[b].options={from:g?ia(u):u,to:g?ia(z):z,color:m},n[b].render(),n[b].isActive=!0)}),a._addedPlotLB||(p((f.plotLines||[]).concat(f.plotBands||[]),function(b){a.addPlotBandOrLine(b)}),a._addedPlotLB=!0)),p([l,o,n],function(a){var b,c,e=[],f=va?va.duration||500:0,g=function(){for(c=e.length;c--;)a[e[c]]&&!a[e[c]].isActive&&(a[e[c]].destroy(),delete a[e[c]])};for(b in a)a[b].isActive||(a[b].render(b,!1,0),a[b].isActive=!1,e.push(b));a!==n&&d.hasRendered&&f?f&&setTimeout(g,f):g()}),L&&(b=a.getLinePath(L),a.axisLine?a.axisLine.animate({d:b}):a.axisLine=e.path(b).attr({stroke:f.lineColor,"stroke-width":L,zIndex:7}).add(a.axisGroup),a.axisLine[v?"show":"hide"]()),k&&v&&(k[k.isNew?"attr":"animate"](a.getTitlePosition()),k.isNew=!1),s&&s.enabled&&a.renderStackTotals(),a.isDirty=!1},redraw:function(){var a=this.chart.pointer;a&&a.reset(!0),this.render(),p(this.plotLinesAndBands,function(a){a.render()}),p(this.series,function(a){a.isDirty=!0})},destroy:function(a){var d,b=this,c=b.stacks,e=b.plotLinesAndBands;a||W(b);for(d in c)Oa(c[d]),c[d]=null;for(p([b.ticks,b.minorTicks,b.alternateBands],function(a){Oa(a)}),a=e.length;a--;)e[a].destroy();p("stackTotalGroup,axisLine,axisTitle,axisGroup,cross,gridGroup,labelGroup".split(","),function(a){b[a]&&(b[a]=b[a].destroy())}),this.cross&&this.cross.destroy()},drawCrosshair:function(a,b){if(this.crosshair)if((r(b)||!m(this.crosshair.snap,!0))===!1)this.hideCrosshair();else{var c,d=this.crosshair,e=d.animation;m(d.snap,!0)?r(b)&&(c=this.chart.inverted!=this.horiz?b.plotX:this.len-b.plotY):c=this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos,c=this.isRadial?this.getPlotLinePath(this.isXAxis?b.x:m(b.stackY,b.y)):this.getPlotLinePath(null,null,null,null,c),null===c?this.hideCrosshair():this.cross?this.cross.attr({visibility:"visible"})[e?"animate":"attr"]({d:c},e):(e={"stroke-width":d.width||1,stroke:d.color||"#C0C0C0",zIndex:d.zIndex||2},d.dashStyle&&(e.dashstyle=d.dashStyle),this.cross=this.chart.renderer.path(c).attr(e).add())}},hideCrosshair:function(){this.cross&&this.cross.hide()}},q(la.prototype,{getPlotBandPath:function(a,b){var c=this.getPlotLinePath(b),d=this.getPlotLinePath(a);return d&&c?d.push(c[4],c[5],c[1],c[2]):d=null,d},addPlotBand:function(a){this.addPlotBandOrLine(a,"plotBands")},addPlotLine:function(a){this.addPlotBandOrLine(a,"plotLines")},addPlotBandOrLine:function(a,b){var c=new R.PlotLineOrBand(this,a).render(),d=this.userOptions;return c&&(b&&(d[b]=d[b]||[],d[b].push(a)),this.plotLinesAndBands.push(c)),c},removePlotBandOrLine:function(a){for(var b=this.plotLinesAndBands,c=this.options,d=this.userOptions,e=b.length;e--;)b[e].id===a&&b[e].destroy();p([c.plotLines||[],d.plotLines||[],c.plotBands||[],d.plotBands||[]],function(b){for(e=b.length;e--;)b[e].id===a&&ja(b,b[e])})}}),la.prototype.getTimeTicks=function(a,b,c,d){var h,e=[],f={},g=E.global.useUTC,i=new Date(b-Ra),j=a.unitRange,k=a.count;if(r(b)){j>=A.second&&(i.setMilliseconds(0),i.setSeconds(j>=A.minute?0:k*T(i.getSeconds()/k))),j>=A.minute&&i[Db](j>=A.hour?0:k*T(i[pb]()/k)),j>=A.hour&&i[Eb](j>=A.day?0:k*T(i[qb]()/k)),j>=A.day&&i[sb](j>=A.month?1:k*T(i[Xa]()/k)),j>=A.month&&(i[Fb](j>=A.year?0:k*T(i[fb]()/k)),h=i[gb]()),j>=A.year&&(h-=h%k,i[Gb](h)),j===A.week&&i[sb](i[Xa]()-i[rb]()+m(d,1)),b=1,Ra&&(i=new Date(i.getTime()+Ra)),h=i[gb]();for(var d=i.getTime(),l=i[fb](),o=i[Xa](),n=g?Ra:(864e5+6e4*i.getTimezoneOffset())%864e5;c>d;)e.push(d),j===A.year?d=eb(h+b*k,0):j===A.month?d=eb(h,l+b*k):g||j!==A.day&&j!==A.week?d+=j*k:d=eb(h,l,o+b*k*(j===A.day?1:7)),b++;e.push(d),p(vb(e,function(a){return j<=A.hour&&a%A.day===n}),function(a){f[a]="day"})}return e.info=q(a,{higherRanks:f,totalRange:j*k}),e},la.prototype.normalizeTimeTickInterval=function(a,b){var g,c=b||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],d=c[c.length-1],e=A[d[0]],f=d[1];for(g=0;g<c.length&&(d=c[g],e=A[d[0]],f=d[1],!(c[g+1]&&a<=(e*f[f.length-1]+A[c[g+1][0]])/2));g++);return e===A.year&&5*e>a&&(f=[1,2,5]),c=nb(a/e,f,"year"===d[0]?v(mb(a/e),1):1),{unitRange:e,count:c,unitName:d[0]}},la.prototype.getLogTickPositions=function(a,b,c,d){var e=this.options,f=this.len,g=[];if(d||(this._minorAutoInterval=null),a>=.5)a=u(a),g=this.getLinearTickPositions(a,b,c);else if(a>=.08)for(var h,i,j,k,l,f=T(b),e=a>.3?[1,2,4]:a>.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];c+1>f&&!l;f++)for(i=e.length,h=0;i>h&&!l;h++)j=za(ia(f)*e[h]),j>b&&(!d||c>=k)&&g.push(k),k>c&&(l=!0),k=j;else b=ia(b),c=ia(c),a=e[d?"minorTickInterval":"tickInterval"],a=m("auto"===a?null:a,this._minorAutoInterval,(c-b)*(e.tickPixelInterval/(d?5:1))/((d?f/this.tickPositions.length:f)||1)),a=nb(a,null,mb(a)),g=Ua(this.getLinearTickPositions(a,b,c),za),d||(this._minorAutoInterval=a/5);return d||(this.tickInterval=a),g};var Mb=R.Tooltip=function(){this.init.apply(this,arguments)};Mb.prototype={init:function(a,b){var c=b.borderWidth,d=b.style,e=z(d.padding);this.chart=a,this.options=b,this.crosshairs=[],this.now={x:0,y:0},this.isHidden=!0,this.label=a.renderer.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,"tooltip").attr({padding:e,fill:b.backgroundColor,"stroke-width":c,r:b.borderRadius,zIndex:8}).css(d).css({padding:0}).add().attr({y:-9999}),fa||this.label.shadow(b.shadow),this.shared=b.shared},destroy:function(){this.label&&(this.label=this.label.destroy()),clearTimeout(this.hideTimer),clearTimeout(this.tooltipTimeout)},move:function(a,b,c,d){var e=this,f=e.now,g=e.options.animation!==!1&&!e.isHidden,h=e.followPointer||e.len>1;q(f,{x:g?(2*f.x+a)/3:a,y:g?(f.y+b)/2:b,anchorX:h?t:g?(2*f.anchorX+c)/3:c,anchorY:h?t:g?(f.anchorY+d)/2:d}),e.label.attr(f),g&&(M(a-f.x)>1||M(b-f.y)>1)&&(clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){e&&e.move(a,b,c,d)},32))},hide:function(){var b,a=this;clearTimeout(this.hideTimer),this.isHidden||(b=this.chart.hoverPoints,this.hideTimer=setTimeout(function(){a.label.fadeOut(),a.isHidden=!0},m(this.options.hideDelay,500)),b&&p(b,function(a){a.setState()}),this.chart.hoverPoints=null)},getAnchor:function(a,b){var c,i,d=this.chart,e=d.inverted,f=d.plotTop,g=0,h=0,a=qa(a);return c=a[0].tooltipPos,this.followPointer&&b&&(b.chartX===t&&(b=d.pointer.normalize(b)),c=[b.chartX-d.plotLeft,b.chartY-f]),c||(p(a,function(a){i=a.series.yAxis,g+=a.plotX,h+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&i?i.top-f:0)}),g/=a.length,h/=a.length,c=[e?d.plotWidth-h:g,this.shared&&!e&&a.length>1&&b?b.chartY-f:e?d.plotHeight-g:h]),Ua(c,u)},getPosition:function(a,b,c){var g,d=this.chart,e=this.distance,f={},h=["y",d.chartHeight,b,c.plotY+d.plotTop],i=["x",d.chartWidth,a,c.plotX+d.plotLeft],j=c.ttBelow||d.inverted&&!c.negative||!d.inverted&&c.negative,k=function(a,b,c,d){var g=d-e>c,b=b>d+e+c,c=d-e-c;if(d+=e,j&&b)f[a]=d;else if(!j&&g)f[a]=c;else if(g)f[a]=c;else{if(!b)return!1;f[a]=d}},l=function(a,b,c,d){return e>d||d>b-e?!1:void(f[a]=c/2>d?1:d>b-c/2?b-c-2:d-c/2)},o=function(a){var b=h;h=i,i=b,g=a},n=function(){k.apply(0,h)!==!1?l.apply(0,i)===!1&&!g&&(o(!0),n()):g?f.x=f.y=0:(o(!0),n())};return(d.inverted||this.len>1)&&o(),n(),f},defaultFormatter:function(a){var d,b=this.points||qa(this),c=b[0].series;return d=[a.tooltipHeaderFormatter(b[0])],p(b,function(a){c=a.series,d.push(c.tooltipFormatter&&c.tooltipFormatter(a)||a.point.tooltipFormatter(c.tooltipOptions.pointFormat))}),d.push(a.options.footerFormat||""),d.join("")},refresh:function(a,b){var f,g,i,c=this.chart,d=this.label,e=this.options,h={},j=[];i=e.formatter||this.defaultFormatter;var k,h=c.hoverPoints,l=this.shared;clearTimeout(this.hideTimer),this.followPointer=qa(a)[0].series.tooltipOptions.followPointer,g=this.getAnchor(a,b),f=g[0],g=g[1],!l||a.series&&a.series.noSharedTooltip?h=a.getLabelConfig():(c.hoverPoints=a,h&&p(h,function(a){a.setState()}),p(a,function(a){a.setState("hover"),j.push(a.getLabelConfig())}),h={x:a[0].category,y:a[0].y},h.points=j,this.len=j.length,a=a[0]),i=i.call(h,this),h=a.series,this.distance=m(h.tooltipOptions.distance,16),i===!1?this.hide():(this.isHidden&&(bb(d),d.attr("opacity",1).show()),d.attr({text:i}),k=e.borderColor||a.color||h.color||"#606060",d.attr({stroke:k}),this.updatePosition({plotX:f,plotY:g,negative:a.negative,ttBelow:a.ttBelow}),this.isHidden=!1),D(c,"tooltipRefresh",{text:i,x:f+c.plotLeft,y:g+c.plotTop,borderColor:k})},updatePosition:function(a){var b=this.chart,c=this.label,c=(this.options.positioner||this.getPosition).call(this,c.width,c.height,a);this.move(u(c.x),u(c.y),a.plotX+b.plotLeft,a.plotY+b.plotTop)},tooltipHeaderFormatter:function(a){var h,b=a.series,c=b.tooltipOptions,d=c.dateTimeLabelFormats,e=c.xDateFormat,f=b.xAxis,g=f&&"datetime"===f.options.type&&ha(a.key),c=c.headerFormat,f=f&&f.closestPointRange;if(g&&!e){if(f){for(h in A)if(A[h]>=f||A[h]<=A.day&&a.key%A[h]>0){e=d[h];break}}else e=d.day;e=e||d.year}return g&&e&&(c=c.replace("{point.key}","{point.key:"+e+"}")),Ia(c,{point:a,series:b})}};var oa;$a=y.documentElement.ontouchstart!==t;var Wa=R.Pointer=function(a,b){this.init(a,b)};if(Wa.prototype={init:function(a,b){var f,c=b.chart,d=c.events,e=fa?"":c.zoomType,c=a.inverted;this.options=b,this.chart=a,this.zoomX=f=/x/.test(e),this.zoomY=e=/y/.test(e),this.zoomHor=f&&!c||e&&c,this.zoomVert=e&&!c||f&&c,this.hasZoom=f||e,this.runChartClick=d&&!!d.click,this.pinchDown=[],this.lastValidTouch={},R.Tooltip&&b.tooltip.enabled&&(a.tooltip=new Mb(a,b.tooltip),this.followTouchMove=b.tooltip.followTouchMove),this.setDOMEvents()},normalize:function(a,b){var c,d,a=a||window.event,a=Sb(a);return a.target||(a.target=a.srcElement),d=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a,b||(this.chartPosition=b=Rb(this.chart.container)),d.pageX===t?(c=v(a.x,a.clientX-b.left),d=a.y):(c=d.pageX-b.left,d=d.pageY-b.top),q(a,{chartX:u(c),chartY:u(d)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};return p(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})}),b},getIndex:function(a){var b=this.chart;return b.inverted?b.plotHeight+b.plotTop-a.chartY:a.chartX-b.plotLeft},runPointActions:function(a){var e,f,i,j,b=this.chart,c=b.series,d=b.tooltip,g=b.hoverPoint,h=b.hoverSeries,k=b.chartWidth,l=this.getIndex(a);if(d&&this.options.tooltip.shared&&(!h||!h.noSharedTooltip)){for(f=[],i=c.length,j=0;i>j;j++)c[j].visible&&c[j].options.enableMouseTracking!==!1&&!c[j].noSharedTooltip&&c[j].singularTooltips!==!0&&c[j].tooltipPoints.length&&(e=c[j].tooltipPoints[l])&&e.series&&(e._dist=M(l-e.clientX),k=C(k,e._dist),f.push(e));for(i=f.length;i--;)f[i]._dist>k&&f.splice(i,1);f.length&&f[0].clientX!==this.hoverX&&(d.refresh(f,a),this.hoverX=f[0].clientX)}c=h&&h.tooltipOptions.followPointer,h&&h.tracker&&!c?(e=h.tooltipPoints[l])&&e!==g&&e.onMouseOver(a):d&&c&&!d.isHidden&&(h=d.getAnchor([{}],a),d.updatePosition({plotX:h[0],plotY:h[1]})),d&&!this._onDocumentMouseMove&&(this._onDocumentMouseMove=function(a){V[oa]&&V[oa].pointer.onDocumentMouseMove(a)},K(y,"mousemove",this._onDocumentMouseMove)),p(b.axes,function(b){b.drawCrosshair(a,m(e,g))})},reset:function(a){var b=this.chart,c=b.hoverSeries,d=b.hoverPoint,e=b.tooltip,f=e&&e.shared?b.hoverPoints:d;(a=a&&e&&f)&&qa(f)[0].plotX===t&&(a=!1),a?(e.refresh(f),d&&d.setState(d.state,!0)):(d&&d.onMouseOut(),c&&c.onMouseOut(),e&&e.hide(),this._onDocumentMouseMove&&(W(y,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null),p(b.axes,function(a){a.hideCrosshair()}),this.hoverX=null)},scaleGroups:function(a,b){var d,c=this.chart;p(c.series,function(e){d=a||e.getPlotBox(),e.xAxis&&e.xAxis.zoomEnabled&&(e.group.attr(d),e.markerGroup&&(e.markerGroup.attr(d),e.markerGroup.clip(b?c.clipRect:null)),e.dataLabelsGroup&&e.dataLabelsGroup.attr(d))}),c.clipRect.attr(b||c.clipBox)},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type,b.cancelClick=!1,b.mouseDownX=this.mouseDownX=a.chartX,b.mouseDownY=this.mouseDownY=a.chartY},drag:function(a){var l,b=this.chart,c=b.options.chart,d=a.chartX,e=a.chartY,f=this.zoomHor,g=this.zoomVert,h=b.plotLeft,i=b.plotTop,j=b.plotWidth,k=b.plotHeight,o=this.mouseDownX,n=this.mouseDownY;h>d?d=h:d>h+j&&(d=h+j),i>e?e=i:e>i+k&&(e=i+k),this.hasDragged=Math.sqrt(Math.pow(o-d,2)+Math.pow(n-e,2)),this.hasDragged>10&&(l=b.isInsidePlot(o-h,n-i),b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&l&&!this.selectionMarker&&(this.selectionMarker=b.renderer.rect(h,i,f?1:j,g?1:k,0).attr({fill:c.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add()),this.selectionMarker&&f&&(d-=o,this.selectionMarker.attr({width:M(d),x:(d>0?0:d)+o})),this.selectionMarker&&g&&(d=e-n,this.selectionMarker.attr({height:M(d),y:(d>0?0:d)+n})),l&&!this.selectionMarker&&c.panning&&b.pan(a,c.panning))},drop:function(a){var b=this.chart,c=this.hasPinched;if(this.selectionMarker){var i,d={xAxis:[],yAxis:[],originalEvent:a.originalEvent||a},a=this.selectionMarker,e=a.attr?a.attr("x"):a.x,f=a.attr?a.attr("y"):a.y,g=a.attr?a.attr("width"):a.width,h=a.attr?a.attr("height"):a.height;(this.hasDragged||c)&&(p(b.axes,function(a){if(a.zoomEnabled){var b=a.horiz,c=a.toValue(b?e:f),b=a.toValue(b?e+g:f+h);!isNaN(c)&&!isNaN(b)&&(d[a.coll].push({axis:a,min:C(c,b),max:v(c,b)}),i=!0)}}),i&&D(b,"selection",d,function(a){b.zoom(q(a,c?{animation:!1}:null))})),this.selectionMarker=this.selectionMarker.destroy(),c&&this.scaleGroups()}b&&(G(b.container,{cursor:b._cursor}),b.cancelClick=this.hasDragged>10,b.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(a){a=this.normalize(a),a.preventDefault&&a.preventDefault(),this.dragStart(a)},onDocumentMouseUp:function(a){V[oa]&&V[oa].pointer.drop(a)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition,d=b.hoverSeries,a=this.normalize(a,c);c&&d&&!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&this.reset()},onContainerMouseLeave:function(){var a=V[oa];a&&(a.pointer.reset(),a.pointer.chartPosition=null)},onContainerMouseMove:function(a){var b=this.chart;oa=b.index,a=this.normalize(a),"mousedown"===b.mouseIsDown&&this.drag(a),(this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop))&&!b.openMenu&&this.runPointActions(a)},inClass:function(a,b){for(var c;a;){if(c=H(a,"class")){if(-1!==c.indexOf(b))return!0;if(-1!==c.indexOf("highcharts-container"))return!1}a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries,c=(a=a.relatedTarget||a.toElement)&&a.point&&a.point.series;!b||b.options.stickyTracking||this.inClass(a,"highcharts-tooltip")||c===b||b.onMouseOut()},onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop,a=this.normalize(a);a.cancelBubble=!0,b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(D(c.series,"click",q(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(q(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&D(b,"click",a)))},setDOMEvents:function(){var a=this,b=a.chart.container;b.onmousedown=function(b){a.onContainerMouseDown(b)},b.onmousemove=function(b){a.onContainerMouseMove(b)},b.onclick=function(b){a.onContainerClick(b)},K(b,"mouseleave",a.onContainerMouseLeave),1===ab&&K(y,"mouseup",a.onDocumentMouseUp),$a&&(b.ontouchstart=function(b){a.onContainerTouchStart(b)},b.ontouchmove=function(b){a.onContainerTouchMove(b)},1===ab&&K(y,"touchend",a.onDocumentTouchEnd))},destroy:function(){var a;W(this.chart.container,"mouseleave",this.onContainerMouseLeave),ab||(W(y,"mouseup",this.onDocumentMouseUp),W(y,"touchend",this.onDocumentTouchEnd)),clearInterval(this.tooltipTimeout);for(a in this)this[a]=null}},q(R.Pointer.prototype,{pinchTranslate:function(a,b,c,d,e,f){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,a,b,c,d,e,f),(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,a,b,c,d,e,f)},pinchTranslateDirection:function(a,b,c,d,e,f,g,h){var s,m,y,i=this.chart,j=a?"x":"y",k=a?"X":"Y",l="chart"+k,o=a?"width":"height",n=i["plot"+(a?"Left":"Top")],p=h||1,q=i.inverted,x=i.bounds[a?"h":"v"],r=1===b.length,v=b[0][l],u=c[0][l],t=!r&&b[1][l],w=!r&&c[1][l],c=function(){!r&&M(v-t)>20&&(p=h||M(u-w)/M(v-t)),m=(n-u)/p+v,s=i["plot"+(a?"Width":"Height")]/p};c(),b=m,b<x.min?(b=x.min,y=!0):b+s>x.max&&(b=x.max-s,y=!0),y?(u-=.8*(u-g[j][0]),r||(w-=.8*(w-g[j][1])),c()):g[j]=[u,w],q||(f[j]=m-n,f[o]=s),f=q?1/p:p,e[o]=s,e[j]=b,d[q?a?"scaleY":"scaleX":"scale"+k]=p,d["translate"+k]=f*n+(u-f*v)},pinch:function(a){var b=this,c=b.chart,d=b.pinchDown,e=b.followTouchMove,f=a.touches,g=f.length,h=b.lastValidTouch,i=b.hasZoom,j=b.selectionMarker,k={},l=1===g&&(b.inClass(a.target,"highcharts-tracker")&&c.runTrackerClick||c.runChartClick),o={};(i||e)&&!l&&a.preventDefault(),Ua(f,function(a){return b.normalize(a)}),"touchstart"===a.type?(p(f,function(a,b){d[b]={chartX:a.chartX,chartY:a.chartY}}),h.x=[d[0].chartX,d[1]&&d[1].chartX],h.y=[d[0].chartY,d[1]&&d[1].chartY],p(c.axes,function(a){if(a.zoomEnabled){var b=c.bounds[a.horiz?"h":"v"],d=a.minPixelPadding,e=a.toPixels(a.dataMin),f=a.toPixels(a.dataMax),g=C(e,f),e=v(e,f);b.min=C(a.pos,g-d),b.max=v(a.pos+a.len,e+d)}})):d.length&&(j||(b.selectionMarker=j=q({destroy:sa},c.plotBox)),b.pinchTranslate(d,f,k,j,o,h),b.hasPinched=i,b.scaleGroups(k,o),!i&&e&&1===g&&this.runPointActions(b.normalize(a)))},onContainerTouchStart:function(a){var b=this.chart;oa=b.index,1===a.touches.length?(a=this.normalize(a),b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)?(this.runPointActions(a),this.pinch(a)):this.reset()):2===a.touches.length&&this.pinch(a)},onContainerTouchMove:function(a){(1===a.touches.length||2===a.touches.length)&&this.pinch(a)},onDocumentTouchEnd:function(a){V[oa]&&V[oa].pointer.drop(a)}}),I.PointerEvent||I.MSPointerEvent){var ua={},zb=!!I.PointerEvent,Wb=function(){var a,b=[];b.item=function(a){return this[a]};for(a in ua)ua.hasOwnProperty(a)&&b.push({pageX:ua[a].pageX,pageY:ua[a].pageY,target:ua[a].target});return b},Ab=function(a,b,c,d){a=a.originalEvent||a,"touch"!==a.pointerType&&a.pointerType!==a.MSPOINTER_TYPE_TOUCH||!V[oa]||(d(a),d=V[oa].pointer,d[b]({type:c,target:a.currentTarget,preventDefault:sa,touches:Wb()}))};q(Wa.prototype,{onContainerPointerDown:function(a){Ab(a,"onContainerTouchStart","touchstart",function(a){ua[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){Ab(a,"onContainerTouchMove","touchmove",function(a){ua[a.pointerId]={pageX:a.pageX,pageY:a.pageY},ua[a.pointerId].target||(ua[a.pointerId].target=a.currentTarget)})},onDocumentPointerUp:function(a){Ab(a,"onContainerTouchEnd","touchend",function(a){delete ua[a.pointerId]})},batchMSEvents:function(a){a(this.chart.container,zb?"pointerdown":"MSPointerDown",this.onContainerPointerDown),a(this.chart.container,zb?"pointermove":"MSPointerMove",this.onContainerPointerMove),a(y,zb?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}}),Ma(Wa.prototype,"init",function(a,b,c){a.call(this,b,c),(this.hasZoom||this.followTouchMove)&&G(b.container,{"-ms-touch-action":Q,"touch-action":Q})}),Ma(Wa.prototype,"setDOMEvents",function(a){a.apply(this),(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(K)}),Ma(Wa.prototype,"destroy",function(a){this.batchMSEvents(W),a.call(this)})}var lb=R.Legend=function(a,b){this.init(a,b)};lb.prototype={init:function(a,b){var c=this,d=b.itemStyle,e=m(b.padding,8),f=b.itemMarginTop||0;this.options=b,b.enabled&&(c.baseline=z(d.fontSize)+3+f,c.itemStyle=d,c.itemHiddenStyle=w(d,b.itemHiddenStyle),c.itemMarginTop=f,c.padding=e,c.initialItemX=e,c.initialItemY=e-5,c.maxItemWidth=0,c.chart=a,c.itemHeight=0,c.lastLineHeight=0,c.symbolWidth=m(b.symbolWidth,16),c.pages=[],c.render(),K(c.chart,"endResize",function(){c.positionCheckboxes()}))},colorizeItem:function(a,b){var j,c=this.options,d=a.legendItem,e=a.legendLine,f=a.legendSymbol,g=this.itemHiddenStyle.color,c=b?c.itemStyle.color:g,h=b?a.legendColor||a.color||"#CCC":g,g=a.options&&a.options.marker,i={fill:h};if(d&&d.css({fill:c,color:c}),e&&e.attr({stroke:h}),f){if(g&&f.isMarker)for(j in i.stroke=h,g=a.convertAttribs(g))d=g[j],d!==t&&(i[j]=d);f.attr(i)}},positionItem:function(a){var b=this.options,c=b.symbolPadding,b=!b.rtl,d=a._legendItemPos,e=d[0],d=d[1],f=a.checkbox;a.legendGroup&&a.legendGroup.translate(b?e:this.legendWidth-e-2*c-4,d),f&&(f.x=e,f.y=d)},destroyItem:function(a){var b=a.checkbox;p(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())}),b&&Pa(a.checkbox)},destroy:function(){var a=this.group,b=this.box;b&&(this.box=b.destroy()),a&&(this.group=a.destroy())},positionCheckboxes:function(a){var c,b=this.group.alignAttr,d=this.clipHeight||this.legendHeight;b&&(c=b.translateY,p(this.allItems,function(e){var g,f=e.checkbox;f&&(g=c+f.y+(a||0)+3,G(f,{left:b.translateX+e.checkboxOffset+f.x-20+"px",top:g+"px",display:g>c-6&&c+d-6>g?"":Q}))}))},renderTitle:function(){var a=this.padding,b=this.options.title,c=0;b.text&&(this.title||(this.title=this.chart.renderer.label(b.text,a-3,a-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(b.style).add(this.group)),a=this.title.getBBox(),c=a.height,this.offsetWidth=a.width,this.contentGroup.attr({translateY:c})),this.titleHeight=c},renderItem:function(a){var b=this.chart,c=b.renderer,d=this.options,e="horizontal"===d.layout,f=this.symbolWidth,g=d.symbolPadding,h=this.itemStyle,i=this.itemHiddenStyle,j=this.padding,k=e?m(d.itemDistance,20):0,l=!d.rtl,o=d.width,n=d.itemMarginBottom||0,s=this.itemMarginTop,p=this.initialItemX,q=a.legendItem,r=a.series&&a.series.drawLegendSymbol?a.series:a,x=r.options,x=this.createCheckboxForItem&&x&&x.showCheckbox,t=d.useHTML;q||(a.legendGroup=c.g("legend-item").attr({zIndex:1}).add(this.scrollGroup),r.drawLegendSymbol(this,a),a.legendItem=q=c.text(d.labelFormat?Ia(d.labelFormat,a):d.labelFormatter.call(a),l?f+g:-g,this.baseline,t).css(w(a.visible?h:i)).attr({align:l?"left":"right",zIndex:2}).add(a.legendGroup),this.setItemEvents&&this.setItemEvents(a,q,t,h,i),this.colorizeItem(a,a.visible),x&&this.createCheckboxForItem(a)),c=q.getBBox(),f=a.checkboxOffset=d.itemWidth||a.legendItemWidth||f+g+c.width+k+(x?20:0),this.itemHeight=g=u(a.legendItemHeight||c.height),e&&this.itemX-p+f>(o||b.chartWidth-2*j-p-d.x)&&(this.itemX=p,this.itemY+=s+this.lastLineHeight+n,this.lastLineHeight=0),this.maxItemWidth=v(this.maxItemWidth,f),this.lastItemY=s+this.itemY+n,this.lastLineHeight=v(g,this.lastLineHeight),a._legendItemPos=[this.itemX,this.itemY],e?this.itemX+=f:(this.itemY+=s+g+n,this.lastLineHeight=g),this.offsetWidth=o||v((e?this.itemX-p-k:f)+j,this.offsetWidth)},getAllItems:function(){var a=[];return p(this.chart.series,function(b){var c=b.options;m(c.showInLegend,r(c.linkedTo)?!1:t,!0)&&(a=a.concat(b.legendItems||("point"===c.legendType?b.data:b)))}),a},render:function(){var e,f,g,h,a=this,b=a.chart,c=b.renderer,d=a.group,i=a.box,j=a.options,k=a.padding,l=j.borderWidth,o=j.backgroundColor;a.itemX=a.initialItemX,a.itemY=a.initialItemY,a.offsetWidth=0,a.lastItemY=0,d||(a.group=d=c.g("legend").attr({zIndex:7}).add(),a.contentGroup=c.g().attr({zIndex:1}).add(d),a.scrollGroup=c.g().add(a.contentGroup)),a.renderTitle(),e=a.getAllItems(),ob(e,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)}),j.reversed&&e.reverse(),a.allItems=e,a.display=f=!!e.length,p(e,function(b){a.renderItem(b)}),g=j.width||a.offsetWidth,h=a.lastItemY+a.lastLineHeight+a.titleHeight,h=a.handleOverflow(h),(l||o)&&(g+=k,h+=k,i?g>0&&h>0&&(i[i.isNew?"attr":"animate"](i.crisp({width:g,height:h})),i.isNew=!1):(a.box=i=c.rect(0,0,g,h,j.borderRadius,l||0).attr({stroke:j.borderColor,"stroke-width":l||0,fill:o||Q}).add(d).shadow(j.shadow),i.isNew=!0),i[f?"show":"hide"]()),a.legendWidth=g,a.legendHeight=h,p(e,function(b){a.positionItem(b)}),f&&d.align(q({width:g,height:h},j),!0,"spacingBox"),b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var h,s,b=this,c=this.chart,d=c.renderer,e=this.options,f=e.y,f=c.spacingBox.height+("top"===e.verticalAlign?-f:f)-this.padding,g=e.maxHeight,i=this.clipRect,j=e.navigation,k=m(j.animation,!0),l=j.arrowSize||12,o=this.nav,n=this.pages,q=this.allItems;return"horizontal"===e.layout&&(f/=2),g&&(f=C(f,g)),n.length=0,a>f&&!e.useHTML?(this.clipHeight=h=f-20-this.titleHeight-this.padding,this.currentPage=m(this.currentPage,1),this.fullHeight=a,p(q,function(a,b){var c=a._legendItemPos[1],d=u(a.legendItem.getBBox().height),e=n.length;(!e||c-n[e-1]>h&&(s||c)!==n[e-1])&&(n.push(s||c),e++),b===q.length-1&&c+d-n[e-1]>h&&n.push(c),c!==s&&(s=c)}),i||(i=b.clipRect=d.clipRect(0,this.padding,9999,0),b.contentGroup.clip(i)),i.attr({height:h}),o||(this.nav=o=d.g().attr({zIndex:1}).add(this.group),this.up=d.symbol("triangle",0,0,l,l).on("click",function(){b.scroll(-1,k)}).add(o),this.pager=d.text("",15,10).css(j.style).add(o),this.down=d.symbol("triangle-down",0,0,l,l).on("click",function(){b.scroll(1,k)}).add(o)),b.scroll(0),a=f):o&&(i.attr({height:c.chartHeight}),o.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),a},scroll:function(a,b){var c=this.pages,d=c.length,e=this.currentPage+a,f=this.clipHeight,g=this.options.navigation,h=g.activeColor,g=g.inactiveColor,i=this.pager,j=this.padding;e>d&&(e=d),e>0&&(b!==t&&Qa(b,this.chart),this.nav.attr({translateX:j,translateY:f+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:1===e?g:h}).css({cursor:1===e?"default":"pointer"}),i.attr({text:e+"/"+d}),this.down.attr({x:18+this.pager.getBBox().width,fill:e===d?g:h}).css({cursor:e===d?"default":"pointer"}),c=-c[e-1]+this.initialItemY,this.scrollGroup.animate({translateY:c}),this.currentPage=e,this.positionCheckboxes(c))}},N=R.LegendSymbolMixin={drawRectangle:function(a,b){var c=a.options.symbolHeight||12;b.legendSymbol=this.chart.renderer.rect(0,a.baseline-5-c/2,a.symbolWidth,c,a.options.symbolRadius||0).attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var d,b=this.options,c=b.marker;d=a.symbolWidth;var g,e=this.chart.renderer,f=this.legendGroup,a=a.baseline-u(.3*e.fontMetrics(a.options.itemStyle.fontSize).b);b.lineWidth&&(g={"stroke-width":b.lineWidth},b.dashStyle&&(g.dashstyle=b.dashStyle),this.legendLine=e.path(["M",0,a,"L",d,a]).attr(g).add(f)),c&&c.enabled!==!1&&(b=c.radius,this.legendSymbol=d=e.symbol(this.symbol,d/2-b,a-b,2*b,2*b).add(f),d.isMarker=!0)}},(/Trident\/7\.0/.test(wa)||Ta)&&Ma(lb.prototype,"positionItem",function(a,b){var c=this,d=function(){b._legendItemPos&&a.call(c,b)};d(),setTimeout(d)}),Ya.prototype={init:function(a,b){var c,d=a.series;a.series=null,c=w(E,a),c.series=a.series=d,this.userOptions=a,d=c.chart,this.margin=this.splashArray("margin",d),this.spacing=this.splashArray("spacing",d);var e=d.events;this.bounds={h:{},v:{}},this.callback=b,this.isResizing=0,this.options=c,this.axes=[],this.series=[],this.hasCartesianSeries=d.showAxes;var g,f=this;if(f.index=V.length,V.push(f),ab++,d.reflow!==!1&&K(f,"load",function(){f.initReflow()}),e)for(g in e)K(f,g,e[g]);f.xAxis=[],f.yAxis=[],f.animation=fa?!1:m(d.animation,!0),f.pointCount=0,f.counters=new Bb,f.firstRender()},initSeries:function(a){var b=this.options.chart;return(b=F[a.type||b.type||b.defaultSeriesType])||ra(17,!0),b=new b,b.init(this,a),b},isInsidePlot:function(a,b,c){var d=c?b:a,a=c?a:b;return d>=0&&d<=this.plotWidth&&a>=0&&a<=this.plotHeight},adjustTickAmounts:function(){this.options.chart.alignTicks!==!1&&p(this.axes,function(a){a.adjustTickAmount()}),this.maxTicks=null},redraw:function(a){var g,h,b=this.axes,c=this.series,d=this.pointer,e=this.legend,f=this.isDirtyLegend,i=this.isDirtyBox,j=c.length,k=j,l=this.renderer,o=l.isHidden(),n=[];for(Qa(a,this),o&&this.cloneRenderTo(),this.layOutTitles();k--;)if(a=c[k],a.options.stacking&&(g=!0,a.isDirty)){h=!0;break}if(h)for(k=j;k--;)a=c[k],a.options.stacking&&(a.isDirty=!0);p(c,function(a){a.isDirty&&"point"===a.options.legendType&&(f=!0)}),f&&e.options.enabled&&(e.render(),this.isDirtyLegend=!1),g&&this.getStacks(),this.hasCartesianSeries&&(this.isResizing||(this.maxTicks=null,p(b,function(a){a.setScale()})),this.adjustTickAmounts(),this.getMargins(),p(b,function(a){a.isDirty&&(i=!0)}),p(b,function(a){a.isDirtyExtremes&&(a.isDirtyExtremes=!1,n.push(function(){D(a,"afterSetExtremes",q(a.eventArgs,a.getExtremes())),delete a.eventArgs})),(i||g)&&a.redraw()})),i&&this.drawChartBox(),p(c,function(a){a.isDirty&&a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()}),d&&d.reset(!0),l.draw(),D(this,"redraw"),o&&this.cloneRenderTo(!0),p(n,function(a){a.call()})},get:function(a){var d,e,b=this.axes,c=this.series;for(d=0;d<b.length;d++)if(b[d].options.id===a)return b[d];for(d=0;d<c.length;d++)if(c[d].options.id===a)return c[d];for(d=0;d<c.length;d++)for(e=c[d].points||[],b=0;b<e.length;b++)if(e[b].id===a)return e[b];return null},getAxes:function(){var a=this,b=this.options,c=b.xAxis=qa(b.xAxis||{}),b=b.yAxis=qa(b.yAxis||{});p(c,function(a,b){a.index=b,a.isX=!0}),p(b,function(a,b){a.index=b}),c=c.concat(b),p(c,function(b){new la(a,b)}),a.adjustTickAmounts()},getSelectedPoints:function(){var a=[];return p(this.series,function(b){a=a.concat(vb(b.points||[],function(a){return a.selected}))}),a},getSelectedSeries:function(){return vb(this.series,function(a){return a.selected})},getStacks:function(){var a=this;p(a.yAxis,function(a){a.stacks&&a.hasVisibleSeries&&(a.oldStacks=a.stacks)}),p(a.series,function(b){!b.options.stacking||b.visible!==!0&&a.options.chart.ignoreHiddenSeries!==!1||(b.stackKey=b.type+m(b.options.stack,""))})},setTitle:function(a,b,c){var g,f,d=this,e=d.options;f=e.title=w(e.title,a),g=e.subtitle=w(e.subtitle,b),e=g,p([["title",a,f],["subtitle",b,e]],function(a){var b=a[0],c=d[b],e=a[1],a=a[2];c&&e&&(d[b]=c=c.destroy()),a&&a.text&&!c&&(d[b]=d.renderer.text(a.text,0,0,a.useHTML).attr({align:a.align,"class":"highcharts-"+b,zIndex:a.zIndex||4}).css(a.style).add())}),d.layOutTitles(c)},layOutTitles:function(a){var b=0,c=this.title,d=this.subtitle,e=this.options,f=e.title,e=e.subtitle,g=this.spacingBox.width-44;!c||(c.css({width:(f.width||g)+"px"}).align(q({y:15},f),!1,"spacingBox"),f.floating||f.verticalAlign)||(b=c.getBBox().height),d&&(d.css({width:(e.width||g)+"px"}).align(q({y:b+f.margin},e),!1,"spacingBox"),!e.floating&&!e.verticalAlign&&(b=Ka(b+d.getBBox().height))),c=this.titleOffset!==b,this.titleOffset=b,!this.isDirtyBox&&c&&(this.isDirtyBox=c,this.hasRendered&&m(a,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var a=this.options.chart,b=a.width,a=a.height,c=this.renderToClone||this.renderTo;r(b)||(this.containerWidth=jb(c,"width")),r(a)||(this.containerHeight=jb(c,"height")),this.chartWidth=v(0,b||this.containerWidth||600),this.chartHeight=v(0,m(a,this.containerHeight>19?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;a?b&&(this.renderTo.appendChild(c),Pa(b),delete this.renderToClone):(c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),G(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),y.body.appendChild(b),c&&b.appendChild(c))
4
+ },getContainer:function(){var a,c,d,e,b=this.options.chart;this.renderTo=a=b.renderTo,e="highcharts-"+tb++,Fa(a)&&(this.renderTo=a=y.getElementById(a)),a||ra(13,!0),c=z(H(a,"data-highcharts-chart")),!isNaN(c)&&V[c]&&V[c].hasRendered&&V[c].destroy(),H(a,"data-highcharts-chart",this.index),a.innerHTML="",!b.skipClone&&!a.offsetWidth&&this.cloneRenderTo(),this.getChartSize(),c=this.chartWidth,d=this.chartHeight,this.container=a=Y(Ja,{className:"highcharts-container"+(b.className?" "+b.className:""),id:e},q({position:"relative",overflow:"hidden",width:c+"px",height:d+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},b.style),this.renderToClone||a),this._cursor=a.style.cursor,this.renderer=b.forExport?new ta(a,c,d,b.style,!0):new Za(a,c,d,b.style),fa&&this.renderer.create(this,a,c,d)},getMargins:function(){var b,a=this.spacing,c=this.legend,d=this.margin,e=this.options.legend,f=m(e.margin,20),g=e.x,h=e.y,i=e.align,j=e.verticalAlign,k=this.titleOffset;this.resetMargins(),b=this.axisOffset,k&&!r(d[0])&&(this.plotTop=v(this.plotTop,k+this.options.title.margin+a[0])),c.display&&!e.floating&&("right"===i?r(d[1])||(this.marginRight=v(this.marginRight,c.legendWidth-g+f+a[1])):"left"===i?r(d[3])||(this.plotLeft=v(this.plotLeft,c.legendWidth+g+f+a[3])):"top"===j?r(d[0])||(this.plotTop=v(this.plotTop,c.legendHeight+h+f+a[0])):"bottom"!==j||r(d[2])||(this.marginBottom=v(this.marginBottom,c.legendHeight-h+f+a[2]))),this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin),this.extraTopMargin&&(this.plotTop+=this.extraTopMargin),this.hasCartesianSeries&&p(this.axes,function(a){a.getOffset()}),r(d[3])||(this.plotLeft+=b[3]),r(d[0])||(this.plotTop+=b[0]),r(d[2])||(this.marginBottom+=b[2]),r(d[1])||(this.marginRight+=b[1]),this.setChartSize()},reflow:function(a){var b=this,c=b.options.chart,d=b.renderTo,e=c.width||jb(d,"width"),f=c.height||jb(d,"height"),c=a?a.target:I,d=function(){b.container&&(b.setSize(e,f,!1),b.hasUserSize=null)};b.hasUserSize||!e||!f||c!==I&&c!==y||((e!==b.containerWidth||f!==b.containerHeight)&&(clearTimeout(b.reflowTimeout),a?b.reflowTimeout=setTimeout(d,100):d()),b.containerWidth=e,b.containerHeight=f)},initReflow:function(){var a=this,b=function(b){a.reflow(b)};K(I,"resize",b),K(a,"destroy",function(){W(I,"resize",b)})},setSize:function(a,b,c){var e,f,g,d=this;d.isResizing+=1,g=function(){d&&D(d,"endResize",null,function(){d.isResizing-=1})},Qa(c,d),d.oldChartHeight=d.chartHeight,d.oldChartWidth=d.chartWidth,r(a)&&(d.chartWidth=e=v(0,u(a)),d.hasUserSize=!!e),r(b)&&(d.chartHeight=f=v(0,u(b))),(va?kb:G)(d.container,{width:e+"px",height:f+"px"},va),d.setChartSize(!0),d.renderer.setSize(e,f,c),d.maxTicks=null,p(d.axes,function(a){a.isDirty=!0,a.setScale()}),p(d.series,function(a){a.isDirty=!0}),d.isDirtyLegend=!0,d.isDirtyBox=!0,d.layOutTitles(),d.getMargins(),d.redraw(c),d.oldChartHeight=null,D(d,"resize"),va===!1?g():setTimeout(g,va&&va.duration||500)},setChartSize:function(a){var i,j,k,l,b=this.inverted,c=this.renderer,d=this.chartWidth,e=this.chartHeight,f=this.options.chart,g=this.spacing,h=this.clipOffset;this.plotLeft=i=u(this.plotLeft),this.plotTop=j=u(this.plotTop),this.plotWidth=k=v(0,u(d-i-this.marginRight)),this.plotHeight=l=v(0,u(e-j-this.marginBottom)),this.plotSizeX=b?l:k,this.plotSizeY=b?k:l,this.plotBorderWidth=f.plotBorderWidth||0,this.spacingBox=c.spacingBox={x:g[3],y:g[0],width:d-g[3]-g[1],height:e-g[0]-g[2]},this.plotBox=c.plotBox={x:i,y:j,width:k,height:l},d=2*T(this.plotBorderWidth/2),b=Ka(v(d,h[3])/2),c=Ka(v(d,h[0])/2),this.clipBox={x:b,y:c,width:T(this.plotSizeX-v(d,h[1])/2-b),height:T(this.plotSizeY-v(d,h[2])/2-c)},a||p(this.axes,function(a){a.setAxisSize(),a.setAxisTranslation()})},resetMargins:function(){var a=this.spacing,b=this.margin;this.plotTop=m(b[0],a[0]),this.marginRight=m(b[1],a[1]),this.marginBottom=m(b[2],a[2]),this.plotLeft=m(b[3],a[3]),this.axisOffset=[0,0,0,0],this.clipOffset=[0,0,0,0]},drawChartBox:function(){var n,a=this.options.chart,b=this.renderer,c=this.chartWidth,d=this.chartHeight,e=this.chartBackground,f=this.plotBackground,g=this.plotBorder,h=this.plotBGImage,i=a.borderWidth||0,j=a.backgroundColor,k=a.plotBackgroundColor,l=a.plotBackgroundImage,o=a.plotBorderWidth||0,s=this.plotLeft,m=this.plotTop,p=this.plotWidth,q=this.plotHeight,r=this.plotBox,v=this.clipRect,u=this.clipBox;n=i+(a.shadow?8:0),(i||j)&&(e?e.animate(e.crisp({width:c-n,height:d-n})):(e={fill:j||Q},i&&(e.stroke=a.borderColor,e["stroke-width"]=i),this.chartBackground=b.rect(n/2,n/2,c-n,d-n,a.borderRadius,i).attr(e).addClass("highcharts-background").add().shadow(a.shadow))),k&&(f?f.animate(r):this.plotBackground=b.rect(s,m,p,q,0).attr({fill:k}).add().shadow(a.plotShadow)),l&&(h?h.animate(r):this.plotBGImage=b.image(l,s,m,p,q).add()),v?v.animate({width:u.width,height:u.height}):this.clipRect=b.clipRect(u),o&&(g?g.animate(g.crisp({x:s,y:m,width:p,height:q})):this.plotBorder=b.rect(s,m,p,q,0,-o).attr({stroke:a.plotBorderColor,"stroke-width":o,fill:Q,zIndex:1}).add()),this.isDirtyBox=!1},propFromSeries:function(){var c,e,f,a=this,b=a.options.chart,d=a.options.series;p(["inverted","angular","polar"],function(g){for(c=F[b.type||b.defaultSeriesType],f=a[g]||b[g]||c&&c.prototype[g],e=d&&d.length;!f&&e--;)(c=F[d[e].type])&&c.prototype[g]&&(f=!0);a[g]=f})},linkSeries:function(){var a=this,b=a.series;p(b,function(a){a.linkedSeries.length=0}),p(b,function(b){var d=b.options.linkedTo;Fa(d)&&(d=":previous"===d?a.series[b.index-1]:a.get(d))&&(d.linkedSeries.push(b),b.linkedParent=d)})},renderSeries:function(){p(this.series,function(a){a.translate(),a.setTooltipPoints&&a.setTooltipPoints(),a.render()})},render:function(){var g,a=this,b=a.axes,c=a.renderer,d=a.options,e=d.labels,f=d.credits;a.setTitle(),a.legend=new lb(a,d.legend),a.getStacks(),p(b,function(a){a.setScale()}),a.getMargins(),a.maxTicks=null,p(b,function(a){a.setTickPositions(!0),a.setMaxTicks()}),a.adjustTickAmounts(),a.getMargins(),a.drawChartBox(),a.hasCartesianSeries&&p(b,function(a){a.render()}),a.seriesGroup||(a.seriesGroup=c.g("series-group").attr({zIndex:3}).add()),a.renderSeries(),e.items&&p(e.items,function(b){var d=q(e.style,b.style),f=z(d.left)+a.plotLeft,g=z(d.top)+a.plotTop+12;delete d.left,delete d.top,c.text(b.html,f,g).attr({zIndex:2}).css(d).add()}),f.enabled&&!a.credits&&(g=f.href,a.credits=c.text(f.text,0,0).on("click",function(){g&&(location.href=g)}).attr({align:f.position.align,zIndex:8}).css(f.style).add().align(f.position)),a.hasRendered=!0},destroy:function(){var e,a=this,b=a.axes,c=a.series,d=a.container,f=d&&d.parentNode;for(D(a,"destroy"),V[a.index]=t,ab--,a.renderTo.removeAttribute("data-highcharts-chart"),W(a),e=b.length;e--;)b[e]=b[e].destroy();for(e=c.length;e--;)c[e]=c[e].destroy();p("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(b){var c=a[b];c&&c.destroy&&(a[b]=c.destroy())}),d&&(d.innerHTML="",W(d),f&&Pa(d));for(e in a)delete a[e]},isReadyToRender:function(){var a=this;return!aa&&I==I.top&&"complete"!==y.readyState||fa&&!I.canvg?(fa?Lb.push(function(){a.firstRender()},a.options.global.canvasToolsURL):y.attachEvent("onreadystatechange",function(){y.detachEvent("onreadystatechange",a.firstRender),"complete"===y.readyState&&a.firstRender()}),!1):!0},firstRender:function(){var a=this,b=a.options,c=a.callback;a.isReadyToRender()&&(a.getContainer(),D(a,"init"),a.resetMargins(),a.setChartSize(),a.propFromSeries(),a.getAxes(),p(b.series||[],function(b){a.initSeries(b)}),a.linkSeries(),D(a,"beforeRender"),R.Pointer&&(a.pointer=new Wa(a,b)),a.render(),a.renderer.draw(),c&&c.apply(a,[a]),p(a.callbacks,function(b){b.apply(a,[a])}),a.cloneRenderTo(!0),D(a,"load"))},splashArray:function(a,b){var c=b[a],c=ca(c)?c:[c,c,c,c];return[m(b[a+"Top"],c[0]),m(b[a+"Right"],c[1]),m(b[a+"Bottom"],c[2]),m(b[a+"Left"],c[3])]}},Ya.prototype.callbacks=[],X=R.CenteredSeriesMixin={getCenter:function(){var d,h,a=this.options,b=this.chart,c=2*(a.slicedOffset||0),e=b.plotWidth-2*c,f=b.plotHeight-2*c,b=a.center,a=[m(b[0],"50%"),m(b[1],"50%"),a.size||"100%",a.innerSize||0],g=C(e,f);return Ua(a,function(a,b){return h=/%$/.test(a),d=2>b||2===b&&h,(h?[e,f,g,g][b]*z(a)/100:a)+(d?c:0)})}};var Ea=function(){};Ea.prototype={init:function(a,b,c){return this.series=a,this.applyOptions(b,c),this.pointAttr={},a.options.colorByPoint&&(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter++],a.colorCounter===b.length)&&(a.colorCounter=0),a.chart.pointCount++,this},applyOptions:function(a,b){var c=this.series,d=c.pointValKey,a=Ea.prototype.optionsToObject.call(this,a);return q(this,a),this.options=this.options?q(this.options,a):a,d&&(this.y=this[d]),this.x===t&&c&&(this.x=b===t?c.autoIncrement():b),this},optionsToObject:function(a){var b={},c=this.series,d=c.pointArrayMap||["y"],e=d.length,f=0,g=0;if("number"==typeof a||null===a)b[d[0]]=a;else if(La(a))for(a.length>e&&(c=typeof a[0],"string"===c?b.name=a[0]:"number"===c&&(b.x=a[0]),f++);e>g;)b[d[g++]]=a[f++];else"object"==typeof a&&(b=a,a.dataLabels&&(c._hasPointLabels=!0),a.marker&&(c._hasPointMarkers=!0));return b},destroy:function(){var c,a=this.series.chart,b=a.hoverPoints;a.pointCount--,b&&(this.setState(),ja(b,this),!b.length)&&(a.hoverPoints=null),this===a.hoverPoint&&this.onMouseOut(),(this.graphic||this.dataLabel)&&(W(this),this.destroyElements()),this.legendItem&&a.legend.destroyItem(this);for(c in this)this[c]=null},destroyElements:function(){for(var b,a="graphic,dataLabel,dataLabelUpper,group,connector,shadowGroup".split(","),c=6;c--;)b=a[c],this[b]&&(this[b]=this[b].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(a){var b=this.series,c=b.tooltipOptions,d=m(c.valueDecimals,""),e=c.valuePrefix||"",f=c.valueSuffix||"";return p(b.pointArrayMap||["y"],function(b){b="{point."+b,(e||f)&&(a=a.replace(b+"}",e+b+"}"+f)),a=a.replace(b+"}",b+":,."+d+"f}")}),Ia(a,{point:this,series:this.series})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])&&this.importEvents(),"click"===a&&e.allowPointSelect&&(c=function(a){d.select(null,a.ctrlKey||a.metaKey||a.shiftKey)}),D(this,a,b,c)}};var O=function(){};O.prototype={isCartesian:!0,type:"line",pointClass:Ea,sorted:!0,requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],init:function(a,b){var d,e,c=this,f=a.series,g=function(a,b){return m(a.options.index,a._i)-m(b.options.index,b._i)};c.chart=a,c.options=b=c.setOptions(b),c.linkedSeries=[],c.bindAxes(),q(c,{name:b.name,state:"",pointAttr:{},visible:b.visible!==!1,selected:b.selected===!0}),fa&&(b.animation=!1),e=b.events;for(d in e)K(c,d,e[d]);(e&&e.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)&&(a.runTrackerClick=!0),c.getColor(),c.getSymbol(),p(c.parallelArrays,function(a){c[a+"Data"]=[]}),c.setData(b.data,!1),c.isCartesian&&(a.hasCartesianSeries=!0),f.push(c),c._i=f.length-1,ob(f,g),this.yAxis&&ob(this.yAxis.series,g),p(f,function(a,b){a.index=b,a.name=a.name||"Series "+(b+1)})},bindAxes:function(){var d,a=this,b=a.options,c=a.chart;p(a.axisTypes||[],function(e){p(c[e],function(c){d=c.options,(b[e]===d.index||b[e]!==t&&b[e]===d.id||b[e]===t&&0===d.index)&&(c.series.push(a),a[e]=c,c.isDirty=!0)}),!a[e]&&a.optionalAxis!==e&&ra(18,!0)})},updateParallelArrays:function(a,b){var c=a.series,d=arguments;p(c.parallelArrays,"number"==typeof b?function(d){var f="y"===d&&c.toYData?c.toYData(a):a[d];c[d+"Data"][b]=f}:function(a){Array.prototype[b].apply(c[a+"Data"],Array.prototype.slice.call(d,2))})},autoIncrement:function(){var a=this.options,b=this.xIncrement,b=m(b,a.pointStart,0);return this.pointInterval=m(this.pointInterval,a.pointInterval,1),this.xIncrement=b+this.pointInterval,b},getSegments:function(){var c,a=-1,b=[],d=this.points,e=d.length;if(e)if(this.options.connectNulls){for(c=e;c--;)null===d[c].y&&d.splice(c,1);d.length&&(b=[d])}else p(d,function(c,g){null===c.y?(g>a+1&&b.push(d.slice(a+1,g)),a=g):g===e-1&&b.push(d.slice(a+1,g+1))});this.segments=b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},d=b.plotOptions||{},e=c[this.type];return this.userOptions=a,c=w(e,c.series,a),this.tooltipOptions=w(E.tooltip,E.plotOptions[this.type].tooltip,b.tooltip,d.series&&d.series.tooltip,d[this.type]&&d[this.type].tooltip,a.tooltip),null===e.marker&&delete c.marker,c},getColor:function(){var e,a=this.options,b=this.userOptions,c=this.chart.options.colors,d=this.chart.counters;e=a.color||ba[this.type].color,e||a.colorByPoint||(r(b._colorIndex)?a=b._colorIndex:(b._colorIndex=d.color,a=d.color++),e=c[a]),this.color=e,d.wrapColor(c.length)},getSymbol:function(){var a=this.userOptions,b=this.options.marker,c=this.chart,d=c.options.symbols,c=c.counters;this.symbol=b.symbol,this.symbol||(r(a._symbolIndex)?a=a._symbolIndex:(a._symbolIndex=c.symbol,a=c.symbol++),this.symbol=d[a]),/^url/.test(this.symbol)&&(b.radius=0),c.wrapSymbol(d.length)},drawLegendSymbol:N.drawLineMarker,setData:function(a,b,c,d){var h,e=this,f=e.points,g=f&&f.length||0,i=e.options,j=e.chart,k=null,l=e.xAxis,o=l&&!!l.categories,n=e.tooltipPoints,s=i.turboThreshold,q=this.xData,r=this.yData,v=(h=e.pointArrayMap)&&h.length,a=a||[];if(h=a.length,b=m(b,!0),d===!1||!h||g!==h||e.cropped||e.hasGroupedData){if(e.xIncrement=null,e.pointRange=o?1:i.pointRange,e.colorCounter=0,p(this.parallelArrays,function(a){e[a+"Data"].length=0}),s&&h>s){for(c=0;null===k&&h>c;)k=a[c],c++;if(ha(k)){for(o=m(i.pointStart,0),i=m(i.pointInterval,1),c=0;h>c;c++)q[c]=o,r[c]=a[c],o+=i;e.xIncrement=o}else if(La(k))if(v)for(c=0;h>c;c++)i=a[c],q[c]=i[0],r[c]=i.slice(1,v+1);else for(c=0;h>c;c++)i=a[c],q[c]=i[0],r[c]=i[1];else ra(12)}else for(c=0;h>c;c++)a[c]!==t&&(i={series:e},e.pointClass.prototype.applyOptions.apply(i,[a[c]]),e.updateParallelArrays(i,c),o&&i.name)&&(l.names[i.x]=i.name);for(Fa(r[0])&&ra(14,!0),e.data=[],e.options.data=a,c=g;c--;)f[c]&&f[c].destroy&&f[c].destroy();n&&(n.length=0),l&&(l.minRange=l.userMinRange),e.isDirty=e.isDirtyData=j.isDirtyBox=!0,c=!1}else p(a,function(a,b){f[b].update(a,!1)});b&&j.redraw(c)},processData:function(a){var e,b=this.xData,c=this.yData,d=b.length;e=0;var f,g,o,n,h=this.xAxis,i=this.options,j=i.cropThreshold,k=0,l=this.isCartesian;if(l&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!a)return!1;for(l&&this.sorted&&(!j||d>j||this.forceCrop)&&(o=h.min,n=h.max,b[d-1]<o||b[0]>n?(b=[],c=[]):(b[0]<o||b[d-1]>n)&&(e=this.cropData(this.xData,this.yData,o,n),b=e.xData,c=e.yData,e=e.start,f=!0,k=b.length)),d=b.length-1;d>=0;d--)a=b[d]-b[d-1],!f&&b[d]>o&&b[d]<n&&k++,a>0&&(g===t||g>a)?g=a:0>a&&this.requireSorting&&ra(15);this.cropped=f,this.cropStart=e,this.processedXData=b,this.processedYData=c,this.activePointCount=k,null===i.pointRange&&(this.pointRange=g||1),this.closestPointRange=g},cropData:function(a,b,c,d){var i,e=a.length,f=0,g=e,h=m(this.cropShoulder,1);for(i=0;e>i;i++)if(a[i]>=c){f=v(0,i-h);break}for(;e>i;i++)if(a[i]>d){g=i+h;break}return{xData:a.slice(f,g),yData:b.slice(f,g),start:f,end:g}},generatePoints:function(){var c,i,k,o,a=this.options.data,b=this.data,d=this.processedXData,e=this.processedYData,f=this.pointClass,g=d.length,h=this.cropStart||0,j=this.hasGroupedData,l=[];for(b||j||(b=[],b.length=a.length,b=this.data=b),o=0;g>o;o++)i=h+o,j?l[o]=(new f).init(this,[d[o]].concat(qa(e[o]))):(b[i]?k=b[i]:a[i]!==t&&(b[i]=k=(new f).init(this,a[i],d[o])),l[o]=k);if(b&&(g!==(c=b.length)||j))for(o=0;c>o;o++)o===h&&!j&&(o+=g),b[o]&&(b[o].destroyElements(),b[o].plotX=t);this.data=b,this.points=l},getExtremes:function(a){var d,b=this.yAxis,c=this.processedXData,e=[],f=0;d=this.xAxis.getExtremes();var i,j,k,l,g=d.min,h=d.max,a=a||this.stackedYData||this.processedYData;for(d=a.length,l=0;d>l;l++)if(j=c[l],k=a[l],i=null!==k&&k!==t&&(!b.isLog||k.length||k>0),j=this.getExtremesFromAll||this.cropped||(c[l+1]||j)>=g&&(c[l-1]||j)<=h,i&&j)if(i=k.length)for(;i--;)null!==k[i]&&(e[f++]=k[i]);else e[f++]=k;this.dataMin=m(void 0,Na(e)),this.dataMax=m(void 0,Ba(e))},translate:function(){this.processedXData||this.processData(),this.generatePoints();for(var a=this.options,b=a.stacking,c=this.xAxis,d=c.categories,e=this.yAxis,f=this.points,g=f.length,h=!!this.modifyValue,i=a.pointPlacement,j="between"===i||ha(i),k=a.threshold,a=0;g>a;a++){var l=f[a],o=l.x,n=l.y,s=l.low,p=b&&e.stacks[(this.negStacks&&k>n?"-":"")+this.stackKey];e.isLog&&0>=n&&(l.y=n=null),l.plotX=c.translate(o,0,0,0,1,i,"flags"===this.type),b&&this.visible&&p&&p[o]&&(p=p[o],n=p.points[this.index+","+a],s=n[0],n=n[1],0===s&&(s=m(k,e.min)),e.isLog&&0>=s&&(s=null),l.total=l.stackTotal=p.total,l.percentage=p.total&&l.y/p.total*100,l.stackY=n,p.setOffset(this.pointXOffset||0,this.barW||0)),l.yBottom=r(s)?e.translate(s,0,1,0,1):null,h&&(n=this.modifyValue(n,l)),l.plotY="number"==typeof n&&1/0!==n?e.translate(n,0,1,0,1):t,l.clientX=j?c.translate(o,0,0,0,1):l.plotX,l.negative=l.y<(k||0),l.category=d&&d[l.x]!==t?d[l.x]:l.x}this.getSegments()},animate:function(a){var d,b=this.chart,c=b.renderer;d=this.options.animation;var g,e=this.clipBox||b.clipBox,f=b.inverted;d&&!ca(d)&&(d=ba[this.type].animation),g=["_sharedClip",d.duration,d.easing,e.height].join(","),a?(a=b[g],d=b[g+"m"],a||(b[g]=a=c.clipRect(q(e,{width:0})),b[g+"m"]=d=c.clipRect(-99,f?-b.plotLeft:-b.plotTop,99,f?b.chartWidth:b.chartHeight)),this.group.clip(a),this.markerGroup.clip(d),this.sharedClipKey=g):((a=b[g])&&a.animate({width:b.plotSizeX},d),b[g+"m"]&&b[g+"m"].animate({width:b.plotSizeX+99},d),this.animate=null)},afterAnimate:function(){var a=this.chart,b=this.sharedClipKey,c=this.group,d=this.clipBox;c&&this.options.clip!==!1&&(b&&d||c.clip(d?a.renderer.clipRect(d):a.clipRect),this.markerGroup.clip()),D(this,"afterAnimate"),setTimeout(function(){b&&a[b]&&(d||(a[b]=a[b].destroy()),a[b+"m"]&&(a[b+"m"]=a[b+"m"].destroy()))},100)},drawPoints:function(){var a,d,e,f,g,h,i,j,k,b=this.points,c=this.chart;d=this.options.marker;var o,l=this.pointAttr[""],n=this.markerGroup,s=m(d.enabled,this.activePointCount<.5*this.xAxis.len/d.radius);if(d.enabled!==!1||this._hasPointMarkers)for(f=b.length;f--;)g=b[f],d=T(g.plotX),e=g.plotY,k=g.graphic,i=g.marker||{},a=s&&i.enabled===t||i.enabled,o=c.isInsidePlot(u(d),e,c.inverted),a&&e!==t&&!isNaN(e)&&null!==g.y?(a=g.pointAttr[g.selected?"select":""]||l,h=a.r,i=m(i.symbol,this.symbol),j=0===i.indexOf("url"),k?k[o?"show":"hide"](!0).animate(q({x:d-h,y:e-h},k.symbolName?{width:2*h,height:2*h}:{})):o&&(h>0||j)&&(g.graphic=c.renderer.symbol(i,d-h,e-h,2*h,2*h).attr(a).add(n))):k&&(g.graphic=k.destroy())},convertAttribs:function(a,b,c,d){var f,g,e=this.pointAttrToOptions,h={},a=a||{},b=b||{},c=c||{},d=d||{};for(f in e)g=e[f],h[f]=m(a[g],b[f],c[f],d[f]);return h},getAttribs:function(){var f,a=this,b=a.options,c=ba[a.type].marker?b.marker:b,d=c.states,e=d.hover,g=a.color;f={stroke:g,fill:g};var i,k,h=a.points||[],j=[],l=a.pointAttrToOptions;k=a.hasPointSpecificOptions;var o=b.negativeColor,n=c.lineColor,s=c.fillColor;i=b.turboThreshold;var m;if(b.marker?(e.radius=e.radius||c.radius+2,e.lineWidth=e.lineWidth||c.lineWidth+1):e.color=e.color||ya(e.color||g).brighten(e.brightness).get(),j[""]=a.convertAttribs(c,f),p(["hover","select"],function(b){j[b]=a.convertAttribs(d[b],j[""])}),a.pointAttr=j,g=h.length,!i||i>g||k)for(;g--;){if(i=h[g],(c=i.options&&i.options.marker||i.options)&&c.enabled===!1&&(c.radius=0),i.negative&&o&&(i.color=i.fillColor=o),k=b.colorByPoint||i.color,i.options)for(m in l)r(c[l[m]])&&(k=!0);k?(c=c||{},k=[],d=c.states||{},f=d.hover=d.hover||{},b.marker||(f.color=f.color||!i.options.color&&e.color||ya(i.color).brighten(f.brightness||e.brightness).get()),f={color:i.color},s||(f.fillColor=i.color),n||(f.lineColor=i.color),k[""]=a.convertAttribs(q(f,c),j[""]),k.hover=a.convertAttribs(d.hover,j.hover,k[""]),k.select=a.convertAttribs(d.select,j.select,k[""])):k=j,i.pointAttr=k}},destroy:function(){var d,e,g,h,i,a=this,b=a.chart,c=/AppleWebKit\/533/.test(wa),f=a.data||[];for(D(a,"destroy"),W(a),p(a.axisTypes||[],function(b){(i=a[b])&&(ja(i.series,a),i.isDirty=i.forceRedraw=!0)}),a.legendItem&&a.chart.legend.destroyItem(a),e=f.length;e--;)(g=f[e])&&g.destroy&&g.destroy();a.points=null,clearTimeout(a.animationTimeout),p("area,graph,dataLabelsGroup,group,markerGroup,tracker,graphNeg,areaNeg,posClip,negClip".split(","),function(b){a[b]&&(d=c&&"group"===b?"hide":"destroy",a[b][d]())}),b.hoverSeries===a&&(b.hoverSeries=null),ja(b.series,a);for(h in a)delete a[h]},getSegmentPath:function(a){var b=this,c=[],d=b.options.step;return p(a,function(e,f){var i,g=e.plotX,h=e.plotY;b.getPointSpline?c.push.apply(c,b.getPointSpline(a,e,f)):(c.push(f?"L":"M"),d&&f&&(i=a[f-1],"right"===d?c.push(i.plotX,h):"center"===d?c.push((i.plotX+g)/2,i.plotY,(i.plotX+g)/2,h):c.push(g,i.plotY)),c.push(e.plotX,e.plotY))}),c},getGraphPath:function(){var c,a=this,b=[],d=[];return p(a.segments,function(e){c=a.getSegmentPath(e),e.length>1?b=b.concat(c):d.push(e[0])}),a.singlePoints=d,a.graphPath=b},drawGraph:function(){var a=this,b=this.options,c=[["graph",b.lineColor||this.color]],d=b.lineWidth,e=b.dashStyle,f="square"!==b.linecap,g=this.getGraphPath(),h=b.negativeColor;h&&c.push(["graphNeg",h]),p(c,function(c,h){var k=c[0],l=a[k];l?(bb(l),l.animate({d:g})):d&&g.length&&(l={stroke:c[1],"stroke-width":d,fill:Q,zIndex:1},e?l.dashstyle=e:f&&(l["stroke-linecap"]=l["stroke-linejoin"]="round"),a[k]=a.chart.renderer.path(g).attr(l).add(a.group).shadow(!h&&b.shadow))})},clipNeg:function(){var e,a=this.options,b=this.chart,c=b.renderer,d=a.negativeColor||a.negativeFillColor,f=this.graph,g=this.area,h=this.posClip,i=this.negClip;e=b.chartWidth;var j=b.chartHeight,k=v(e,j),l=this.yAxis;d&&(f||g)&&(d=u(l.toPixels(a.threshold||0,!0)),0>d&&(k-=d),a={x:0,y:0,width:k,height:d},k={x:0,y:d,width:k,height:k},b.inverted&&(a.height=k.y=b.plotWidth-d,c.isVML&&(a={x:b.plotWidth-d-b.plotLeft,y:0,width:e,height:j},k={x:d+b.plotLeft-e,y:0,width:b.plotLeft+d,height:e})),l.reversed?(b=k,e=a):(b=a,e=k),h?(h.animate(b),i.animate(e)):(this.posClip=h=c.clipRect(b),this.negClip=i=c.clipRect(e),f&&this.graphNeg&&(f.clip(h),this.graphNeg.clip(i)),g&&(g.clip(h),this.areaNeg.clip(i))))},invertGroups:function(){function a(){var a={width:b.yAxis.len,height:b.xAxis.len};p(["group","markerGroup"],function(c){b[c]&&b[c].attr(a).invert()})}var b=this,c=b.chart;b.xAxis&&(K(c,"resize",a),K(b,"destroy",function(){W(c,"resize",a)}),a(),b.invertGroups=a)},plotGroup:function(a,b,c,d,e){var f=this[a],g=!f;return g&&(this[a]=f=this.chart.renderer.g(b).attr({visibility:c,zIndex:d||.1}).add(e)),f[g?"attr":"animate"](this.getPlotBox()),f},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;return a.inverted&&(b=c,c=this.xAxis),{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var c,a=this,b=a.chart,d=a.options,e=(c=d.animation)&&!!a.animate&&b.renderer.isSVG&&m(c.duration,500)||0,f=a.visible?"visible":"hidden",g=d.zIndex,h=a.hasRendered,i=b.seriesGroup;c=a.plotGroup("group","series",f,g,i),a.markerGroup=a.plotGroup("markerGroup","markers",f,g,i),e&&a.animate(!0),a.getAttribs(),c.inverted=a.isCartesian?b.inverted:!1,a.drawGraph&&(a.drawGraph(),a.clipNeg()),a.drawDataLabels&&a.drawDataLabels(),a.visible&&a.drawPoints(),a.drawTracker&&a.options.enableMouseTracking!==!1&&a.drawTracker(),b.inverted&&a.invertGroups(),d.clip!==!1&&!a.sharedClipKey&&!h&&c.clip(b.clipRect),e&&a.animate(),h||(e?a.animationTimeout=setTimeout(function(){a.afterAnimate()},e):a.afterAnimate()),a.isDirty=a.isDirtyData=!1,a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirtyData,c=this.group,d=this.xAxis,e=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:m(d&&d.left,a.plotLeft),translateY:m(e&&e.top,a.plotTop)})),this.translate(),this.setTooltipPoints&&this.setTooltipPoints(!0),this.render(),b&&D(this,"updatedData")}},Hb.prototype={destroy:function(){Oa(this,this.axis)},render:function(a){var b=this.options,c=b.format,c=c?Ia(c,this):b.formatter.call(this);this.label?this.label.attr({text:c,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(c,null,null,b.useHTML).css(b.style).attr({align:this.textAlign,rotation:b.rotation,visibility:"hidden"}).add(a)},setOffset:function(a,b){var c=this.axis,d=c.chart,e=d.inverted,f=this.isNegative,g=c.translate(c.usePercentage?100:this.total,0,0,0,1),c=c.translate(0),c=M(g-c),h=d.xAxis[0].translate(this.x)+a,i=d.plotHeight,f={x:e?f?g:g-c:h,y:e?i-h-b:f?i-g-c:i-g,width:e?c:b,height:e?b:c};(e=this.label)&&(e.align(this.alignOptions,null,f),f=e.alignAttr,e[this.options.crop===!1||d.isInsidePlot(f.x,f.y)?"show":"hide"](!0))}},la.prototype.buildStacks=function(){var a=this.series,b=m(this.options.reversedStacks,!0),c=a.length;if(!this.isXAxis){for(this.usePercentage=!1;c--;)a[b?c:a.length-c-1].setStackedPoints();if(this.usePercentage)for(c=0;c<a.length;c++)a[c].setPercentStacks()}},la.prototype.renderStackTotals=function(){var d,e,a=this.chart,b=a.renderer,c=this.stacks,f=this.stackTotalGroup;f||(this.stackTotalGroup=f=b.g("stack-labels").attr({visibility:"visible",zIndex:6}).add()),f.translate(a.plotLeft,a.plotTop);for(d in c)for(e in a=c[d])a[e].render(f)},O.prototype.setStackedPoints=function(){if(this.options.stacking&&(this.visible===!0||this.chart.options.chart.ignoreHiddenSeries===!1)){var n,m,p,q,r,u,a=this.processedXData,b=this.processedYData,c=[],d=b.length,e=this.options,f=e.threshold,g=e.stack,e=e.stacking,h=this.stackKey,i="-"+h,j=this.negStacks,k=this.yAxis,l=k.stacks,o=k.oldStacks;for(q=0;d>q;q++)r=a[q],u=b[q],p=this.index+","+q,m=(n=j&&f>u)?i:h,l[m]||(l[m]={}),l[m][r]||(o[m]&&o[m][r]?(l[m][r]=o[m][r],l[m][r].total=null):l[m][r]=new Hb(k,k.options.stackLabels,n,r,g)),m=l[m][r],m.points[p]=[m.cum||0],"percent"===e?(n=n?h:i,j&&l[n]&&l[n][r]?(n=l[n][r],m.total=n.total=v(n.total,m.total)+M(u)||0):m.total=da(m.total+(M(u)||0))):m.total=da(m.total+(u||0)),m.cum=(m.cum||0)+(u||0),m.points[p].push(m.cum),c[q]=m.cum;"percent"===e&&(k.usePercentage=!0),this.stackedYData=c,k.oldStacks={}}},O.prototype.setPercentStacks=function(){var a=this,b=a.stackKey,c=a.yAxis.stacks,d=a.processedXData;p([b,"-"+b],function(b){for(var e,g,h,f=d.length;f--;)g=d[f],e=(h=c[b]&&c[b][g])&&h.points[a.index+","+f],(g=e)&&(h=h.total?100/h.total:0,g[0]=da(g[0]*h),g[1]=da(g[1]*h),a.stackedYData[f]=g[1])})},q(Ya.prototype,{addSeries:function(a,b,c){var d,e=this;return a&&(b=m(b,!0),D(e,"addSeries",{options:a},function(){d=e.initSeries(a),e.isDirtyLegend=!0,e.linkSeries(),b&&e.redraw(c)})),d},addAxis:function(a,b,c,d){var e=b?"xAxis":"yAxis",f=this.options;new la(this,w(a,{index:this[e].length,isX:b})),f[e]=qa(f[e]||{}),f[e].push(a),m(c,!0)&&this.redraw(d)},showLoading:function(a){var b=this.options,c=this.loadingDiv,d=b.loading;c||(this.loadingDiv=c=Y(Ja,{className:"highcharts-loading"},q(d.style,{zIndex:10,display:Q}),this.container),this.loadingSpan=Y("span",null,d.labelStyle,c)),this.loadingSpan.innerHTML=a||b.lang.loading,this.loadingShown||(G(c,{opacity:0,display:"",left:this.plotLeft+"px",top:this.plotTop+"px",width:this.plotWidth+"px",height:this.plotHeight+"px"}),kb(c,{opacity:d.style.opacity},{duration:d.showDuration||0}),this.loadingShown=!0)},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&kb(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){G(b,{display:Q})}}),this.loadingShown=!1}}),q(Ea.prototype,{update:function(a,b,c){var g,d=this,e=d.series,f=d.graphic,h=e.data,i=e.chart,j=e.options,b=m(b,!0);d.firePointEvent("update",{options:a},function(){d.applyOptions(a),ca(a)&&(e.getAttribs(),f&&(a&&a.marker&&a.marker.symbol?d.graphic=f.destroy():f.attr(d.pointAttr[d.state||""])),a&&a.dataLabels&&d.dataLabel&&(d.dataLabel=d.dataLabel.destroy())),g=Da(d,h),e.updateParallelArrays(d,g),j.data[g]=d.options,e.isDirty=e.isDirtyData=!0,!e.fixedBox&&e.hasCartesianSeries&&(i.isDirtyBox=!0),"point"===j.legendType&&i.legend.destroyItem(d),b&&i.redraw(c)})},remove:function(a,b){var g,c=this,d=c.series,e=d.points,f=d.chart,h=d.data;Qa(b,f),a=m(a,!0),c.firePointEvent("remove",null,function(){g=Da(c,h),h.length===e.length&&e.splice(g,1),h.splice(g,1),d.options.data.splice(g,1),d.updateParallelArrays(c,"splice",g,1),c.destroy(),d.isDirty=!0,d.isDirtyData=!0,a&&f.redraw()})}}),q(O.prototype,{addPoint:function(a,b,c,d){var o,e=this.options,f=this.data,g=this.graph,h=this.area,i=this.chart,j=this.xAxis&&this.xAxis.names,k=g&&g.shift||0,l=e.data,n=this.xData;if(Qa(d,i),c&&p([g,h,this.graphNeg,this.areaNeg],function(a){a&&(a.shift=k+1)}),h&&(h.isArea=!0),b=m(b,!0),d={series:this},this.pointClass.prototype.applyOptions.apply(d,[a]),g=d.x,h=n.length,this.requireSorting&&g<n[h-1])for(o=!0;h&&n[h-1]>g;)h--;this.updateParallelArrays(d,"splice",h,0,0),this.updateParallelArrays(d,h),j&&(j[g]=d.name),l.splice(h,0,a),o&&(this.data.splice(h,0,null),this.processData()),"point"===e.legendType&&this.generatePoints(),c&&(f[0]&&f[0].remove?f[0].remove(!1):(f.shift(),this.updateParallelArrays(d,"shift"),l.shift())),this.isDirtyData=this.isDirty=!0,b&&(this.getAttribs(),i.redraw())},remove:function(a,b){var c=this,d=c.chart,a=m(a,!0);c.isRemoving||(c.isRemoving=!0,D(c,"remove",null,function(){c.destroy(),d.isDirtyLegend=d.isDirtyBox=!0,d.linkSeries(),a&&d.redraw(b)})),c.isRemoving=!1},update:function(a,b){var f,c=this.chart,d=this.type,e=F[d].prototype,a=w(this.userOptions,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1);for(f in e)e.hasOwnProperty(f)&&(this[f]=t);q(this,F[a.type||d].prototype),this.init(c,a),m(b,!0)&&c.redraw(!1)}}),q(la.prototype,{update:function(a,b){var c=this.chart,a=c.options[this.coll][this.options.index]=w(this.userOptions,a);this.destroy(!0),this._addedPlotLB=t,this.init(c,q(a,{events:t})),c.isDirtyBox=!0,m(b,!0)&&c.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,d=this.series,e=d.length;e--;)d[e]&&d[e].remove(!1);ja(b.axes,this),ja(b[c],this),b.options[c].splice(this.options.index,1),p(b[c],function(a,b){a.options.index=b}),this.destroy(),b.isDirtyBox=!0,m(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},b)}}),ga=ka(O),F.line=ga,ba.area=w(S,{threshold:0});var pa=ka(O,{type:"area",getSegments:function(){var h,i,l,o,n,a=[],b=[],c=[],d=this.xAxis,e=this.yAxis,f=e.stacks[this.stackKey],g={},j=this.points,k=this.options.connectNulls;if(this.options.stacking&&!this.cropped){for(o=0;o<j.length;o++)g[j[o].x]=j[o];for(n in f)null!==f[n].total&&c.push(+n);c.sort(function(a,b){return a-b}),p(c,function(a){(!k||g[a]&&null!==g[a].y)&&(g[a]?b.push(g[a]):(h=d.translate(a),l=f[a].percent?f[a].total?100*f[a].cum/f[a].total:0:f[a].cum,i=e.toPixels(l,!0),b.push({y:null,plotX:h,clientX:h,plotY:i,yBottom:i,onMouseOver:sa})))}),b.length&&a.push(b)}else O.prototype.getSegments.call(this),a=this.segments;this.segments=a},getSegmentPath:function(a){var d,b=O.prototype.getSegmentPath.call(this,a),c=[].concat(b),e=this.options;d=b.length;var g,f=this.yAxis.getThreshold(e.threshold);if(3===d&&c.push("L",b[1],b[2]),e.stacking&&!this.closedStacks)for(d=a.length-1;d>=0;d--)g=m(a[d].yBottom,f),d<a.length-1&&e.step&&c.push(a[d+1].plotX,g),c.push(a[d].plotX,g);else this.closeSegment(c,a,f);return this.areaPath=this.areaPath.concat(c),b},closeSegment:function(a,b,c){a.push("L",b[b.length-1].plotX,c,"L",b[0].plotX,c)},drawGraph:function(){this.areaPath=[],O.prototype.drawGraph.apply(this);var a=this,b=this.areaPath,c=this.options,d=c.negativeColor,e=c.negativeFillColor,f=[["area",this.color,c.fillColor]];(d||e)&&f.push(["areaNeg",d,e]),p(f,function(d){var e=d[0],f=a[e];f?f.animate({d:b}):a[e]=a.chart.renderer.path(b).attr({fill:m(d[2],ya(d[1]).setOpacity(m(c.fillOpacity,.75)).get()),zIndex:0}).add(a.group)
5
+ })},drawLegendSymbol:N.drawRectangle});F.area=pa,ba.spline=w(S),ga=ka(O,{type:"spline",getPointSpline:function(a,b,c){var h,i,j,k,d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1];if(f&&g){a=f.plotY,j=g.plotX;var l,g=g.plotY;h=(1.5*d+f.plotX)/2.5,i=(1.5*e+a)/2.5,j=(1.5*d+j)/2.5,k=(1.5*e+g)/2.5,l=(k-i)*(j-d)/(j-h)+e-k,i+=l,k+=l,i>a&&i>e?(i=v(a,e),k=2*e-i):a>i&&e>i&&(i=C(a,e),k=2*e-i),k>g&&k>e?(k=v(g,e),i=2*e-k):g>k&&e>k&&(k=C(g,e),i=2*e-k),b.rightContX=j,b.rightContY=k}return c?(b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,i||e,d,e],f.rightContX=f.rightContY=null):b=["M",d,e],b}}),F.spline=ga,ba.areaspline=w(ba.area),pa=pa.prototype,ga=ka(ga,{type:"areaspline",closedStacks:!0,getSegmentPath:pa.getSegmentPath,closeSegment:pa.closeSegment,drawGraph:pa.drawGraph,drawLegendSymbol:N.drawRectangle}),F.areaspline=ga,ba.column=w(S,{borderColor:"#FFFFFF",borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{brightness:.1,shadow:!1,halo:!1},select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}},dataLabels:{align:null,verticalAlign:null,y:null},stickyTracking:!1,tooltip:{distance:6},threshold:0}),ga=ka(O,{type:"column",pointAttrToOptions:{stroke:"borderColor",fill:"color",r:"borderRadius"},cropShoulder:0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){O.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasRendered&&p(b.series,function(b){b.type===a.type&&(b.isDirty=!0)})},getColumnMetrics:function(){var f,h,a=this,b=a.options,c=a.xAxis,d=a.yAxis,e=c.reversed,g={},i=0;b.grouping===!1?i=1:p(a.chart.series,function(b){var c=b.options,e=b.yAxis;b.type===a.type&&b.visible&&d.len===e.len&&d.pos===e.pos&&(c.stacking?(f=b.stackKey,g[f]===t&&(g[f]=i++),h=g[f]):c.grouping!==!1&&(h=i++),b.columnIndex=h)});var c=C(M(c.transA)*(c.ordinalSlope||b.pointRange||c.closestPointRange||c.tickInterval||1),c.len),j=c*b.groupPadding,k=(c-2*j)/i,l=b.pointWidth,b=r(l)?(k-l)/2:k*b.pointPadding,l=m(l,k-2*b);return a.columnMetrics={width:l,offset:b+(j+((e?i-(a.columnIndex||0):a.columnIndex)||0)*k-c/2)*(e?-1:1)}},translate:function(){var a=this,b=a.chart,c=a.options,d=a.borderWidth=m(c.borderWidth,a.activePointCount>.5*a.xAxis.len?0:1),e=a.yAxis,f=a.translatedThreshold=e.getThreshold(c.threshold),g=m(c.minPointLength,5),c=a.getColumnMetrics(),h=c.width,i=a.barW=Ka(v(h,1+2*d)),j=a.pointXOffset=c.offset,k=-(d%2?.5:0),l=d%2?.5:1;b.renderer.isVML&&b.inverted&&(l+=1),O.prototype.translate.apply(a),p(a.points,function(c){var x,d=m(c.yBottom,f),p=C(v(-999-d,c.plotY),e.len+999+d),q=c.plotX+j,r=i,t=C(p,d);x=v(p,d)-t,M(x)<g&&g&&(x=g,t=u(M(t-f)>g?d-g:f-(e.translate(c.y,0,1,0,1)<=f?g:0))),c.barX=q,c.pointWidth=h,c.tooltipPos=b.inverted?[e.len-p,a.xAxis.len-q-r/2]:[q+r/2,p],d=M(q)<.5,r=u(q+r)+k,q=u(q)+k,r-=q,p=M(t)<.5,x=u(t+x)+l,t=u(t)+l,x-=t,d&&(q+=1,r-=1),p&&(t-=1,x+=1),c.shapeType="rect",c.shapeArgs={x:q,y:t,width:r,height:x}})},getSymbol:sa,drawLegendSymbol:N.drawRectangle,drawGraph:sa,drawPoints:function(){var f,g,h,a=this,b=this.chart,c=a.options,d=b.renderer,e=c.animationLimit||250;p(a.points,function(i){var j=i.plotY,k=i.graphic;j===t||isNaN(j)||null===i.y?k&&(i.graphic=k.destroy()):(f=i.shapeArgs,h=r(a.borderWidth)?{"stroke-width":a.borderWidth}:{},g=i.pointAttr[i.selected?"select":""]||a.pointAttr[""],k?(bb(k),k.attr(h)[b.pointCount<e?"animate":"attr"](w(f))):i.graphic=d[i.shapeType](f).attr(g).attr(h).add(a.group).shadow(c.shadow,null,c.stacking&&!c.borderRadius))})},animate:function(a){var b=this.yAxis,c=this.options,d=this.chart.inverted,e={};aa&&(a?(e.scaleY=.001,a=C(b.pos+b.len,v(b.pos,b.toPixels(c.threshold))),d?e.translateX=a-b.len:e.translateY=a,this.group.attr(e)):(e.scaleY=1,e[d?"translateX":"translateY"]=b.pos,this.group.animate(e,this.options.animation),this.animate=null))},remove:function(){var a=this,b=a.chart;b.hasRendered&&p(b.series,function(b){b.type===a.type&&(b.isDirty=!0)}),O.prototype.remove.apply(a,arguments)}}),F.column=ga,ba.bar=w(ba.column),pa=ka(ga,{type:"bar",inverted:!0}),F.bar=pa,ba.scatter=w(S,{lineWidth:0,tooltip:{headerFormat:'<span style="color:{series.color}">●</span> <span style="font-size: 10px;"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"},stickyTracking:!1}),pa=ka(O,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["markerGroup"],takeOrdinalPosition:!1,singularTooltips:!0,drawGraph:function(){this.options.lineWidth&&O.prototype.drawGraph.call(this)}}),F.scatter=pa,ba.pie=w(S,{borderColor:"#FFFFFF",borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.point.name}},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,states:{hover:{brightness:.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}}),S={type:"pie",isCartesian:!1,pointClass:ka(Ea,{init:function(){Ea.prototype.init.apply(this,arguments);var b,a=this;return a.y<0&&(a.y=null),q(a,{visible:a.visible!==!1,name:m(a.name,"Slice")}),b=function(b){a.slice("select"===b.type)},K(a,"select",b),K(a,"unselect",b),a},setVisible:function(a){var b=this,c=b.series,d=c.chart;b.visible=b.options.visible=a=a===t?!b.visible:a,c.options.data[Da(b,c.data)]=b.options,p(["graphic","dataLabel","connector","shadowGroup"],function(c){b[c]&&b[c][a?"show":"hide"](!0)}),b.legendItem&&d.legend.colorizeItem(b,a),!c.isDirty&&c.options.ignoreHiddenPoint&&(c.isDirty=!0,d.redraw())},slice:function(a,b,c){var d=this.series;Qa(c,d.chart),m(b,!0),this.sliced=this.options.sliced=a=r(a)?a:!this.sliced,d.options.data[Da(this,d.data)]=this.options,a=a?this.slicedTranslation:{translateX:0,translateY:0},this.graphic.animate(a),this.shadowGroup&&this.shadowGroup.animate(a)},haloPath:function(a){var b=this.shapeArgs,c=this.series.chart;return this.series.chart.renderer.symbols.arc(c.plotLeft+b.x,c.plotTop+b.y,b.r+a,b.r+a,{innerR:this.shapeArgs.r,start:b.start,end:b.end})}}),requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},singularTooltips:!0,getColor:sa,animate:function(a){var b=this,c=b.points,d=b.startAngleRad;a||(p(c,function(a){var c=a.graphic,a=a.shapeArgs;c&&(c.attr({r:b.center[3]/2,start:d,end:d}),c.animate({r:a.r,start:a.start,end:a.end},b.options.animation))}),b.animate=null)},setData:function(a,b,c,d){O.prototype.setData.call(this,a,!1,c,d),this.processData(),this.generatePoints(),m(b,!0)&&this.chart.redraw(c)},generatePoints:function(){var a,c,d,e,b=0,f=this.options.ignoreHiddenPoint;for(O.prototype.generatePoints.call(this),c=this.points,d=c.length,a=0;d>a;a++)e=c[a],b+=f&&!e.visible?0:e.y;for(this.total=b,a=0;d>a;a++)e=c[a],e.percentage=b>0?e.y/b*100:0,e.total=b},translate:function(a){this.generatePoints();var f,g,h,o,p,b=0,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,i=c.startAngle||0,j=this.startAngleRad=ma/180*(i-90),i=(this.endAngleRad=ma/180*(m(c.endAngle,i+360)-90))-j,k=this.points,l=c.dataLabels.distance,c=c.ignoreHiddenPoint,n=k.length;for(a||(this.center=a=this.getCenter()),this.getX=function(b,c){return h=U.asin(C((b-a[1])/(a[2]/2+l),1)),a[0]+(c?-1:1)*Z(h)*(a[2]/2+l)},o=0;n>o;o++)p=k[o],f=j+b*i,(!c||p.visible)&&(b+=p.percentage/100),g=j+b*i,p.shapeType="arc",p.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:u(1e3*f)/1e3,end:u(1e3*g)/1e3},h=(g+f)/2,h>1.5*ma?h-=2*ma:-ma/2>h&&(h+=2*ma),p.slicedTranslation={translateX:u(Z(h)*d),translateY:u(ea(h)*d)},f=Z(h)*a[2]/2,g=ea(h)*a[2]/2,p.tooltipPos=[a[0]+.7*f,a[1]+.7*g],p.half=-ma/2>h||h>ma/2?1:0,p.angle=h,e=C(e,l/2),p.labelPos=[a[0]+f+Z(h)*l,a[1]+g+ea(h)*l,a[0]+f+Z(h)*e,a[1]+g+ea(h)*e,a[0]+f,a[1]+g,0>l?"center":p.half?"right":"left",h]},drawGraph:null,drawPoints:function(){var c,d,f,g,a=this,b=a.chart.renderer,e=a.options.shadow;e&&!a.shadowGroup&&(a.shadowGroup=b.g("shadow").add(a.group)),p(a.points,function(h){d=h.graphic,g=h.shapeArgs,f=h.shadowGroup,e&&!f&&(f=h.shadowGroup=b.g("shadow").add(a.shadowGroup)),c=h.sliced?h.slicedTranslation:{translateX:0,translateY:0},f&&f.attr(c),d?d.animate(q(g,c)):h.graphic=d=b[h.shapeType](g).setRadialReference(a.center).attr(h.pointAttr[h.selected?"select":""]).attr({"stroke-linejoin":"round"}).attr(c).add(a.group).shadow(e,f),void 0!==h.visible&&h.setVisible(h.visible)})},sortByAngle:function(a,b){a.sort(function(a,d){return void 0!==a.angle&&(d.angle-a.angle)*b})},drawLegendSymbol:N.drawRectangle,getCenter:X.getCenter,getSymbol:sa},S=ka(O,S),F.pie=S,O.prototype.drawDataLabels=function(){var f,g,h,i,a=this,b=a.options,c=b.cursor,d=b.dataLabels,e=a.points;(d.enabled||a._hasPointLabels)&&(a.dlProcessOptions&&a.dlProcessOptions(d),i=a.plotGroup("dataLabelsGroup","data-labels","hidden",d.zIndex||6),!a.hasRendered&&m(d.defer,!0)&&(i.attr({opacity:0}),K(a,"afterAnimate",function(){a.dataLabelsGroup.show()[b.animation?"animate":"attr"]({opacity:1},{duration:200})})),g=d,p(e,function(b){var e,o,n,l=b.dataLabel,p=b.connector,u=!0;if(f=b.options&&b.options.dataLabels,e=m(f&&f.enabled,g.enabled),l&&!e)b.dataLabel=l.destroy();else if(e){if(d=w(g,f),e=d.rotation,o=b.getLabelConfig(),h=d.format?Ia(d.format,o):d.formatter.call(o,d),d.style.color=m(d.color,d.style.color,a.color,"black"),l)r(h)?(l.attr({text:h}),u=!1):(b.dataLabel=l=l.destroy(),p&&(b.connector=p.destroy()));else if(r(h)){l={fill:d.backgroundColor,stroke:d.borderColor,"stroke-width":d.borderWidth,r:d.borderRadius||0,rotation:e,padding:d.padding,zIndex:1};for(n in l)l[n]===t&&delete l[n];l=b.dataLabel=a.chart.renderer[e?"text":"label"](h,0,-999,null,null,null,d.useHTML).attr(l).css(q(d.style,c&&{cursor:c})).add(i).shadow(d.shadow)}l&&a.alignDataLabel(b,l,d,null,u)}}))},O.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=m(a.plotX,-999),i=m(a.plotY,-999),j=b.getBBox();(a=this.visible&&(a.series.forceDL||f.isInsidePlot(h,u(i),g)||d&&f.isInsidePlot(h,g?d.x+1:d.y+d.height-1,g)))&&(d=q({x:g?f.plotWidth-i:h,y:u(g?f.plotHeight-h:i),width:0,height:0},d),q(c,{width:j.width,height:j.height}),c.rotation?(g={align:c.align,x:d.x+c.x+d.width/2,y:d.y+c.y+d.height/2},b[e?"attr":"animate"](g)):(b.align(c,null,d),g=b.alignAttr,"justify"===m(c.overflow,"justify")?this.justifyDataLabel(b,c,g,j,d,e):m(c.crop,!0)&&(a=f.isInsidePlot(g.x,g.y)&&f.isInsidePlot(g.x+j.width,g.y+j.height)))),a||(b.attr({y:-999}),b.placed=!1)},O.prototype.justifyDataLabel=function(a,b,c,d,e,f){var j,k,g=this.chart,h=b.align,i=b.verticalAlign;j=c.x,0>j&&("right"===h?b.align="left":b.x=-j,k=!0),j=c.x+d.width,j>g.plotWidth&&("left"===h?b.align="right":b.x=g.plotWidth-j,k=!0),j=c.y,0>j&&("bottom"===i?b.verticalAlign="top":b.y=-j,k=!0),j=c.y+d.height,j>g.plotHeight&&("top"===i?b.verticalAlign="bottom":b.y=g.plotHeight-j,k=!0),k&&(a.placed=!f,a.align(b,null,e))},F.pie&&(F.pie.prototype.drawDataLabels=function(){var c,i,j,t,w,x,y,A,C,G,D,B,a=this,b=a.data,d=a.chart,e=a.options.dataLabels,f=m(e.connectorPadding,10),g=m(e.connectorWidth,1),h=d.plotWidth,d=d.plotHeight,k=m(e.softConnector,!0),l=e.distance,o=a.center,n=o[2]/2,q=o[1],r=l>0,z=[[],[]],F=[0,0,0,0],N=function(a,b){return b.y-a.y};if(a.visible&&(e.enabled||a._hasPointLabels)){for(O.prototype.drawDataLabels.apply(a),p(b,function(a){a.dataLabel&&a.visible&&z[a.half].push(a)}),D=0;!y&&b[D];)y=b[D]&&b[D].dataLabel&&(b[D].dataLabel.getBBox().height||21),D++;for(D=2;D--;){var E,b=[],K=[],H=z[D],I=H.length;if(a.sortByAngle(H,D-.5),l>0){for(B=q-n-l;q+n+l>=B;B+=y)b.push(B);if(w=b.length,I>w){for(c=[].concat(H),c.sort(N),B=I;B--;)c[B].rank=B;for(B=I;B--;)H[B].rank>=w&&H.splice(B,1);I=H.length}for(B=0;I>B;B++){c=H[B],x=c.labelPos,c=9999;var Q,P;for(P=0;w>P;P++)Q=M(b[P]-x[1]),c>Q&&(c=Q,E=P);if(B>E&&null!==b[B])E=B;else for(I-B+E>w&&null!==b[B]&&(E=w-I+B);null===b[E];)E++;K.push({i:E,y:b[E]}),b[E]=null}K.sort(N)}for(B=0;I>B;B++)c=H[B],x=c.labelPos,t=c.dataLabel,G=c.visible===!1?"hidden":"visible",c=x[1],l>0?(w=K.pop(),E=w.i,C=w.y,(c>C&&null!==b[E+1]||C>c&&null!==b[E-1])&&(C=c)):C=c,A=e.justify?o[0]+(D?-1:1)*(n+l):a.getX(0===E||E===b.length-1?c:C,D),t._attr={visibility:G,align:x[6]},t._pos={x:A+e.x+({left:f,right:-f}[x[6]]||0),y:C+e.y-10},t.connX=A,t.connY=C,null===this.options.size&&(w=t.width,f>A-w?F[3]=v(u(w-A+f),F[3]):A+w>h-f&&(F[1]=v(u(A+w-h+f),F[1])),0>C-y/2?F[0]=v(u(-C+y/2),F[0]):C+y/2>d&&(F[2]=v(u(C+y/2-d),F[2])))}(0===Ba(F)||this.verifyDataLabelOverflow(F))&&(this.placeDataLabels(),r&&g&&p(this.points,function(b){i=b.connector,x=b.labelPos,(t=b.dataLabel)&&t._pos?(G=t._attr.visibility,A=t.connX,C=t.connY,j=k?["M",A+("left"===x[6]?5:-5),C,"C",A,C,2*x[2]-x[4],2*x[3]-x[5],x[2],x[3],"L",x[4],x[5]]:["M",A+("left"===x[6]?5:-5),C,"L",x[2],x[3],"L",x[4],x[5]],i?(i.animate({d:j}),i.attr("visibility",G)):b.connector=i=a.chart.renderer.path(j).attr({"stroke-width":g,stroke:e.connectorColor||b.color||"#606060",visibility:G}).add(a.dataLabelsGroup)):i&&(b.connector=i.destroy())}))}},F.pie.prototype.placeDataLabels=function(){p(this.points,function(a){var b,a=a.dataLabel;a&&((b=a._pos)?(a.attr(a._attr),a[a.moved?"animate":"attr"](b),a.moved=!0):a&&a.attr({y:-999}))})},F.pie.prototype.alignDataLabel=sa,F.pie.prototype.verifyDataLabelOverflow=function(a){var f,b=this.center,c=this.options,d=c.center,e=c=c.minSize||80;return null!==d[0]?e=v(b[2]-v(a[1],a[3]),c):(e=v(b[2]-a[1]-a[3],c),b[0]+=(a[3]-a[1])/2),null!==d[1]?e=v(C(e,b[2]-v(a[0],a[2])),c):(e=v(C(e,b[2]-a[0]-a[2]),c),b[1]+=(a[0]-a[2])/2),e<b[2]?(b[2]=e,this.translate(b),p(this.points,function(a){a.dataLabel&&(a.dataLabel._pos=null)}),this.drawDataLabels&&this.drawDataLabels()):f=!0,f}),F.column&&(F.column.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=a.dlBox||a.shapeArgs,i=a.below||a.plotY>m(this.translatedThreshold,f.plotSizeY),j=m(c.inside,!!this.options.stacking);h&&(d=w(h),g&&(d={x:f.plotWidth-d.y-d.height,y:f.plotHeight-d.x-d.width,width:d.height,height:d.width}),!j)&&(g?(d.x+=i?0:d.width,d.width=0):(d.y+=i?d.height:0,d.height=0)),c.align=m(c.align,!g||j?"center":i?"right":"left"),c.verticalAlign=m(c.verticalAlign,g||j?"middle":i?"top":"bottom"),O.prototype.alignDataLabel.call(this,a,b,c,d,e)}),S=R.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,d=a.options.cursor,e=d&&{cursor:d},f=function(c){var e,d=c.target;for(b.hoverSeries!==a&&a.onMouseOver();d&&!e;)e=d.point,d=d.parentNode;e!==t&&e!==b.hoverPoint&&e.onMouseOver(c)};p(a.points,function(a){a.graphic&&(a.graphic.element.point=a),a.dataLabel&&(a.dataLabel.element.point=a)}),a._hasTracking||(p(a.trackerGroups,function(b){a[b]&&(a[b].addClass("highcharts-tracker").on("mouseover",f).on("mouseout",function(a){c.onTrackerMouseOut(a)}).css(e),$a)&&a[b].on("touchstart",f)}),a._hasTracking=!0)},drawTrackerGraph:function(){var m,a=this,b=a.options,c=b.trackByArea,d=[].concat(c?a.areaPath:a.graphPath),e=d.length,f=a.chart,g=f.pointer,h=f.renderer,i=f.options.tooltip.snap,j=a.tracker,k=b.cursor,l=k&&{cursor:k},k=a.singlePoints,n=function(){f.hoverSeries!==a&&a.onMouseOver()},q="rgba(192,192,192,"+(aa?1e-4:.002)+")";if(e&&!c)for(m=e+1;m--;)"M"===d[m]&&d.splice(m+1,0,d[m+1]-i,d[m+2],"L"),(m&&"M"===d[m]||m===e)&&d.splice(m,0,"L",d[m-2]+i,d[m-1]);for(m=0;m<k.length;m++)e=k[m],d.push("M",e.plotX-i,e.plotY,"L",e.plotX+i,e.plotY);j?j.attr({d:d}):(a.tracker=h.path(d).attr({"stroke-linejoin":"round",visibility:a.visible?"visible":"hidden",stroke:q,fill:c?q:Q,"stroke-width":b.lineWidth+(c?0:2*i),zIndex:2}).add(a.group),p([a.tracker,a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",n).on("mouseout",function(a){g.onTrackerMouseOut(a)}).css(l),$a&&a.on("touchstart",n)}))}},F.column&&(ga.prototype.drawTracker=S.drawTrackerPoint),F.pie&&(F.pie.prototype.drawTracker=S.drawTrackerPoint),F.scatter&&(pa.prototype.drawTracker=S.drawTrackerPoint),q(lb.prototype,{setItemEvents:function(a,b,c,d,e){var f=this;(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover"),b.css(f.options.itemHoverStyle)}).on("mouseout",function(){b.css(a.visible?d:e),a.setState()}).on("click",function(b){var c=function(){a.setVisible()},b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):D(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=Y("input",{type:"checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container),K(a.checkbox,"click",function(b){D(a,"checkboxClick",{checked:b.target.checked},function(){a.select()})})}}),E.legend.itemStyle.cursor="pointer",q(Ya.prototype,{showResetZoom:function(){var a=this,b=E.lang,c=a.options.chart.resetZoomButton,d=c.theme,e=d.states,f="chart"===c.relativeTo?null:"plotBox";this.resetZoomButton=a.renderer.button(b.resetZoom,null,null,function(){a.zoomOut()},d,e&&e.hover).attr({align:c.position.align,title:b.resetZoomTitle}).add().align(c.position,!1,f)},zoomOut:function(){var a=this;D(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var b,e,c=this.pointer,d=!1;!a||a.resetSelection?p(this.axes,function(a){b=a.zoom()}):p(a.xAxis.concat(a.yAxis),function(a){var e=a.axis,h=e.isXAxis;(c[h?"zoomX":"zoomY"]||c[h?"pinchX":"pinchY"])&&(b=e.zoom(a.min,a.max),e.displayBtn&&(d=!0))}),e=this.resetZoomButton,d&&!e?this.showResetZoom():!d&&ca(e)&&(this.resetZoomButton=e.destroy()),b&&this.redraw(m(this.options.chart.animation,a&&a.animation,this.pointCount<100))},pan:function(a,b){var e,c=this,d=c.hoverPoints;d&&p(d,function(a){a.setState()}),p("xy"===b?[1,0]:[1],function(b){var d=a[b?"chartX":"chartY"],h=c[b?"xAxis":"yAxis"][0],i=c[b?"mouseDownX":"mouseDownY"],j=(h.pointRange||0)/2,k=h.getExtremes(),l=h.toValue(i-d,!0)+j,i=h.toValue(i+c[b?"plotWidth":"plotHeight"]-d,!0)-j;h.series.length&&l>C(k.dataMin,k.min)&&i<v(k.dataMax,k.max)&&(h.setExtremes(l,i,!1,!1,{trigger:"pan"}),e=!0),c[b?"mouseDownX":"mouseDownY"]=d}),e&&c.redraw(!1),G(c.container,{cursor:"move"})}}),q(Ea.prototype,{select:function(a,b){var c=this,d=c.series,e=d.chart,a=m(a,!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=c.options.selected=a,d.options.data[Da(c,d.data)]=c.options,c.setState(a&&"select"),b||p(e.getSelectedPoints(),function(a){a.selected&&a!==c&&(a.selected=a.options.selected=!1,d.options.data[Da(a,d.data)]=a.options,a.setState(""),a.firePointEvent("unselect"))})})},onMouseOver:function(a){var b=this.series,c=b.chart,d=c.tooltip,e=c.hoverPoint;e&&e!==this&&e.onMouseOut(),this.firePointEvent("mouseOver"),d&&(!d.shared||b.noSharedTooltip)&&d.refresh(this,a),this.setState("hover"),c.hoverPoint=this},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints;b&&-1!==Da(this,b)||(this.firePointEvent("mouseOut"),this.setState(),a.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var b,a=w(this.series.options.point,this.options).events;this.events=a;for(b in a)K(this,b,a[b]);this.hasImportedEvents=!0}},setState:function(a,b){var p,c=this.plotX,d=this.plotY,e=this.series,f=e.options.states,g=ba[e.type].marker&&e.options.marker,h=g&&!g.enabled,i=g&&g.states[a],j=i&&i.enabled===!1,k=e.stateMarkerGraphic,l=this.marker||{},m=e.chart,n=e.halo,a=a||"";p=this.pointAttr[a]||e.pointAttr[a],a===this.state&&!b||this.selected&&"select"!==a||f[a]&&f[a].enabled===!1||a&&(j||h&&i.enabled===!1)||a&&l.states&&l.states[a]&&l.states[a].enabled===!1||(this.graphic?(g=g&&this.graphic.symbolName&&p.r,this.graphic.attr(w(p,g?{x:c-g,y:d-g,width:2*g,height:2*g}:{})),k&&k.hide()):(a&&i&&(g=i.radius,l=l.symbol||e.symbol,k&&k.currentSymbol!==l&&(k=k.destroy()),k?k[b?"animate":"attr"]({x:c-g,y:d-g}):l&&(e.stateMarkerGraphic=k=m.renderer.symbol(l,c-g,d-g,2*g,2*g).attr(p).add(e.markerGroup),k.currentSymbol=l)),k&&k[a&&m.isInsidePlot(c,d,m.inverted)?"show":"hide"]()),(c=f[a]&&f[a].halo)&&c.size?(n||(e.halo=n=m.renderer.path().add(e.seriesGroup)),n.attr(q({fill:ya(this.color||e.color).setOpacity(c.opacity).get()},c.attributes))[b?"animate":"attr"]({d:this.haloPath(c.size)})):n&&n.attr({d:[]}),this.state=a)},haloPath:function(a){var b=this.series,c=b.chart,d=b.getPlotBox(),e=c.inverted;return c.renderer.symbols.circle(d.translateX+(e?b.yAxis.len-this.plotY:this.plotX)-a,d.translateY+(e?b.xAxis.len-this.plotX:this.plotY)-a,2*a,2*a)}}),q(O.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;b&&b!==this&&b.onMouseOut(),this.options.events.mouseOver&&D(this,"mouseOver"),this.setState("hover"),a.hoverSeries=this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;d&&d.onMouseOut(),this&&a.events.mouseOut&&D(this,"mouseOut"),c&&!a.stickyTracking&&(!c.shared||this.noSharedTooltip)&&c.hide(),this.setState(),b.hoverSeries=null},setState:function(a){var b=this.options,c=this.graph,d=this.graphNeg,e=b.states,b=b.lineWidth,a=a||"";this.state!==a&&(this.state=a,e[a]&&e[a].enabled===!1||(a&&(b=e[a].lineWidth||b+1),c&&!c.dashstyle&&(a={"stroke-width":b},c.attr(a),d&&d.attr(a))))},setVisible:function(a,b){var f,c=this,d=c.chart,e=c.legendItem,g=d.options.chart.ignoreHiddenSeries,h=c.visible;f=(c.visible=a=c.userOptions.visible=a===t?!h:a)?"show":"hide",p(["group","dataLabelsGroup","markerGroup","tracker"],function(a){c[a]&&c[a][f]()}),d.hoverSeries===c&&c.onMouseOut(),e&&d.legend.colorizeItem(c,a),c.isDirty=!0,c.options.stacking&&p(d.series,function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)}),p(c.linkedSeries,function(b){b.setVisible(a,!1)}),g&&(d.isDirtyBox=!0),b!==!1&&d.redraw(),D(c,f)},setTooltipPoints:function(a){var c,d,h,i,b=[],e=this.xAxis,f=e&&e.getExtremes(),g=e?e.tooltipLen||e.len:this.chart.plotSizeX,j=[];if(this.options.enableMouseTracking!==!1&&!this.singularTooltips){for(a&&(this.tooltipPoints=null),p(this.segments||this.points,function(a){b=b.concat(a)}),e&&e.reversed&&(b=b.reverse()),this.orderTooltipPoints&&this.orderTooltipPoints(b),a=b.length,i=0;a>i;i++)if(e=b[i],c=e.x,c>=f.min&&c<=f.max)for(h=b[i+1],c=d===t?0:d+1,d=b[i+1]?C(v(0,T((e.clientX+(h?h.wrappedClientX||h.clientX:g))/2)),g):g;c>=0&&d>=c;)j[c++]=e;this.tooltipPoints=j}},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=a===t?!this.selected:a,this.checkbox&&(this.checkbox.checked=a),D(this,a?"select":"unselect")},drawTracker:S.drawTrackerGraph}),q(R,{Axis:la,Chart:Ya,Color:ya,Point:Ea,Tick:Sa,Renderer:Za,Series:O,SVGElement:P,SVGRenderer:ta,arrayMin:Na,arrayMax:Ba,charts:V,dateFormat:cb,format:Ia,pathAnim:ub,getOptions:function(){return E},hasBidiBug:Nb,isTouchDevice:Jb,numberFormat:Ga,seriesTypes:F,setOptions:function(a){return E=w(!0,E,a),Cb(),E},addEvent:K,removeEvent:W,createElement:Y,discardElement:Pa,css:G,each:p,extend:q,map:Ua,merge:w,pick:m,splat:qa,extendClass:ka,pInt:z,wrap:Ma,svg:aa,canvas:fa,vml:!aa&&!fa,product:"Highcharts",version:"4.0.1"})}(),jQuery(document).ready(function($){$("#filter_action").select2(),$("#filter_content").select2({query:function(query){var key=query.term;$.ajax({type:"POST",url:li_admin_ajax.ajax_url,data:{action:"leadin_get_posts_and_pages",search_term:key},success:function(data){var i,json_data=jQuery.parseJSON(data),data_test={results:[]};for(i=0;i<json_data.length;i++)data_test.results.push({id:json_data[i].post_title,text:json_data[i].post_title});query.callback(data_test)}})},initSelection:function(){$("#filter_content").val()?$("#filter_content").select2("data",{id:$("#filter_content").val(),text:$("#filter_content").val()}):$("#filter_content").select2("data",{id:"",text:"Any Page"})}}),$("#leadin-contact-status").change(function(){$("#leadin-contact-status-button").addClass("button-primary")})}),jQuery(document).ready(function($){$("#leadin-contacts input:checkbox").not("thead input:checkbox, tfoot input:checkbox").bind("change",function(){var cb_count=0,selected_vals="",$btn_selected=$("#leadin-export-selected-leads"),$input_selected_vals=$("#leadin-selected-contacts"),$cb_selected=$("#leadin-contacts input:checkbox:checked").not("thead input:checkbox, tfoot input:checkbox");$cb_selected.length>0?$btn_selected.attr("disabled",!1):$btn_selected.attr("disabled",!0),$cb_selected.each(function(){selected_vals+=$(this).val(),cb_count!=$cb_selected.length-1&&(selected_vals+=","),cb_count++}),$input_selected_vals.val(selected_vals)}),$("#cb-select-all-1, #cb-select-all-2").bind("change",function(){var cb_count=0,selected_vals="",$this=$(this),$btn_selected=$("#leadin-export-selected-leads"),$cb_selected=$("#leadin-contacts input:checkbox").not("thead input:checkbox, tfoot input:checkbox"),$input_selected_vals=$("#leadin-selected-contacts");$cb_selected.each(function(){selected_vals+=$(this).val(),cb_count!=$cb_selected.length-1&&(selected_vals+=","),cb_count++}),$input_selected_vals.val(selected_vals),$this.is(":checked")?$btn_selected.attr("disabled",!1):$btn_selected.attr("disabled",!0)}),$(".postbox .handlediv").bind("click",function(){var $postbox=$(this).parent();$postbox.hasClass("closed")?$postbox.removeClass("closed"):$postbox.addClass("closed")})}),function($){"undefined"==typeof $.fn.each2&&$.extend($.fn,{each2:function(c){for(var j=$([0]),i=-1,l=this.length;++i<l&&(j.context=j[0]=this[i])&&c.call(j[0],i,j)!==!1;);return this}})}(jQuery),function($,undefined){"use strict";function reinsertElement(element){var placeholder=$(document.createTextNode(""));element.before(placeholder),placeholder.before(element),placeholder.remove()}function stripDiacritics(str){function match(a){return DIACRITICS[a]||a}return str.replace(/[^\u0000-\u007E]/g,match)}function indexOf(value,array){for(var i=0,l=array.length;l>i;i+=1)if(equal(value,array[i]))return i;return-1}function measureScrollbar(){var $template=$(MEASURE_SCROLLBAR_TEMPLATE);$template.appendTo("body");var dim={width:$template.width()-$template[0].clientWidth,height:$template.height()-$template[0].clientHeight};return $template.remove(),dim}function equal(a,b){return a===b?!0:a===undefined||b===undefined?!1:null===a||null===b?!1:a.constructor===String?a+""==b+"":b.constructor===String?b+""==a+"":!1}function splitVal(string,separator){var val,i,l;if(null===string||string.length<1)return[];for(val=string.split(separator),i=0,l=val.length;l>i;i+=1)val[i]=$.trim(val[i]);return val}function getSideBorderPadding(element){return element.outerWidth(!1)-element.width()}function installKeyUpChangeEvent(element){var key="keyup-change-value";element.on("keydown",function(){$.data(element,key)===undefined&&$.data(element,key,element.val())}),element.on("keyup",function(){var val=$.data(element,key);val!==undefined&&element.val()!==val&&($.removeData(element,key),element.trigger("keyup-change"))})}function installFilteredMouseMove(element){element.on("mousemove",function(e){var lastpos=lastMousePosition;(lastpos===undefined||lastpos.x!==e.pageX||lastpos.y!==e.pageY)&&$(e.target).trigger("mousemove-filtered",e)})}function debounce(quietMillis,fn,ctx){ctx=ctx||undefined;var timeout;return function(){var args=arguments;window.clearTimeout(timeout),timeout=window.setTimeout(function(){fn.apply(ctx,args)},quietMillis)}}function installDebouncedScroll(threshold,element){var notify=debounce(threshold,function(e){element.trigger("scroll-debounced",e)});element.on("scroll",function(e){indexOf(e.target,element.get())>=0&&notify(e)})}function focus($el){$el[0]!==document.activeElement&&window.setTimeout(function(){var range,el=$el[0],pos=$el.val().length;$el.focus();var isVisible=el.offsetWidth>0||el.offsetHeight>0;isVisible&&el===document.activeElement&&(el.setSelectionRange?el.setSelectionRange(pos,pos):el.createTextRange&&(range=el.createTextRange(),range.collapse(!1),range.select()))},0)}function getCursorInfo(el){el=$(el)[0];var offset=0,length=0;if("selectionStart"in el)offset=el.selectionStart,length=el.selectionEnd-offset;else if("selection"in document){el.focus();var sel=document.selection.createRange();length=document.selection.createRange().text.length,sel.moveStart("character",-el.value.length),offset=sel.text.length-length}return{offset:offset,length:length}}function killEvent(event){event.preventDefault(),event.stopPropagation()}function killEventImmediately(event){event.preventDefault(),event.stopImmediatePropagation()}function measureTextWidth(e){if(!sizer){var style=e[0].currentStyle||window.getComputedStyle(e[0],null);sizer=$(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:style.fontSize,fontFamily:style.fontFamily,fontStyle:style.fontStyle,fontWeight:style.fontWeight,letterSpacing:style.letterSpacing,textTransform:style.textTransform,whiteSpace:"nowrap"}),sizer.attr("class","select2-sizer"),$("body").append(sizer)}return sizer.text(e.val()),sizer.width()}function syncCssClasses(dest,src,adapter){var classes,adapted,replacements=[];classes=dest.attr("class"),classes&&(classes=""+classes,$(classes.split(" ")).each2(function(){0===this.indexOf("select2-")&&replacements.push(this)})),classes=src.attr("class"),classes&&(classes=""+classes,$(classes.split(" ")).each2(function(){0!==this.indexOf("select2-")&&(adapted=adapter(this),adapted&&replacements.push(adapted))})),dest.attr("class",replacements.join(" "))}function markMatch(text,term,markup,escapeMarkup){var match=stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase())),tl=term.length;return 0>match?void markup.push(escapeMarkup(text)):(markup.push(escapeMarkup(text.substring(0,match))),markup.push("<span class='select2-match'>"),markup.push(escapeMarkup(text.substring(match,match+tl))),markup.push("</span>"),void markup.push(escapeMarkup(text.substring(match+tl,text.length))))}function defaultEscapeMarkup(markup){var replace_map={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(markup).replace(/[&<>"'\/\\]/g,function(match){return replace_map[match]})}function ajax(options){var timeout,handler=null,quietMillis=options.quietMillis||100,ajaxUrl=options.url,self=this;return function(query){window.clearTimeout(timeout),timeout=window.setTimeout(function(){var data=options.data,url=ajaxUrl,transport=options.transport||$.fn.select2.ajaxDefaults.transport,deprecated={type:options.type||"GET",cache:options.cache||!1,jsonpCallback:options.jsonpCallback||undefined,dataType:options.dataType||"json"},params=$.extend({},$.fn.select2.ajaxDefaults.params,deprecated);data=data?data.call(self,query.term,query.page,query.context):null,url="function"==typeof url?url.call(self,query.term,query.page,query.context):url,handler&&"function"==typeof handler.abort&&handler.abort(),options.params&&($.isFunction(options.params)?$.extend(params,options.params.call(self)):$.extend(params,options.params)),$.extend(params,{url:url,dataType:options.dataType,data:data,success:function(data){var results=options.results(data,query.page);query.callback(results)}}),handler=transport.call(self,params)},quietMillis)}}function local(options){var dataText,tmp,data=options,text=function(item){return""+item.text};$.isArray(data)&&(tmp=data,data={results:tmp}),$.isFunction(data)===!1&&(tmp=data,data=function(){return tmp});var dataItem=data();return dataItem.text&&(text=dataItem.text,$.isFunction(text)||(dataText=dataItem.text,text=function(item){return item[dataText]})),function(query){var process,t=query.term,filtered={results:[]};return""===t?void query.callback(data()):(process=function(datum,collection){var group,attr;if(datum=datum[0],datum.children){group={};for(attr in datum)datum.hasOwnProperty(attr)&&(group[attr]=datum[attr]);group.children=[],$(datum.children).each2(function(i,childDatum){process(childDatum,group.children)}),(group.children.length||query.matcher(t,text(group),datum))&&collection.push(group)}else query.matcher(t,text(datum),datum)&&collection.push(datum)},$(data().results).each2(function(i,datum){process(datum,filtered.results)}),void query.callback(filtered))}}function tags(data){var isFunc=$.isFunction(data);return function(query){var t=query.term,filtered={results:[]},result=isFunc?data(query):data;$.isArray(result)&&($(result).each(function(){var isObject=this.text!==undefined,text=isObject?this.text:this;
6
+ (""===t||query.matcher(t,text))&&filtered.results.push(isObject?this:{id:this,text:this})}),query.callback(filtered))}}function checkFormatter(formatter,formatterName){if($.isFunction(formatter))return!0;if(!formatter)return!1;if("string"==typeof formatter)return!0;throw new Error(formatterName+" must be a string, function, or falsy value")}function evaluate(val){if($.isFunction(val)){var args=Array.prototype.slice.call(arguments,1);return val.apply(null,args)}return val}function countResults(results){var count=0;return $.each(results,function(i,item){item.children?count+=countResults(item.children):count++}),count}function defaultTokenizer(input,selection,selectCallback,opts){var token,index,i,l,separator,original=input,dupe=!1;if(!opts.createSearchChoice||!opts.tokenSeparators||opts.tokenSeparators.length<1)return undefined;for(;;){for(index=-1,i=0,l=opts.tokenSeparators.length;l>i&&(separator=opts.tokenSeparators[i],index=input.indexOf(separator),!(index>=0));i++);if(0>index)break;if(token=input.substring(0,index),input=input.substring(index+separator.length),token.length>0&&(token=opts.createSearchChoice.call(this,token,selection),token!==undefined&&null!==token&&opts.id(token)!==undefined&&null!==opts.id(token))){for(dupe=!1,i=0,l=selection.length;l>i;i++)if(equal(opts.id(token),opts.id(selection[i]))){dupe=!0;break}dupe||selectCallback(token)}}return original!==input?input:void 0}function cleanupJQueryElements(){var self=this;Array.prototype.forEach.call(arguments,function(element){self[element].remove(),self[element]=null})}function clazz(SuperClass,methods){var constructor=function(){};return constructor.prototype=new SuperClass,constructor.prototype.constructor=constructor,constructor.prototype.parent=SuperClass.prototype,constructor.prototype=$.extend(constructor.prototype,methods),constructor}if(window.Select2===undefined){var KEY,AbstractSelect2,SingleSelect2,MultiSelect2,nextUid,sizer,$document,scrollBarDimensions,lastMousePosition={x:0,y:0},KEY={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(k){switch(k=k.which?k.which:k){case KEY.LEFT:case KEY.RIGHT:case KEY.UP:case KEY.DOWN:return!0}return!1},isControl:function(e){var k=e.which;switch(k){case KEY.SHIFT:case KEY.CTRL:case KEY.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(k){return k=k.which?k.which:k,k>=112&&123>=k}},MEASURE_SCROLLBAR_TEMPLATE="<div class='select2-measure-scrollbar'></div>",DIACRITICS={"Ⓐ":"A",A:"A",À:"A",Á:"A",Â:"A",Ầ:"A",Ấ:"A",Ẫ:"A",Ẩ:"A",Ã:"A",Ā:"A",Ă:"A",Ằ:"A",Ắ:"A",Ẵ:"A",Ẳ:"A",Ȧ:"A",Ǡ:"A",Ä:"A",Ǟ:"A",Ả:"A",Å:"A",Ǻ:"A",Ǎ:"A",Ȁ:"A",Ȃ:"A",Ạ:"A",Ậ:"A",Ặ:"A",Ḁ:"A",Ą:"A",Ⱥ:"A",Ɐ:"A",Ꜳ:"AA",Æ:"AE",Ǽ:"AE",Ǣ:"AE",Ꜵ:"AO",Ꜷ:"AU",Ꜹ:"AV",Ꜻ:"AV",Ꜽ:"AY","Ⓑ":"B",B:"B",Ḃ:"B",Ḅ:"B",Ḇ:"B",Ƀ:"B",Ƃ:"B",Ɓ:"B","Ⓒ":"C",C:"C",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",Ç:"C",Ḉ:"C",Ƈ:"C",Ȼ:"C",Ꜿ:"C","Ⓓ":"D",D:"D",Ḋ:"D",Ď:"D",Ḍ:"D",Ḑ:"D",Ḓ:"D",Ḏ:"D",Đ:"D",Ƌ:"D",Ɗ:"D",Ɖ:"D",Ꝺ:"D",DZ:"DZ",DŽ:"DZ",Dz:"Dz",Dž:"Dz","Ⓔ":"E",E:"E",È:"E",É:"E",Ê:"E",Ề:"E",Ế:"E",Ễ:"E",Ể:"E",Ẽ:"E",Ē:"E",Ḕ:"E",Ḗ:"E",Ĕ:"E",Ė:"E",Ë:"E",Ẻ:"E",Ě:"E",Ȅ:"E",Ȇ:"E",Ẹ:"E",Ệ:"E",Ȩ:"E",Ḝ:"E",Ę:"E",Ḙ:"E",Ḛ:"E",Ɛ:"E",Ǝ:"E","Ⓕ":"F",F:"F",Ḟ:"F",Ƒ:"F",Ꝼ:"F","Ⓖ":"G",G:"G",Ǵ:"G",Ĝ:"G",Ḡ:"G",Ğ:"G",Ġ:"G",Ǧ:"G",Ģ:"G",Ǥ:"G",Ɠ:"G","Ꞡ":"G",Ᵹ:"G",Ꝿ:"G","Ⓗ":"H",H:"H",Ĥ:"H",Ḣ:"H",Ḧ:"H",Ȟ:"H",Ḥ:"H",Ḩ:"H",Ḫ:"H",Ħ:"H",Ⱨ:"H",Ⱶ:"H","Ɥ":"H","Ⓘ":"I",I:"I",Ì:"I",Í:"I",Î:"I",Ĩ:"I",Ī:"I",Ĭ:"I",İ:"I",Ï:"I",Ḯ:"I",Ỉ:"I",Ǐ:"I",Ȉ:"I",Ȋ:"I",Ị:"I",Į:"I",Ḭ:"I",Ɨ:"I","Ⓙ":"J",J:"J",Ĵ:"J",Ɉ:"J","Ⓚ":"K",K:"K",Ḱ:"K",Ǩ:"K",Ḳ:"K",Ķ:"K",Ḵ:"K",Ƙ:"K",Ⱪ:"K",Ꝁ:"K",Ꝃ:"K",Ꝅ:"K","Ꞣ":"K","Ⓛ":"L",L:"L",Ŀ:"L",Ĺ:"L",Ľ:"L",Ḷ:"L",Ḹ:"L",Ļ:"L",Ḽ:"L",Ḻ:"L",Ł:"L",Ƚ:"L",Ɫ:"L",Ⱡ:"L",Ꝉ:"L",Ꝇ:"L",Ꞁ:"L",LJ:"LJ",Lj:"Lj","Ⓜ":"M",M:"M",Ḿ:"M",Ṁ:"M",Ṃ:"M",Ɱ:"M",Ɯ:"M","Ⓝ":"N",N:"N",Ǹ:"N",Ń:"N",Ñ:"N",Ṅ:"N",Ň:"N",Ṇ:"N",Ņ:"N",Ṋ:"N",Ṉ:"N",Ƞ:"N",Ɲ:"N","Ꞑ":"N","Ꞥ":"N",NJ:"NJ",Nj:"Nj","Ⓞ":"O",O:"O",Ò:"O",Ó:"O",Ô:"O",Ồ:"O",Ố:"O",Ỗ:"O",Ổ:"O",Õ:"O",Ṍ:"O",Ȭ:"O",Ṏ:"O",Ō:"O",Ṑ:"O",Ṓ:"O",Ŏ:"O",Ȯ:"O",Ȱ:"O",Ö:"O",Ȫ:"O",Ỏ:"O",Ő:"O",Ǒ:"O",Ȍ:"O",Ȏ:"O",Ơ:"O",Ờ:"O",Ớ:"O",Ỡ:"O",Ở:"O",Ợ:"O",Ọ:"O",Ộ:"O",Ǫ:"O",Ǭ:"O",Ø:"O",Ǿ:"O",Ɔ:"O",Ɵ:"O",Ꝋ:"O",Ꝍ:"O",Ƣ:"OI",Ꝏ:"OO",Ȣ:"OU","Ⓟ":"P",P:"P",Ṕ:"P",Ṗ:"P",Ƥ:"P",Ᵽ:"P",Ꝑ:"P",Ꝓ:"P",Ꝕ:"P","Ⓠ":"Q",Q:"Q",Ꝗ:"Q",Ꝙ:"Q",Ɋ:"Q","Ⓡ":"R",R:"R",Ŕ:"R",Ṙ:"R",Ř:"R",Ȑ:"R",Ȓ:"R",Ṛ:"R",Ṝ:"R",Ŗ:"R",Ṟ:"R",Ɍ:"R",Ɽ:"R",Ꝛ:"R","Ꞧ":"R",Ꞃ:"R","Ⓢ":"S",S:"S",ẞ:"S",Ś:"S",Ṥ:"S",Ŝ:"S",Ṡ:"S",Š:"S",Ṧ:"S",Ṣ:"S",Ṩ:"S",Ș:"S",Ş:"S","Ȿ":"S","Ꞩ":"S",Ꞅ:"S","Ⓣ":"T",T:"T",Ṫ:"T",Ť:"T",Ṭ:"T",Ț:"T",Ţ:"T",Ṱ:"T",Ṯ:"T",Ŧ:"T",Ƭ:"T",Ʈ:"T",Ⱦ:"T",Ꞇ:"T",Ꜩ:"TZ","Ⓤ":"U",U:"U",Ù:"U",Ú:"U",Û:"U",Ũ:"U",Ṹ:"U",Ū:"U",Ṻ:"U",Ŭ:"U",Ü:"U",Ǜ:"U",Ǘ:"U",Ǖ:"U",Ǚ:"U",Ủ:"U",Ů:"U",Ű:"U",Ǔ:"U",Ȕ:"U",Ȗ:"U",Ư:"U",Ừ:"U",Ứ:"U",Ữ:"U",Ử:"U",Ự:"U",Ụ:"U",Ṳ:"U",Ų:"U",Ṷ:"U",Ṵ:"U",Ʉ:"U","Ⓥ":"V",V:"V",Ṽ:"V",Ṿ:"V",Ʋ:"V",Ꝟ:"V",Ʌ:"V",Ꝡ:"VY","Ⓦ":"W",W:"W",Ẁ:"W",Ẃ:"W",Ŵ:"W",Ẇ:"W",Ẅ:"W",Ẉ:"W",Ⱳ:"W","Ⓧ":"X",X:"X",Ẋ:"X",Ẍ:"X","Ⓨ":"Y",Y:"Y",Ỳ:"Y",Ý:"Y",Ŷ:"Y",Ỹ:"Y",Ȳ:"Y",Ẏ:"Y",Ÿ:"Y",Ỷ:"Y",Ỵ:"Y",Ƴ:"Y",Ɏ:"Y",Ỿ:"Y","Ⓩ":"Z",Z:"Z",Ź:"Z",Ẑ:"Z",Ż:"Z",Ž:"Z",Ẓ:"Z",Ẕ:"Z",Ƶ:"Z",Ȥ:"Z","Ɀ":"Z",Ⱬ:"Z",Ꝣ:"Z","ⓐ":"a",a:"a",ẚ:"a",à:"a",á:"a",â:"a",ầ:"a",ấ:"a",ẫ:"a",ẩ:"a",ã:"a",ā:"a",ă:"a",ằ:"a",ắ:"a",ẵ:"a",ẳ:"a",ȧ:"a",ǡ:"a",ä:"a",ǟ:"a",ả:"a",å:"a",ǻ:"a",ǎ:"a",ȁ:"a",ȃ:"a",ạ:"a",ậ:"a",ặ:"a",ḁ:"a",ą:"a",ⱥ:"a",ɐ:"a",ꜳ:"aa",æ:"ae",ǽ:"ae",ǣ:"ae",ꜵ:"ao",ꜷ:"au",ꜹ:"av",ꜻ:"av",ꜽ:"ay","ⓑ":"b",b:"b",ḃ:"b",ḅ:"b",ḇ:"b",ƀ:"b",ƃ:"b",ɓ:"b","ⓒ":"c",c:"c",ć:"c",ĉ:"c",ċ:"c",č:"c",ç:"c",ḉ:"c",ƈ:"c",ȼ:"c",ꜿ:"c",ↄ:"c","ⓓ":"d",d:"d",ḋ:"d",ď:"d",ḍ:"d",ḑ:"d",ḓ:"d",ḏ:"d",đ:"d",ƌ:"d",ɖ:"d",ɗ:"d",ꝺ:"d",dz:"dz",dž:"dz","ⓔ":"e",e:"e",è:"e",é:"e",ê:"e",ề:"e",ế:"e",ễ:"e",ể:"e",ẽ:"e",ē:"e",ḕ:"e",ḗ:"e",ĕ:"e",ė:"e",ë:"e",ẻ:"e",ě:"e",ȅ:"e",ȇ:"e",ẹ:"e",ệ:"e",ȩ:"e",ḝ:"e",ę:"e",ḙ:"e",ḛ:"e",ɇ:"e",ɛ:"e",ǝ:"e","ⓕ":"f",f:"f",ḟ:"f",ƒ:"f",ꝼ:"f","ⓖ":"g",g:"g",ǵ:"g",ĝ:"g",ḡ:"g",ğ:"g",ġ:"g",ǧ:"g",ģ:"g",ǥ:"g",ɠ:"g","ꞡ":"g",ᵹ:"g",ꝿ:"g","ⓗ":"h",h:"h",ĥ:"h",ḣ:"h",ḧ:"h",ȟ:"h",ḥ:"h",ḩ:"h",ḫ:"h",ẖ:"h",ħ:"h",ⱨ:"h",ⱶ:"h",ɥ:"h",ƕ:"hv","ⓘ":"i",i:"i",ì:"i",í:"i",î:"i",ĩ:"i",ī:"i",ĭ:"i",ï:"i",ḯ:"i",ỉ:"i",ǐ:"i",ȉ:"i",ȋ:"i",ị:"i",į:"i",ḭ:"i",ɨ:"i",ı:"i","ⓙ":"j",j:"j",ĵ:"j",ǰ:"j",ɉ:"j","ⓚ":"k",k:"k",ḱ:"k",ǩ:"k",ḳ:"k",ķ:"k",ḵ:"k",ƙ:"k",ⱪ:"k",ꝁ:"k",ꝃ:"k",ꝅ:"k","ꞣ":"k","ⓛ":"l",l:"l",ŀ:"l",ĺ:"l",ľ:"l",ḷ:"l",ḹ:"l",ļ:"l",ḽ:"l",ḻ:"l",ſ:"l",ł:"l",ƚ:"l",ɫ:"l",ⱡ:"l",ꝉ:"l",ꞁ:"l",ꝇ:"l",lj:"lj","ⓜ":"m",m:"m",ḿ:"m",ṁ:"m",ṃ:"m",ɱ:"m",ɯ:"m","ⓝ":"n",n:"n",ǹ:"n",ń:"n",ñ:"n",ṅ:"n",ň:"n",ṇ:"n",ņ:"n",ṋ:"n",ṉ:"n",ƞ:"n",ɲ:"n",ʼn:"n","ꞑ":"n","ꞥ":"n",nj:"nj","ⓞ":"o",o:"o",ò:"o",ó:"o",ô:"o",ồ:"o",ố:"o",ỗ:"o",ổ:"o",õ:"o",ṍ:"o",ȭ:"o",ṏ:"o",ō:"o",ṑ:"o",ṓ:"o",ŏ:"o",ȯ:"o",ȱ:"o",ö:"o",ȫ:"o",ỏ:"o",ő:"o",ǒ:"o",ȍ:"o",ȏ:"o",ơ:"o",ờ:"o",ớ:"o",ỡ:"o",ở:"o",ợ:"o",ọ:"o",ộ:"o",ǫ:"o",ǭ:"o",ø:"o",ǿ:"o",ɔ:"o",ꝋ:"o",ꝍ:"o",ɵ:"o",ƣ:"oi",ȣ:"ou",ꝏ:"oo","ⓟ":"p",p:"p",ṕ:"p",ṗ:"p",ƥ:"p",ᵽ:"p",ꝑ:"p",ꝓ:"p",ꝕ:"p","ⓠ":"q",q:"q",ɋ:"q",ꝗ:"q",ꝙ:"q","ⓡ":"r",r:"r",ŕ:"r",ṙ:"r",ř:"r",ȑ:"r",ȓ:"r",ṛ:"r",ṝ:"r",ŗ:"r",ṟ:"r",ɍ:"r",ɽ:"r",ꝛ:"r","ꞧ":"r",ꞃ:"r","ⓢ":"s",s:"s",ß:"s",ś:"s",ṥ:"s",ŝ:"s",ṡ:"s",š:"s",ṧ:"s",ṣ:"s",ṩ:"s",ș:"s",ş:"s",ȿ:"s","ꞩ":"s",ꞅ:"s",ẛ:"s","ⓣ":"t",t:"t",ṫ:"t",ẗ:"t",ť:"t",ṭ:"t",ț:"t",ţ:"t",ṱ:"t",ṯ:"t",ŧ:"t",ƭ:"t",ʈ:"t",ⱦ:"t",ꞇ:"t",ꜩ:"tz","ⓤ":"u",u:"u",ù:"u",ú:"u",û:"u",ũ:"u",ṹ:"u",ū:"u",ṻ:"u",ŭ:"u",ü:"u",ǜ:"u",ǘ:"u",ǖ:"u",ǚ:"u",ủ:"u",ů:"u",ű:"u",ǔ:"u",ȕ:"u",ȗ:"u",ư:"u",ừ:"u",ứ:"u",ữ:"u",ử:"u",ự:"u",ụ:"u",ṳ:"u",ų:"u",ṷ:"u",ṵ:"u",ʉ:"u","ⓥ":"v",v:"v",ṽ:"v",ṿ:"v",ʋ:"v",ꝟ:"v",ʌ:"v",ꝡ:"vy","ⓦ":"w",w:"w",ẁ:"w",ẃ:"w",ŵ:"w",ẇ:"w",ẅ:"w",ẘ:"w",ẉ:"w",ⱳ:"w","ⓧ":"x",x:"x",ẋ:"x",ẍ:"x","ⓨ":"y",y:"y",ỳ:"y",ý:"y",ŷ:"y",ỹ:"y",ȳ:"y",ẏ:"y",ÿ:"y",ỷ:"y",ẙ:"y",ỵ:"y",ƴ:"y",ɏ:"y",ỿ:"y","ⓩ":"z",z:"z",ź:"z",ẑ:"z",ż:"z",ž:"z",ẓ:"z",ẕ:"z",ƶ:"z",ȥ:"z",ɀ:"z",ⱬ:"z",ꝣ:"z"};$document=$(document),nextUid=function(){var counter=1;return function(){return counter++}}(),$document.on("mousemove",function(e){lastMousePosition.x=e.pageX,lastMousePosition.y=e.pageY}),AbstractSelect2=clazz(Object,{bind:function(func){var self=this;return function(){func.apply(self,arguments)}},init:function(opts){var results,search,resultsSelector=".select2-results";this.opts=opts=this.prepareOpts(opts),this.id=opts.id,opts.element.data("select2")!==undefined&&null!==opts.element.data("select2")&&opts.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=$("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body),this.containerId="s2id_"+(opts.element.attr("id")||"autogen"+nextUid()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",opts.element.attr("title")),this.body=$("body"),syncCssClasses(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",opts.element.attr("style")),this.container.css(evaluate(opts.containerCss)),this.container.addClass(evaluate(opts.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",killEvent),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),syncCssClasses(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(evaluate(opts.dropdownCssClass)),this.dropdown.data("select2",this),this.dropdown.on("click",killEvent),this.results=results=this.container.find(resultsSelector),this.search=search=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",killEvent),installFilteredMouseMove(this.results),this.dropdown.on("mousemove-filtered",resultsSelector,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",resultsSelector,this.bind(function(event){this._touchEvent=!0,this.highlightUnderEvent(event)})),this.dropdown.on("touchmove",resultsSelector,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",resultsSelector,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),installDebouncedScroll(80,this.results),this.dropdown.on("scroll-debounced",resultsSelector,this.bind(this.loadMoreIfNeeded)),$(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),$(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),$.fn.mousewheel&&results.mousewheel(function(e,delta,deltaX,deltaY){var top=results.scrollTop();deltaY>0&&0>=top-deltaY?(results.scrollTop(0),killEvent(e)):0>deltaY&&results.get(0).scrollHeight-results.scrollTop()+deltaY<=results.height()&&(results.scrollTop(results.get(0).scrollHeight-results.height()),killEvent(e))}),installKeyUpChangeEvent(search),search.on("keyup-change input paste",this.bind(this.updateResults)),search.on("focus",function(){search.addClass("select2-focused")}),search.on("blur",function(){search.removeClass("select2-focused")}),this.dropdown.on("mouseup",resultsSelector,this.bind(function(e){$(e.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(e),this.selectHighlighted(e))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){e.stopPropagation()}),this.nextSearchTerm=undefined,$.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==opts.maximumInputLength&&this.search.attr("maxlength",opts.maximumInputLength);var disabled=opts.element.prop("disabled");disabled===undefined&&(disabled=!1),this.enable(!disabled);var readonly=opts.element.prop("readonly");readonly===undefined&&(readonly=!1),this.readonly(readonly),scrollBarDimensions=scrollBarDimensions||measureScrollbar(),this.autofocus=opts.element.prop("autofocus"),opts.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",opts.searchInputPlaceholder)},destroy:function(){var element=this.opts.element,select2=element.data("select2");this.close(),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),select2!==undefined&&(select2.container.remove(),select2.liveRegion.remove(),select2.dropdown.remove(),element.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?element.attr({tabindex:this.elementTabIndex}):element.removeAttr("tabindex"),element.show()),cleanupJQueryElements.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(element){return element.is("option")?{id:element.prop("value"),text:element.text(),element:element.get(),css:element.attr("class"),disabled:element.prop("disabled"),locked:equal(element.attr("locked"),"locked")||equal(element.data("locked"),!0)}:element.is("optgroup")?{text:element.attr("label"),children:[],element:element.get(),css:element.attr("class")}:void 0},prepareOpts:function(opts){var element,select,idKey,ajaxUrl,self=this;if(element=opts.element,"select"===element.get(0).tagName.toLowerCase()&&(this.select=select=opts.element),select&&$.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in opts)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),opts=$.extend({},{populateResults:function(container,results,query){var populate,id=this.opts.id,liveRegion=this.liveRegion;(populate=function(results,container,depth){var i,l,result,selectable,disabled,compound,node,label,innerContainer,formatted;for(results=opts.sortResults(results,container,query),i=0,l=results.length;l>i;i+=1)result=results[i],disabled=result.disabled===!0,selectable=!disabled&&id(result)!==undefined,compound=result.children&&result.children.length>0,node=$("<li></li>"),node.addClass("select2-results-dept-"+depth),node.addClass("select2-result"),node.addClass(selectable?"select2-result-selectable":"select2-result-unselectable"),disabled&&node.addClass("select2-disabled"),compound&&node.addClass("select2-result-with-children"),node.addClass(self.opts.formatResultCssClass(result)),node.attr("role","presentation"),label=$(document.createElement("div")),label.addClass("select2-result-label"),label.attr("id","select2-result-label-"+nextUid()),label.attr("role","option"),formatted=opts.formatResult(result,label,query,self.opts.escapeMarkup),formatted!==undefined&&(label.html(formatted),node.append(label)),compound&&(innerContainer=$("<ul></ul>"),innerContainer.addClass("select2-result-sub"),populate(result.children,innerContainer,depth+1),node.append(innerContainer)),node.data("select2-data",result),container.append(node);liveRegion.text(opts.formatMatches(results.length))})(results,container,0)}},$.fn.select2.defaults,opts),"function"!=typeof opts.id&&(idKey=opts.id,opts.id=function(e){return e[idKey]}),$.isArray(opts.element.data("select2Tags"))){if("tags"in opts)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+opts.element.attr("id");opts.tags=opts.element.data("select2Tags")}if(select?(opts.query=this.bind(function(query){var children,placeholderOption,process,data={results:[],more:!1},term=query.term;process=function(element,collection){var group;element.is("option")?query.matcher(term,element.text(),element)&&collection.push(self.optionToData(element)):element.is("optgroup")&&(group=self.optionToData(element),element.children().each2(function(i,elm){process(elm,group.children)}),group.children.length>0&&collection.push(group))},children=element.children(),this.getPlaceholder()!==undefined&&children.length>0&&(placeholderOption=this.getPlaceholderOption(),placeholderOption&&(children=children.not(placeholderOption))),children.each2(function(i,elm){process(elm,data.results)}),query.callback(data)}),opts.id=function(e){return e.id}):"query"in opts||("ajax"in opts?(ajaxUrl=opts.element.data("ajax-url"),ajaxUrl&&ajaxUrl.length>0&&(opts.ajax.url=ajaxUrl),opts.query=ajax.call(opts.element,opts.ajax)):"data"in opts?opts.query=local(opts.data):"tags"in opts&&(opts.query=tags(opts.tags),opts.createSearchChoice===undefined&&(opts.createSearchChoice=function(term){return{id:$.trim(term),text:$.trim(term)}}),opts.initSelection===undefined&&(opts.initSelection=function(element,callback){var data=[];$(splitVal(element.val(),opts.separator)).each(function(){var obj={id:this,text:this},tags=opts.tags;$.isFunction(tags)&&(tags=tags()),$(tags).each(function(){return equal(this.id,obj.id)?(obj=this,!1):void 0}),data.push(obj)}),callback(data)}))),"function"!=typeof opts.query)throw"query function not defined for Select2 "+opts.element.attr("id");if("top"===opts.createSearchChoicePosition)opts.createSearchChoicePosition=function(list,item){list.unshift(item)};else if("bottom"===opts.createSearchChoicePosition)opts.createSearchChoicePosition=function(list,item){list.push(item)};else if("function"!=typeof opts.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return opts},monitorSource:function(){var sync,observer,el=this.opts.element;el.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),sync=this.bind(function(){var disabled=el.prop("disabled");disabled===undefined&&(disabled=!1),this.enable(!disabled);var readonly=el.prop("readonly");readonly===undefined&&(readonly=!1),this.readonly(readonly),syncCssClasses(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(evaluate(this.opts.containerCssClass)),syncCssClasses(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(evaluate(this.opts.dropdownCssClass))}),el.length&&el[0].attachEvent&&el.each(function(){this.attachEvent("onpropertychange",sync)}),observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,observer!==undefined&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new observer(function(mutations){mutations.forEach(sync)}),this.propertyObserver.observe(el.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(data){var evt=$.Event("select2-selecting",{val:this.id(data),object:data});return this.opts.element.trigger(evt),!evt.isDefaultPrevented()},triggerChange:function(details){details=details||{},details=$.extend({},details,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(details),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var enabled=this._enabled&&!this._readonly,disabled=!enabled;return enabled===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",disabled),this.close(),this.enabledInterface=enabled,!0)},enable:function(enabled){enabled===undefined&&(enabled=!0),this._enabled!==enabled&&(this._enabled=enabled,this.opts.element.prop("disabled",!enabled),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(enabled){enabled===undefined&&(enabled=!1),this._readonly!==enabled&&(this._readonly=enabled,this.opts.element.prop("readonly",enabled),this.enableInterface())},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var bodyOffset,above,changeDirection,css,resultsListNode,$dropdown=this.dropdown,offset=this.container.offset(),height=this.container.outerHeight(!1),width=this.container.outerWidth(!1),dropHeight=$dropdown.outerHeight(!1),$window=$(window),windowWidth=$window.width(),windowHeight=$window.height(),viewPortRight=$window.scrollLeft()+windowWidth,viewportBottom=$window.scrollTop()+windowHeight,dropTop=offset.top+height,dropLeft=offset.left,enoughRoomBelow=viewportBottom>=dropTop+dropHeight,enoughRoomAbove=offset.top-dropHeight>=$window.scrollTop(),dropWidth=$dropdown.outerWidth(!1),enoughRoomOnRight=viewPortRight>=dropLeft+dropWidth,aboveNow=$dropdown.hasClass("select2-drop-above");aboveNow?(above=!0,!enoughRoomAbove&&enoughRoomBelow&&(changeDirection=!0,above=!1)):(above=!1,!enoughRoomBelow&&enoughRoomAbove&&(changeDirection=!0,above=!0)),changeDirection&&($dropdown.hide(),offset=this.container.offset(),height=this.container.outerHeight(!1),width=this.container.outerWidth(!1),dropHeight=$dropdown.outerHeight(!1),viewPortRight=$window.scrollLeft()+windowWidth,viewportBottom=$window.scrollTop()+windowHeight,dropTop=offset.top+height,dropLeft=offset.left,dropWidth=$dropdown.outerWidth(!1),enoughRoomOnRight=viewPortRight>=dropLeft+dropWidth,$dropdown.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(resultsListNode=$(".select2-results",$dropdown)[0],$dropdown.addClass("select2-drop-auto-width"),$dropdown.css("width",""),dropWidth=$dropdown.outerWidth(!1)+(resultsListNode.scrollHeight===resultsListNode.clientHeight?0:scrollBarDimensions.width),dropWidth>width?width=dropWidth:dropWidth=width,dropHeight=$dropdown.outerHeight(!1),enoughRoomOnRight=viewPortRight>=dropLeft+dropWidth):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(bodyOffset=this.body.offset(),dropTop-=bodyOffset.top,dropLeft-=bodyOffset.left),enoughRoomOnRight||(dropLeft=offset.left+this.container.outerWidth(!1)-dropWidth),css={left:dropLeft,width:width},above?(css.top=offset.top-dropHeight,css.bottom="auto",this.container.addClass("select2-drop-above"),$dropdown.addClass("select2-drop-above")):(css.top=dropTop,css.bottom="auto",this.container.removeClass("select2-drop-above"),$dropdown.removeClass("select2-drop-above")),css=$.extend(css,evaluate(this.opts.dropdownCss)),$dropdown.css(css)},shouldOpen:function(){var event;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(event=$.Event("select2-opening"),this.opts.element.trigger(event),!event.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),!0):!1},opening:function(){var mask,cid=this.containerEventName,scroll="scroll."+cid,resize="resize."+cid,orient="orientationchange."+cid;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),mask=$("#select2-drop-mask"),0==mask.length&&(mask=$(document.createElement("div")),mask.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),mask.hide(),mask.appendTo(this.body),mask.on("mousedown touchstart click",function(e){reinsertElement(mask);var self,dropdown=$("#select2-drop");dropdown.length>0&&(self=dropdown.data("select2"),self.opts.selectOnBlur&&self.selectHighlighted({noFocus:!0}),self.close(),e.preventDefault(),e.stopPropagation())})),this.dropdown.prev()[0]!==mask[0]&&this.dropdown.before(mask),$("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),mask.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var that=this;this.container.parents().add(window).each(function(){$(this).on(resize+" "+scroll+" "+orient,function(){that.opened()&&that.positionDropdown()})})},close:function(){if(this.opened()){var cid=this.containerEventName,scroll="scroll."+cid,resize="resize."+cid,orient="orientationchange."+cid;this.container.parents().add(window).each(function(){$(this).off(scroll).off(resize).off(orient)}),this.clearDropdownAlignmentPreference(),$("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger($.Event("select2-close"))}},externalSearch:function(term){this.open(),this.search.val(term),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return evaluate(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var children,index,child,hb,rb,y,more,results=this.results;if(index=this.highlight(),!(0>index)){if(0==index)return void results.scrollTop(0);children=this.findHighlightableChoices().find(".select2-result-label"),child=$(children[index]),hb=child.offset().top+child.outerHeight(!0),index===children.length-1&&(more=results.find("li.select2-more-results"),more.length>0&&(hb=more.offset().top+more.outerHeight(!0))),rb=results.offset().top+results.outerHeight(!0),hb>rb&&results.scrollTop(results.scrollTop()+(hb-rb)),y=child.offset().top-results.offset().top,0>y&&"none"!=child.css("display")&&results.scrollTop(results.scrollTop()+y)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(delta){for(var choices=this.findHighlightableChoices(),index=this.highlight();index>-1&&index<choices.length;){index+=delta;var choice=$(choices[index]);if(choice.hasClass("select2-result-selectable")&&!choice.hasClass("select2-disabled")&&!choice.hasClass("select2-selected")){this.highlight(index);break}}},highlight:function(index){var choice,data,choices=this.findHighlightableChoices();return 0===arguments.length?indexOf(choices.filter(".select2-highlighted")[0],choices.get()):(index>=choices.length&&(index=choices.length-1),0>index&&(index=0),this.removeHighlight(),choice=$(choices[index]),choice.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",choice.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(choice.text()),data=choice.data("select2-data"),void(data&&this.opts.element.trigger({type:"select2-highlight",val:this.id(data),choice:data})))},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(event){var el=$(event.target).closest(".select2-result-selectable");if(el.length>0&&!el.is(".select2-highlighted")){var choices=this.findHighlightableChoices();this.highlight(choices.index(el))}else 0==el.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var below,results=this.results,more=results.find("li.select2-more-results"),page=this.resultsPage+1,self=this,term=this.search.val(),context=this.context;0!==more.length&&(below=more.offset().top-results.offset().top-results.height(),below<=this.opts.loadMorePadding&&(more.addClass("select2-active"),this.opts.query({element:this.opts.element,term:term,page:page,context:context,matcher:this.opts.matcher,callback:this.bind(function(data){self.opened()&&(self.opts.populateResults.call(this,results,data.results,{term:term,page:page,context:context}),self.postprocessResults(data,!1,!1),data.more===!0?(more.detach().appendTo(results).text(evaluate(self.opts.formatLoadMore,page+1)),window.setTimeout(function(){self.loadMoreIfNeeded()},10)):more.remove(),self.positionDropdown(),self.resultsPage=page,self.context=data.context,this.opts.element.trigger({type:"select2-loaded",items:data}))})})))},tokenize:function(){},updateResults:function(initial){function postRender(){search.removeClass("select2-active"),self.positionDropdown(),self.liveRegion.text(results.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?results.text():self.opts.formatMatches(results.find(".select2-result-selectable").length))}function render(html){results.html(html),postRender()}var data,input,queryNumber,search=this.search,results=this.results,opts=this.opts,self=this,term=search.val(),lastTerm=$.data(this.container,"select2-last-term");if((initial===!0||!lastTerm||!equal(term,lastTerm))&&($.data(this.container,"select2-last-term",term),initial===!0||this.showSearchInput!==!1&&this.opened())){queryNumber=++this.queryCount;var maxSelSize=this.getMaximumSelectionSize();if(maxSelSize>=1&&(data=this.data(),$.isArray(data)&&data.length>=maxSelSize&&checkFormatter(opts.formatSelectionTooBig,"formatSelectionTooBig")))return void render("<li class='select2-selection-limit'>"+evaluate(opts.formatSelectionTooBig,maxSelSize)+"</li>");if(search.val().length<opts.minimumInputLength)return render(checkFormatter(opts.formatInputTooShort,"formatInputTooShort")?"<li class='select2-no-results'>"+evaluate(opts.formatInputTooShort,search.val(),opts.minimumInputLength)+"</li>":""),void(initial&&this.showSearch&&this.showSearch(!0));if(opts.maximumInputLength&&search.val().length>opts.maximumInputLength)return void render(checkFormatter(opts.formatInputTooLong,"formatInputTooLong")?"<li class='select2-no-results'>"+evaluate(opts.formatInputTooLong,search.val(),opts.maximumInputLength)+"</li>":"");opts.formatSearching&&0===this.findHighlightableChoices().length&&render("<li class='select2-searching'>"+evaluate(opts.formatSearching)+"</li>"),search.addClass("select2-active"),this.removeHighlight(),input=this.tokenize(),input!=undefined&&null!=input&&search.val(input),this.resultsPage=1,opts.query({element:opts.element,term:search.val(),page:this.resultsPage,context:null,matcher:opts.matcher,callback:this.bind(function(data){var def;if(queryNumber==this.queryCount){if(!this.opened())return void this.search.removeClass("select2-active");if(this.context=data.context===undefined?null:data.context,this.opts.createSearchChoice&&""!==search.val()&&(def=this.opts.createSearchChoice.call(self,search.val(),data.results),def!==undefined&&null!==def&&self.id(def)!==undefined&&null!==self.id(def)&&0===$(data.results).filter(function(){return equal(self.id(this),self.id(def))}).length&&this.opts.createSearchChoicePosition(data.results,def)),0===data.results.length&&checkFormatter(opts.formatNoMatches,"formatNoMatches"))return void render("<li class='select2-no-results'>"+evaluate(opts.formatNoMatches,search.val())+"</li>");results.empty(),self.opts.populateResults.call(this,results,data.results,{term:search.val(),page:this.resultsPage,context:null}),data.more===!0&&checkFormatter(opts.formatLoadMore,"formatLoadMore")&&(results.append("<li class='select2-more-results'>"+self.opts.escapeMarkup(evaluate(opts.formatLoadMore,this.resultsPage))+"</li>"),window.setTimeout(function(){self.loadMoreIfNeeded()},10)),this.postprocessResults(data,initial),postRender(),this.opts.element.trigger({type:"select2-loaded",items:data})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){focus(this.search)},selectHighlighted:function(options){if(this._touchMoved)return void this.clearTouchMoved();var index=this.highlight(),highlighted=this.results.find(".select2-highlighted"),data=highlighted.closest(".select2-result").data("select2-data");data?(this.highlight(index),this.onSelect(data,options)):options&&options.noFocus&&this.close()},getPlaceholder:function(){var placeholderOption;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((placeholderOption=this.getPlaceholderOption())!==undefined?placeholderOption.text():undefined)},getPlaceholderOption:function(){if(this.select){var firstOption=this.select.children("option").first();if(this.opts.placeholderOption!==undefined)return"first"===this.opts.placeholderOption&&firstOption||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);
7
+ if(""===$.trim(firstOption.text())&&""===firstOption.val())return firstOption}},initContainerWidth:function(){function resolveContainerWidth(){var style,attrs,matches,i,l,attr;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(style=this.opts.element.attr("style"),style!==undefined)for(attrs=style.split(";"),i=0,l=attrs.length;l>i;i+=1)if(attr=attrs[i].replace(/\s/g,""),matches=attr.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==matches&&matches.length>=1)return matches[1];return"resolve"===this.opts.width?(style=this.opts.element.css("width"),style.indexOf("%")>0?style:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return $.isFunction(this.opts.width)?this.opts.width():this.opts.width}var width=resolveContainerWidth.call(this);null!==width&&this.container.css("width",width)}}),SingleSelect2=clazz(AbstractSelect2,{createContainer:function(){var container=$(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""));return container},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var el,range,len;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),el=this.search.get(0),el.createTextRange?(range=el.createTextRange(),range.collapse(!1),range.select()):el.setSelectionRange&&(len=this.search.val().length,el.setSelectionRange(len,len))),""===this.search.val()&&this.nextSearchTerm!=undefined&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger($.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){$("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),cleanupJQueryElements.call(this,"selection","focusser")},initContainer:function(){var selection,elementLabel,container=this.container,dropdown=this.dropdown,idSuffix=nextUid();this.showSearch(this.opts.minimumResultsForSearch<0?!1:!0),this.selection=selection=container.find(".select2-choice"),this.focusser=container.find(".select2-focusser"),selection.find(".select2-chosen").attr("id","select2-chosen-"+idSuffix),this.focusser.attr("aria-labelledby","select2-chosen-"+idSuffix),this.results.attr("id","select2-results-"+idSuffix),this.search.attr("aria-owns","select2-results-"+idSuffix),this.focusser.attr("id","s2id_autogen"+idSuffix),elementLabel=$("label[for='"+this.opts.element.attr("id")+"']"),this.focusser.prev().text(elementLabel.text()).attr("for",this.focusser.attr("id"));var originalTitle=this.opts.element.attr("title");this.opts.element.attr("title",originalTitle||elementLabel.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text($("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){if(e.which===KEY.PAGE_UP||e.which===KEY.PAGE_DOWN)return void killEvent(e);switch(e.which){case KEY.UP:case KEY.DOWN:return this.moveHighlight(e.which===KEY.UP?-1:1),void killEvent(e);case KEY.ENTER:return this.selectHighlighted(),void killEvent(e);case KEY.TAB:return void this.selectHighlighted({noFocus:!0});case KEY.ESC:return this.cancel(e),void killEvent(e)}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==KEY.TAB&&!KEY.isControl(e)&&!KEY.isFunctionKey(e)&&e.which!==KEY.ESC){if(this.opts.openOnEnter===!1&&e.which===KEY.ENTER)return void killEvent(e);if(e.which==KEY.DOWN||e.which==KEY.UP||e.which==KEY.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),void killEvent(e)}return e.which==KEY.DELETE||e.which==KEY.BACKSPACE?(this.opts.allowClear&&this.clear(),void killEvent(e)):void 0}})),installKeyUpChangeEvent(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){if(e.stopPropagation(),this.opened())return;this.open()}})),selection.on("mousedown touchstart","abbr",this.bind(function(e){this.isInterfaceEnabled()&&(this.clear(),killEventImmediately(e),this.close(),this.selection.focus())})),selection.on("mousedown touchstart",this.bind(function(e){reinsertElement(selection),this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),killEvent(e)})),dropdown.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),selection.on("focus",this.bind(function(e){killEvent(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger($.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(triggerChange){var data=this.selection.data("select2-data");if(data){var evt=$.Event("select2-clearing");if(this.opts.element.trigger(evt),evt.isDefaultPrevented())return;var placeholderOption=this.getPlaceholderOption();this.opts.element.val(placeholderOption?placeholderOption.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),triggerChange!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(data),choice:data}),this.triggerChange({removed:data}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var self=this;this.opts.initSelection.call(null,this.opts.element,function(selected){selected!==undefined&&null!==selected&&(self.updateSelection(selected),self.close(),self.setPlaceholder(),self.nextSearchTerm=self.opts.nextSearchTerm(selected,self.search.val()))})}},isPlaceholderOptionSelected:function(){var placeholderOption;return this.getPlaceholder()===undefined?!1:(placeholderOption=this.getPlaceholderOption())!==undefined&&placeholderOption.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===undefined||null===this.opts.element.val()},prepareOpts:function(){var opts=this.parent.prepareOpts.apply(this,arguments),self=this;return"select"===opts.element.get(0).tagName.toLowerCase()?opts.initSelection=function(element,callback){var selected=element.find("option").filter(function(){return this.selected&&!this.disabled});callback(self.optionToData(selected))}:"data"in opts&&(opts.initSelection=opts.initSelection||function(element,callback){var id=element.val(),match=null;opts.query({matcher:function(term,text,el){var is_match=equal(id,opts.id(el));return is_match&&(match=el),is_match},callback:$.isFunction(callback)?function(){callback(match)}:$.noop})}),opts},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===undefined?undefined:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var placeholder=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&placeholder!==undefined){if(this.select&&this.getPlaceholderOption()===undefined)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(placeholder)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(data,initial,noHighlightUpdate){var selected=0,self=this;if(this.findHighlightableChoices().each2(function(i,elm){return equal(self.id(elm.data("select2-data")),self.opts.element.val())?(selected=i,!1):void 0}),noHighlightUpdate!==!1&&this.highlight(initial===!0&&selected>=0?selected:0),initial===!0){var min=this.opts.minimumResultsForSearch;min>=0&&this.showSearch(countResults(data.results)>=min)}},showSearch:function(showSearchInput){this.showSearchInput!==showSearchInput&&(this.showSearchInput=showSearchInput,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!showSearchInput),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!showSearchInput),$(this.dropdown,this.container).toggleClass("select2-with-searchbox",showSearchInput))},onSelect:function(data,options){if(this.triggerSelect(data)){var old=this.opts.element.val(),oldData=this.data();this.opts.element.val(this.id(data)),this.updateSelection(data),this.opts.element.trigger({type:"select2-selected",val:this.id(data),choice:data}),this.nextSearchTerm=this.opts.nextSearchTerm(data,this.search.val()),this.close(),options&&options.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),equal(old,this.id(data))||this.triggerChange({added:data,removed:oldData})}},updateSelection:function(data){var formatted,cssClass,container=this.selection.find(".select2-chosen");this.selection.data("select2-data",data),container.empty(),null!==data&&(formatted=this.opts.formatSelection(data,container,this.opts.escapeMarkup)),formatted!==undefined&&container.append(formatted),cssClass=this.opts.formatSelectionCssClass(data,container),cssClass!==undefined&&container.addClass(cssClass),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==undefined&&this.container.addClass("select2-allowclear")},val:function(){var val,triggerChange=!1,data=null,self=this,oldData=this.data();if(0===arguments.length)return this.opts.element.val();if(val=arguments[0],arguments.length>1&&(triggerChange=arguments[1]),this.select)this.select.val(val).find("option").filter(function(){return this.selected}).each2(function(i,elm){return data=self.optionToData(elm),!1}),this.updateSelection(data),this.setPlaceholder(),triggerChange&&this.triggerChange({added:data,removed:oldData});else{if(!val&&0!==val)return void this.clear(triggerChange);if(this.opts.initSelection===undefined)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(val),this.opts.initSelection(this.opts.element,function(data){self.opts.element.val(data?self.id(data):""),self.updateSelection(data),self.setPlaceholder(),triggerChange&&self.triggerChange({added:data,removed:oldData})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(value){var data,triggerChange=!1;return 0===arguments.length?(data=this.selection.data("select2-data"),data==undefined&&(data=null),data):(arguments.length>1&&(triggerChange=arguments[1]),void(value?(data=this.data(),this.opts.element.val(value?this.id(value):""),this.updateSelection(value),triggerChange&&this.triggerChange({added:value,removed:data})):this.clear(triggerChange)))}}),MultiSelect2=clazz(AbstractSelect2,{createContainer:function(){var container=$(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return container},prepareOpts:function(){var opts=this.parent.prepareOpts.apply(this,arguments),self=this;return"select"===opts.element.get(0).tagName.toLowerCase()?opts.initSelection=function(element,callback){var data=[];element.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(i,elm){data.push(self.optionToData(elm))}),callback(data)}:"data"in opts&&(opts.initSelection=opts.initSelection||function(element,callback){var ids=splitVal(element.val(),opts.separator),matches=[];opts.query({matcher:function(term,text,el){var is_match=$.grep(ids,function(id){return equal(id,opts.id(el))}).length;return is_match&&matches.push(el),is_match},callback:$.isFunction(callback)?function(){for(var ordered=[],i=0;i<ids.length;i++)for(var id=ids[i],j=0;j<matches.length;j++){var match=matches[j];if(equal(id,opts.id(match))){ordered.push(match),matches.splice(j,1);break}}callback(ordered)}:$.noop})}),opts},selectChoice:function(choice){var selected=this.container.find(".select2-search-choice-focus");selected.length&&choice&&choice[0]==selected[0]||(selected.length&&this.opts.element.trigger("choice-deselected",selected),selected.removeClass("select2-search-choice-focus"),choice&&choice.length&&(this.close(),choice.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",choice)))},destroy:function(){$("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),cleanupJQueryElements.call(this,"searchContainer","selection")},initContainer:function(){var selection,selector=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=selection=this.container.find(selector);var _this=this;this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(){_this.search[0].focus(),_this.selectChoice($(this))}),this.search.attr("id","s2id_autogen"+nextUid()),this.search.prev().text($("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){++this.keydowns;var selected=selection.find(".select2-search-choice-focus"),prev=selected.prev(".select2-search-choice:not(.select2-locked)"),next=selected.next(".select2-search-choice:not(.select2-locked)"),pos=getCursorInfo(this.search);if(selected.length&&(e.which==KEY.LEFT||e.which==KEY.RIGHT||e.which==KEY.BACKSPACE||e.which==KEY.DELETE||e.which==KEY.ENTER)){var selectedChoice=selected;return e.which==KEY.LEFT&&prev.length?selectedChoice=prev:e.which==KEY.RIGHT?selectedChoice=next.length?next:null:e.which===KEY.BACKSPACE?this.unselect(selected.first())&&(this.search.width(10),selectedChoice=prev.length?prev:next):e.which==KEY.DELETE?this.unselect(selected.first())&&(this.search.width(10),selectedChoice=next.length?next:null):e.which==KEY.ENTER&&(selectedChoice=null),this.selectChoice(selectedChoice),killEvent(e),void(selectedChoice&&selectedChoice.length||this.open())}if((e.which===KEY.BACKSPACE&&1==this.keydowns||e.which==KEY.LEFT)&&0==pos.offset&&!pos.length)return this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last()),void killEvent(e);if(this.selectChoice(null),this.opened())switch(e.which){case KEY.UP:case KEY.DOWN:return this.moveHighlight(e.which===KEY.UP?-1:1),void killEvent(e);case KEY.ENTER:return this.selectHighlighted(),void killEvent(e);case KEY.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case KEY.ESC:return this.cancel(e),void killEvent(e)}if(e.which!==KEY.TAB&&!KEY.isControl(e)&&!KEY.isFunctionKey(e)&&e.which!==KEY.BACKSPACE&&e.which!==KEY.ESC){if(e.which===KEY.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===KEY.PAGE_UP||e.which===KEY.PAGE_DOWN)&&killEvent(e),e.which===KEY.ENTER&&killEvent(e)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),e.stopImmediatePropagation(),this.opts.element.trigger($.Event("select2-blur"))})),this.container.on("click",selector,this.bind(function(e){this.isInterfaceEnabled()&&($(e.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.open(),this.focusSearch(),e.preventDefault()))})),this.container.on("focus",selector,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var self=this;this.opts.initSelection.call(null,this.opts.element,function(data){data!==undefined&&null!==data&&(self.updateSelection(data),self.close(),self.clearSearch())})}},clearSearch:function(){var placeholder=this.getPlaceholder(),maxWidth=this.getMaxSearchWidth();placeholder!==undefined&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(placeholder).addClass("select2-default"),this.search.width(maxWidth>0?maxWidth:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=undefined&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger($.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(data){var ids=[],filtered=[],self=this;$(data).each(function(){indexOf(self.id(this),ids)<0&&(ids.push(self.id(this)),filtered.push(this))}),data=filtered,this.selection.find(".select2-search-choice").remove(),$(data).each(function(){self.addSelectedChoice(this)}),self.postprocessResults()},tokenize:function(){var input=this.search.val();input=this.opts.tokenizer.call(this,input,this.data(),this.bind(this.onSelect),this.opts),null!=input&&input!=undefined&&(this.search.val(input),input.length>0&&this.open())},onSelect:function(data,options){this.triggerSelect(data)&&(this.addSelectedChoice(data),this.opts.element.trigger({type:"selected",val:this.id(data),choice:data}),this.nextSearchTerm=this.opts.nextSearchTerm(data,this.search.val()),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(data,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=undefined&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:data}),options&&options.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(data){var formatted,cssClass,enableChoice=!data.locked,enabledItem=$("<li class='select2-search-choice'> <div></div> <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),disabledItem=$("<li class='select2-search-choice select2-locked'><div></div></li>"),choice=enableChoice?enabledItem:disabledItem,id=this.id(data),val=this.getVal();formatted=this.opts.formatSelection(data,choice.find("div"),this.opts.escapeMarkup),formatted!=undefined&&choice.find("div").replaceWith("<div>"+formatted+"</div>"),cssClass=this.opts.formatSelectionCssClass(data,choice.find("div")),cssClass!=undefined&&choice.addClass(cssClass),enableChoice&&choice.find(".select2-search-choice-close").on("mousedown",killEvent).on("click dblclick",this.bind(function(e){this.isInterfaceEnabled()&&(this.unselect($(e.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),killEvent(e),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),choice.data("select2-data",data),choice.insertBefore(this.searchContainer),val.push(id),this.setVal(val)},unselect:function(selected){var data,index,val=this.getVal();if(selected=selected.closest(".select2-search-choice"),0===selected.length)throw"Invalid argument: "+selected+". Must be .select2-search-choice";if(data=selected.data("select2-data")){var evt=$.Event("select2-removing");if(evt.val=this.id(data),evt.choice=data,this.opts.element.trigger(evt),evt.isDefaultPrevented())return!1;for(;(index=indexOf(this.id(data),val))>=0;)val.splice(index,1),this.setVal(val),this.select&&this.postprocessResults();return selected.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(data),choice:data}),this.triggerChange({removed:data}),!0}},postprocessResults:function(data,initial,noHighlightUpdate){var val=this.getVal(),choices=this.results.find(".select2-result"),compound=this.results.find(".select2-result-with-children"),self=this;choices.each2(function(i,choice){var id=self.id(choice.data("select2-data"));indexOf(id,val)>=0&&(choice.addClass("select2-selected"),choice.find(".select2-result-selectable").addClass("select2-selected"))}),compound.each2(function(i,choice){choice.is(".select2-result-selectable")||0!==choice.find(".select2-result-selectable:not(.select2-selected)").length||choice.addClass("select2-selected")}),-1==this.highlight()&&noHighlightUpdate!==!1&&self.highlight(0),!this.opts.createSearchChoice&&!choices.filter(".select2-result:not(.select2-selected)").length>0&&(!data||data&&!data.more&&0===this.results.find(".select2-no-results").length)&&checkFormatter(self.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+evaluate(self.opts.formatNoMatches,self.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-getSideBorderPadding(this.search)},resizeSearch:function(){var minimumWidth,left,maxWidth,containerLeft,searchWidth,sideBorderPadding=getSideBorderPadding(this.search);minimumWidth=measureTextWidth(this.search)+10,left=this.search.offset().left,maxWidth=this.selection.width(),containerLeft=this.selection.offset().left,searchWidth=maxWidth-(left-containerLeft)-sideBorderPadding,minimumWidth>searchWidth&&(searchWidth=maxWidth-sideBorderPadding),40>searchWidth&&(searchWidth=maxWidth-sideBorderPadding),0>=searchWidth&&(searchWidth=minimumWidth),this.search.width(Math.floor(searchWidth))},getVal:function(){var val;return this.select?(val=this.select.val(),null===val?[]:val):(val=this.opts.element.val(),splitVal(val,this.opts.separator))},setVal:function(val){var unique;this.select?this.select.val(val):(unique=[],$(val).each(function(){indexOf(this,unique)<0&&unique.push(this)}),this.opts.element.val(0===unique.length?"":unique.join(this.opts.separator)))},buildChangeDetails:function(old,current){for(var current=current.slice(0),old=old.slice(0),i=0;i<current.length;i++)for(var j=0;j<old.length;j++)equal(this.opts.id(current[i]),this.opts.id(old[j]))&&(current.splice(i,1),i>0&&i--,old.splice(j,1),j--);return{added:current,removed:old}},val:function(val,triggerChange){var oldData,self=this;if(0===arguments.length)return this.getVal();if(oldData=this.data(),oldData.length||(oldData=[]),!val&&0!==val)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(triggerChange&&this.triggerChange({added:this.data(),removed:oldData}));if(this.setVal(val),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),triggerChange&&this.triggerChange(this.buildChangeDetails(oldData,this.data()));else{if(this.opts.initSelection===undefined)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(data){var ids=$.map(data,self.id);self.setVal(ids),self.updateSelection(data),self.clearSearch(),triggerChange&&self.triggerChange(self.buildChangeDetails(oldData,self.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var val=[],self=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){val.push(self.opts.id($(this).data("select2-data")))}),this.setVal(val),this.triggerChange()},data:function(values,triggerChange){var ids,old,self=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return $(this).data("select2-data")}).get():(old=this.data(),values||(values=[]),ids=$.map(values,function(e){return self.opts.id(e)}),this.setVal(ids),this.updateSelection(values),this.clearSearch(),triggerChange&&this.triggerChange(this.buildChangeDetails(old,this.data())),void 0)}}),$.fn.select2=function(){var opts,select2,method,value,multiple,args=Array.prototype.slice.call(arguments,0),allowedMethods=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],valueMethods=["opened","isFocused","container","dropdown"],propertyMethods=["val","data"],methodsMap={search:"externalSearch"};return this.each(function(){if(0===args.length||"object"==typeof args[0])opts=0===args.length?{}:$.extend({},args[0]),opts.element=$(this),"select"===opts.element.get(0).tagName.toLowerCase()?multiple=opts.element.prop("multiple"):(multiple=opts.multiple||!1,"tags"in opts&&(opts.multiple=multiple=!0)),select2=multiple?new window.Select2["class"].multi:new window.Select2["class"].single,select2.init(opts);else{if("string"!=typeof args[0])throw"Invalid arguments to select2 plugin: "+args;if(indexOf(args[0],allowedMethods)<0)throw"Unknown method: "+args[0];if(value=undefined,select2=$(this).data("select2"),select2===undefined)return;if(method=args[0],"container"===method?value=select2.container:"dropdown"===method?value=select2.dropdown:(methodsMap[method]&&(method=methodsMap[method]),value=select2[method].apply(select2,args.slice(1))),indexOf(args[0],valueMethods)>=0||indexOf(args[0],propertyMethods)>=0&&1==args.length)return!1}}),value===undefined?this:value},$.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(result,container,query,escapeMarkup){var markup=[];return markMatch(result.text,query.term,markup,escapeMarkup),markup.join("")},formatSelection:function(data,container,escapeMarkup){return data?escapeMarkup(data.text):undefined},sortResults:function(results){return results},formatResultCssClass:function(data){return data.css},formatSelectionCssClass:function(){return undefined},formatMatches:function(matches){return matches+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(input,min){var n=min-input.length;return"Please enter "+n+" or more character"+(1==n?"":"s")},formatInputTooLong:function(input,max){var n=input.length-max;return"Please delete "+n+" character"+(1==n?"":"s")},formatSelectionTooBig:function(limit){return"You can only select "+limit+" item"+(1==limit?"":"s")},formatLoadMore:function(){return"Loading more results…"},formatSearching:function(){return"Searching…"},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==undefined?null:e.id},matcher:function(term,text){return stripDiacritics(""+text).toUpperCase().indexOf(stripDiacritics(""+term).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:defaultTokenizer,escapeMarkup:defaultEscapeMarkup,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(c){return c},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return undefined},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(instance){var supportsTouchEvents="ontouchstart"in window||navigator.msMaxTouchPoints>0;return supportsTouchEvents&&instance.opts.minimumResultsForSearch<0?!1:!0}},$.fn.select2.ajaxDefaults={transport:$.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:ajax,local:local,tags:tags},util:{debounce:debounce,markMatch:markMatch,escapeMarkup:defaultEscapeMarkup,stripDiacritics:stripDiacritics},"class":{"abstract":AbstractSelect2,single:SingleSelect2,multi:MultiSelect2}}}}(jQuery),jQuery(document).ready(function($){$("#filter_action, #filter_content").change(function(){$("#leadin-contacts-filter-button").addClass("button-primary")})});
assets/js/{admin/jquery.lazyload.min.js → build/leadin-lazyload.js} RENAMED
@@ -1,2 +1,15 @@
1
  /*! Lazy Load 1.9.3 - MIT license - Copyright 2010-2013 Mika Tuupola */
2
  !function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("<img />").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document);
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /*! Lazy Load 1.9.3 - MIT license - Copyright 2010-2013 Mika Tuupola */
2
  !function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("<img />").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document);
3
+
4
+ jQuery(document).ready( function ( $ ) {
5
+ $("img.lazy").lazyload({
6
+ effect : "fadeIn"
7
+ });
8
+
9
+ $('.show_all_faces').on('click', function ( e ) {
10
+ var $this = $(this);
11
+ $this.closest('td').find('.hidden_face').removeClass('hidden_face');
12
+ $this.remove();
13
+ $("html,body").trigger("scroll");
14
+ });
15
+ });
assets/js/build/leadin-lazyload.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("<img />").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document),jQuery(document).ready(function($){$("img.lazy").lazyload({effect:"fadeIn"}),$(".show_all_faces").on("click",function(){var $this=$(this);$this.closest("td").find(".hidden_face").removeClass("hidden_face"),$this.remove(),$("html,body").trigger("scroll")})});
assets/js/build/leadin-subscribe.js CHANGED
@@ -338,6 +338,9 @@
338
 
339
  }).call(this);
340
 
 
 
 
341
  jQuery(document).ready( function ( $ ) {
342
  var li_subscribe_flag = $.cookie('li_subscribe');
343
 
@@ -353,7 +356,8 @@ jQuery(document).ready( function ( $ ) {
353
  }
354
  else
355
  {
356
- $.cookie("li_subscribe", 'ignore', {path: "/", domain: ""});
 
357
  }
358
  });
359
  }
@@ -392,12 +396,28 @@ function bind_leadin_subscribe_widget ()
392
  showCloseButton: true,
393
  className: 'leadin-subscribe ' + $('#leadin-subscribe-vex-class').val(),
394
  message: $('#leadin-subscribe-heading').val(),
395
- input: '<input id="leadin-subscribe-email" name="email" type="email" placeholder="Email address" required />' +
396
- (($('#leadin-subscribe-name-fields').val()==0) ? '' : '<input id="leadin-subscribe-fname" name="fname" type="text" placeholder="First Name" required /><input id="leadin-subscribe-lname" name="lname" type="text" placeholder="Last Name" required />') +
397
- (($('#leadin-subscribe-phone-field').val()==0) ? '' : '<input id="leadin-subscribe-phone" name="phone" type="tel" placeholder="Phone" required />'),
398
  buttons: [$.extend({}, vex.dialog.buttons.YES, { text: ( $('#leadin-subscribe-btn-label').val() ? $('#leadin-subscribe-btn-label').val() : 'SUBSCRIBE' ) })],
399
  onSubmit: function ( data )
400
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  $('.vex-dialog-form').fadeOut(300, function ( e ) {
402
  $('.vex-dialog-form').html(
403
  '<div class="vex-close"></div>' +
@@ -410,15 +430,15 @@ function bind_leadin_subscribe_widget ()
410
  });
411
 
412
  leadin_submit_form($('.leadin-subscribe form'), $, 'subscribe');
413
- $.cookie("li_subscribe", 'ignore', {path: "/", domain: ""});
414
  return false;
415
  },
416
  callback: function(data) {
417
  if (data === false) {
418
- $.cookie("li_subscribe", 'ignore', {path: "/", domain: ""});
419
  }
420
 
421
- $.cookie("li_subscribe", 'ignore', {path: "/", domain: ""});
422
  }
423
  });
424
 
338
 
339
  }).call(this);
340
 
341
+ var ignore_date = new Date();
342
+ ignore_date.setTime(ignore_date.getTime() + (60 * 60 * 24 * 14 * 1000));
343
+
344
  jQuery(document).ready( function ( $ ) {
345
  var li_subscribe_flag = $.cookie('li_subscribe');
346
 
356
  }
357
  else
358
  {
359
+ alert('ignore ' + ignore_date);
360
+ $.cookie("li_subscribe", 'ignore', {path: "/", domain: "", expires: ignore_date});
361
  }
362
  });
363
  }
396
  showCloseButton: true,
397
  className: 'leadin-subscribe ' + $('#leadin-subscribe-vex-class').val(),
398
  message: $('#leadin-subscribe-heading').val(),
399
+ input: '<input id="leadin-subscribe-email" name="email" type="email" placeholder="Email address" />' +
400
+ (($('#leadin-subscribe-name-fields').val()==0) ? '' : '<input id="leadin-subscribe-fname" name="fname" type="text" placeholder="First Name" /><input id="leadin-subscribe-lname" name="lname" type="text" placeholder="Last Name" />') +
401
+ (($('#leadin-subscribe-phone-field').val()==0) ? '' : '<input id="leadin-subscribe-phone" name="phone" type="tel" placeholder="Phone" />'),
402
  buttons: [$.extend({}, vex.dialog.buttons.YES, { text: ( $('#leadin-subscribe-btn-label').val() ? $('#leadin-subscribe-btn-label').val() : 'SUBSCRIBE' ) })],
403
  onSubmit: function ( data )
404
  {
405
+ $subscribe_form = $(this);
406
+ $subscribe_form.find('input.error').removeClass('error');
407
+ var form_validated = true;
408
+
409
+ $subscribe_form.find('input').each( function ( e ) {
410
+ var $input = $(this);
411
+ if ( ! $input.val() )
412
+ {
413
+ $input.addClass('error');
414
+ form_validated = false;
415
+ }
416
+ });
417
+
418
+ if ( ! form_validated )
419
+ return false;
420
+
421
  $('.vex-dialog-form').fadeOut(300, function ( e ) {
422
  $('.vex-dialog-form').html(
423
  '<div class="vex-close"></div>' +
430
  });
431
 
432
  leadin_submit_form($('.leadin-subscribe form'), $, 'subscribe');
433
+ $.cookie("li_subscribe", 'ignore', {path: "/", domain: "", expires: ignore_date});
434
  return false;
435
  },
436
  callback: function(data) {
437
  if (data === false) {
438
+ $.cookie("li_subscribe", 'ignore', {path: "/", domain: "", expires: ignore_date});
439
  }
440
 
441
+ $.cookie("li_subscribe", 'ignore', {path: "/", domain: "", expires: ignore_date});
442
  }
443
  });
444
 
assets/js/build/leadin-subscribe.min.js CHANGED
@@ -1 +1 @@
1
- function bind_leadin_subscribe_widget(){!function(){var a=jQuery,b={};b.vex=void 0,b.init=function(){a(window).scroll(function(){a(window).scrollTop()+a(window).height()>a(document).height()/2&&b.open()})},b.open=function(){return b.vex?b._open():(b.vex=vex.dialog.open({showCloseButton:!0,className:"leadin-subscribe "+a("#leadin-subscribe-vex-class").val(),message:a("#leadin-subscribe-heading").val(),input:'<input id="leadin-subscribe-email" name="email" type="email" placeholder="Email address" required />'+(0==a("#leadin-subscribe-name-fields").val()?"":'<input id="leadin-subscribe-fname" name="fname" type="text" placeholder="First Name" required /><input id="leadin-subscribe-lname" name="lname" type="text" placeholder="Last Name" required />')+(0==a("#leadin-subscribe-phone-field").val()?"":'<input id="leadin-subscribe-phone" name="phone" type="tel" placeholder="Phone" required />'),buttons:[a.extend({},vex.dialog.buttons.YES,{text:a("#leadin-subscribe-btn-label").val()?a("#leadin-subscribe-btn-label").val():"SUBSCRIBE"})],onSubmit:function(){return a(".vex-dialog-form").fadeOut(300,function(){a(".vex-dialog-form").html('<div class="vex-close"></div><h3>Thanks!<br>You should receive a confirmation email in your inbox shortly.</h3><div><span class="powered-by">Powered by LeadIn</span><a href="http://leadin.com/wordpress-subscribe-widget/?utm_campaign=subscribe_widget&utm_medium=email&utm_source='+window.location.host+'"><img alt="LeadIn" height="20px" width="99px" src="http://leadin.com/wp-content/themes/LeadIn-WP-Theme/library/images/logos/Leadin_logo@2x.png" alt="leadin.com"/></a></div>').css("text-align","center").fadeIn(250)}),leadin_submit_form(a(".leadin-subscribe form"),a,"subscribe"),a.cookie("li_subscribe","ignore",{path:"/",domain:""}),!1},callback:function(b){b===!1&&a.cookie("li_subscribe","ignore",{path:"/",domain:""}),a.cookie("li_subscribe","ignore",{path:"/",domain:""})}}),void a(".leadin-subscribe form.vex-dialog-form").append('<a href="http://leadin.com/pop-subscribe-form-plugin-wordpress/?utm_campaign=subscribe_widget&utm_medium=widget&utm_source='+document.URL+'" id="leadin-subscribe-powered-by" class="leadin-subscribe-powered-by">Powered by LeadIn</a>'))},b._open=function(){b.vex.parent().removeClass("vex-closing")},b.close=function(){b.vex&&b.vex.parent().addClass("vex-closing")},b.init(),window.subscribe=b}()}function leadin_subscribe_check_mobile(a){var b=!1;return"none"==a("#leadin-subscribe-mobile-check").css("display")&&(b=!0),b}function leadin_subscribe_show(){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_subscribe_show"},success:function(){},error:function(){}})}(function(){var a;a=function(a){var b,c;return b=!1,a(function(){var d;return d=(document.body||document.documentElement).style,b=void 0!==d.animation||void 0!==d.WebkitAnimation||void 0!==d.MozAnimation||void 0!==d.MsAnimation||void 0!==d.OAnimation,a(window).bind("keyup.vex",function(a){return 27===a.keyCode?c.closeByEscape():void 0})}),c={globalID:1,animationEndEvent:"animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",baseClassNames:{vex:"vex",content:"vex-content",overlay:"vex-overlay",close:"vex-close",closing:"vex-closing",open:"vex-open"},defaultOptions:{content:"",showCloseButton:!0,escapeButtonCloses:!0,overlayClosesOnClick:!0,appendLocation:"body",className:"",css:{},overlayClassName:"",overlayCSS:{},contentClassName:"",contentCSS:{},closeClassName:"",closeCSS:{}},open:function(b){return b=a.extend({},c.defaultOptions,b),b.id=c.globalID,c.globalID+=1,b.$vex=a("<div>").addClass(c.baseClassNames.vex).addClass(b.className).css(b.css).data({vex:b}),b.$vexOverlay=a("<div>").addClass(c.baseClassNames.overlay).addClass(b.overlayClassName).css(b.overlayCSS).data({vex:b}),b.overlayClosesOnClick&&b.$vexOverlay.bind("click.vex",function(b){return b.target===this?c.close(a(this).data().vex.id):void 0}),b.$vex.append(b.$vexOverlay),b.$vexContent=a("<div>").addClass(c.baseClassNames.content).addClass(b.contentClassName).css(b.contentCSS).append(b.content).data({vex:b}),b.$vex.append(b.$vexContent),b.showCloseButton&&(b.$closeButton=a("<div>").addClass(c.baseClassNames.close).addClass(b.closeClassName).css(b.closeCSS).data({vex:b}).bind("click.vex",function(){return c.close(a(this).data().vex.id)}),b.$vexContent.append(b.$closeButton)),a(b.appendLocation).append(b.$vex),c.setupBodyClassName(b.$vex),b.afterOpen&&b.afterOpen(b.$vexContent,b),setTimeout(function(){return b.$vexContent.trigger("vexOpen",b)},0),b.$vexContent},getAllVexes:function(){return a("."+c.baseClassNames.vex+':not(".'+c.baseClassNames.closing+'") .'+c.baseClassNames.content)},getVexByID:function(b){return c.getAllVexes().filter(function(){return a(this).data().vex.id===b})},close:function(a){var b;if(!a){if(b=c.getAllVexes().last(),!b.length)return!1;a=b.data().vex.id}return c.closeByID(a)},closeAll:function(){var b;return b=c.getAllVexes().map(function(){return a(this).data().vex.id}).toArray(),(null!=b?b.length:void 0)?(a.each(b.reverse(),function(a,b){return c.closeByID(b)}),!0):!1},closeByID:function(d){var e,f,g,h,i;return f=c.getVexByID(d),f.length?(e=f.data().vex.$vex,i=a.extend({},f.data().vex),g=function(){return i.beforeClose?i.beforeClose(f,i):void 0},h=function(){return f.trigger("vexClose",i),e.remove(),i.afterClose?i.afterClose(f,i):void 0},b?(g(),e.unbind(c.animationEndEvent).bind(c.animationEndEvent,function(){return h()}).addClass(c.baseClassNames.closing)):(g(),h()),!0):void 0},closeByEscape:function(){var b,d,e;return e=c.getAllVexes().map(function(){return a(this).data().vex.id}).toArray(),(null!=e?e.length:void 0)?(d=Math.max.apply(Math,e),b=c.getVexByID(d),b.data().vex.escapeButtonCloses!==!0?!1:c.closeByID(d)):!1},setupBodyClassName:function(b){return b.bind("vexOpen.vex",function(){return a("body").addClass(c.baseClassNames.open)}).bind("vexClose.vex",function(){return c.getAllVexes().length?void 0:a("body").removeClass(c.baseClassNames.open)})},hideLoading:function(){return a(".vex-loading-spinner").remove()},showLoading:function(){return c.hideLoading(),a("body").append('<div class="vex-loading-spinner '+c.defaultOptions.className+'"></div>')}}},"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):window.vex=a(jQuery)}).call(this),function(){var a;a=function(a,b){var c,d;return null==b?a.error("Vex is required to use vex.dialog"):(c=function(b){var c;return c={},a.each(b.serializeArray(),function(){return c[this.name]?(c[this.name].push||(c[this.name]=[c[this.name]]),c[this.name].push(this.value||"")):c[this.name]=this.value||""}),c},d={},d.buttons={YES:{text:"OK",type:"submit",className:"vex-dialog-button-primary"},NO:{text:"Cancel",type:"button",className:"vex-dialog-button-secondary",click:function(a){return a.data().vex.value=!1,b.close(a.data().vex.id)}}},d.defaultOptions={callback:function(){},afterOpen:function(){},message:"Message",input:'<input name="vex" type="hidden" value="_vex-empty-value" />',value:!1,buttons:[d.buttons.YES,d.buttons.NO],showCloseButton:!1,onSubmit:function(e){var f,g;return f=a(this),g=f.parent(),e.preventDefault(),e.stopPropagation(),g.data().vex.value=d.getFormValueOnSubmit(c(f)),b.close(g.data().vex.id)},focusFirstInput:!0},d.defaultAlertOptions={message:"Alert",buttons:[d.buttons.YES]},d.defaultConfirmOptions={message:"Confirm"},d.open=function(c){var e;return c=a.extend({},b.defaultOptions,d.defaultOptions,c),c.content=d.buildDialogForm(c),c.beforeClose=function(a){return c.callback(a.data().vex.value)},e=b.open(c),c.focusFirstInput&&e.find('input[type="submit"], textarea, input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"]').first().focus(),e},d.alert=function(b){return"string"==typeof b&&(b={message:b}),b=a.extend({},d.defaultAlertOptions,b),d.open(b)},d.confirm=function(b){return"string"==typeof b?a.error("dialog.confirm(options) requires options.callback."):(b=a.extend({},d.defaultConfirmOptions,b),d.open(b))},d.prompt=function(b){var c;return"string"==typeof b?a.error("dialog.prompt(options) requires options.callback."):(c={message:'<label for="vex">'+(b.label||"Prompt:")+"</label>",input:'<input name="vex" type="text" class="vex-dialog-prompt-input" placeholder="'+(b.placeholder||"")+'" value="'+(b.value||"")+'" />'},b=a.extend({},c,b),d.open(b))},d.buildDialogForm=function(b){var c,e,f;return c=a('<form class="vex-dialog-form" />'),f=a('<div class="vex-dialog-message" />'),e=a('<div class="vex-dialog-input" />'),c.append(f.append(b.message)).append(e.append(b.input)).append(d.buttonsToDOM(b.buttons)).bind("submit.vex",b.onSubmit),c},d.getFormValueOnSubmit=function(a){return a.vex||""===a.vex?"_vex-empty-value"===a.vex?!0:a.vex:a},d.buttonsToDOM=function(c){var d;return d=a('<div class="vex-dialog-buttons" />'),a.each(c,function(e,f){return d.append(a('<input type="'+f.type+'" />').val(f.text).addClass(f.className+" vex-dialog-button "+(0===e?"vex-first ":"")+(e===c.length-1?"vex-last ":"")).bind("click.vex",function(c){return f.click?f.click(a(this).parents("."+b.baseClassNames.content),c):void 0}))}),d},d)},"function"==typeof define&&define.amd?define(["jquery","vex"],a):"object"==typeof exports?module.exports=a(require("jquery"),require("vex")):window.vex.dialog=a(window.jQuery,window.vex)}.call(this),jQuery(document).ready(function(a){var b=a.cookie("li_subscribe");leadin_subscribe_check_mobile(a)||(b?"show"==b&&bind_leadin_subscribe_widget():leadin_check_visitor_status(a.cookie("li_hash"),function(b){"subscribe"!=b?(a.cookie("li_subscribe","show",{path:"/",domain:""}),bind_leadin_subscribe_widget()):a.cookie("li_subscribe","ignore",{path:"/",domain:""})}))});
1
+ function bind_leadin_subscribe_widget(){!function(){var $=jQuery,subscribe={};subscribe.vex=void 0,subscribe.init=function(){$(window).scroll(function(){$(window).scrollTop()+$(window).height()>$(document).height()/2&&subscribe.open()})},subscribe.open=function(){return subscribe.vex?subscribe._open():(subscribe.vex=vex.dialog.open({showCloseButton:!0,className:"leadin-subscribe "+$("#leadin-subscribe-vex-class").val(),message:$("#leadin-subscribe-heading").val(),input:'<input id="leadin-subscribe-email" name="email" type="email" placeholder="Email address" />'+(0==$("#leadin-subscribe-name-fields").val()?"":'<input id="leadin-subscribe-fname" name="fname" type="text" placeholder="First Name" /><input id="leadin-subscribe-lname" name="lname" type="text" placeholder="Last Name" />')+(0==$("#leadin-subscribe-phone-field").val()?"":'<input id="leadin-subscribe-phone" name="phone" type="tel" placeholder="Phone" />'),buttons:[$.extend({},vex.dialog.buttons.YES,{text:$("#leadin-subscribe-btn-label").val()?$("#leadin-subscribe-btn-label").val():"SUBSCRIBE"})],onSubmit:function(){$subscribe_form=$(this),$subscribe_form.find("input.error").removeClass("error");var form_validated=!0;return $subscribe_form.find("input").each(function(){var $input=$(this);$input.val()||($input.addClass("error"),form_validated=!1)}),form_validated?($(".vex-dialog-form").fadeOut(300,function(){$(".vex-dialog-form").html('<div class="vex-close"></div><h3>Thanks!<br>You should receive a confirmation email in your inbox shortly.</h3><div><span class="powered-by">Powered by LeadIn</span><a href="http://leadin.com/wordpress-subscribe-widget/?utm_campaign=subscribe_widget&utm_medium=email&utm_source='+window.location.host+'"><img alt="LeadIn" height="20px" width="99px" src="http://leadin.com/wp-content/themes/LeadIn-WP-Theme/library/images/logos/Leadin_logo@2x.png" alt="leadin.com"/></a></div>').css("text-align","center").fadeIn(250)}),leadin_submit_form($(".leadin-subscribe form"),$,"subscribe"),$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date}),!1):!1},callback:function(data){data===!1&&$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date}),$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date})}}),void $(".leadin-subscribe form.vex-dialog-form").append('<a href="http://leadin.com/pop-subscribe-form-plugin-wordpress/?utm_campaign=subscribe_widget&utm_medium=widget&utm_source='+document.URL+'" id="leadin-subscribe-powered-by" class="leadin-subscribe-powered-by">Powered by LeadIn</a>'))},subscribe._open=function(){subscribe.vex.parent().removeClass("vex-closing")},subscribe.close=function(){subscribe.vex&&subscribe.vex.parent().addClass("vex-closing")},subscribe.init(),window.subscribe=subscribe}()}function leadin_subscribe_check_mobile($){var is_mobile=!1;return"none"==$("#leadin-subscribe-mobile-check").css("display")&&(is_mobile=!0),is_mobile}function leadin_subscribe_show(){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_subscribe_show"},success:function(){},error:function(){}})}(function(){var vexFactory;vexFactory=function($){var animationEndSupport,vex;return animationEndSupport=!1,$(function(){var s;return s=(document.body||document.documentElement).style,animationEndSupport=void 0!==s.animation||void 0!==s.WebkitAnimation||void 0!==s.MozAnimation||void 0!==s.MsAnimation||void 0!==s.OAnimation,$(window).bind("keyup.vex",function(event){return 27===event.keyCode?vex.closeByEscape():void 0})}),vex={globalID:1,animationEndEvent:"animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",baseClassNames:{vex:"vex",content:"vex-content",overlay:"vex-overlay",close:"vex-close",closing:"vex-closing",open:"vex-open"},defaultOptions:{content:"",showCloseButton:!0,escapeButtonCloses:!0,overlayClosesOnClick:!0,appendLocation:"body",className:"",css:{},overlayClassName:"",overlayCSS:{},contentClassName:"",contentCSS:{},closeClassName:"",closeCSS:{}},open:function(options){return options=$.extend({},vex.defaultOptions,options),options.id=vex.globalID,vex.globalID+=1,options.$vex=$("<div>").addClass(vex.baseClassNames.vex).addClass(options.className).css(options.css).data({vex:options}),options.$vexOverlay=$("<div>").addClass(vex.baseClassNames.overlay).addClass(options.overlayClassName).css(options.overlayCSS).data({vex:options}),options.overlayClosesOnClick&&options.$vexOverlay.bind("click.vex",function(e){return e.target===this?vex.close($(this).data().vex.id):void 0}),options.$vex.append(options.$vexOverlay),options.$vexContent=$("<div>").addClass(vex.baseClassNames.content).addClass(options.contentClassName).css(options.contentCSS).append(options.content).data({vex:options}),options.$vex.append(options.$vexContent),options.showCloseButton&&(options.$closeButton=$("<div>").addClass(vex.baseClassNames.close).addClass(options.closeClassName).css(options.closeCSS).data({vex:options}).bind("click.vex",function(){return vex.close($(this).data().vex.id)}),options.$vexContent.append(options.$closeButton)),$(options.appendLocation).append(options.$vex),vex.setupBodyClassName(options.$vex),options.afterOpen&&options.afterOpen(options.$vexContent,options),setTimeout(function(){return options.$vexContent.trigger("vexOpen",options)},0),options.$vexContent},getAllVexes:function(){return $("."+vex.baseClassNames.vex+':not(".'+vex.baseClassNames.closing+'") .'+vex.baseClassNames.content)},getVexByID:function(id){return vex.getAllVexes().filter(function(){return $(this).data().vex.id===id})},close:function(id){var $lastVex;if(!id){if($lastVex=vex.getAllVexes().last(),!$lastVex.length)return!1;id=$lastVex.data().vex.id}return vex.closeByID(id)},closeAll:function(){var ids;return ids=vex.getAllVexes().map(function(){return $(this).data().vex.id}).toArray(),(null!=ids?ids.length:void 0)?($.each(ids.reverse(),function(index,id){return vex.closeByID(id)}),!0):!1},closeByID:function(id){var $vex,$vexContent,beforeClose,close,options;return $vexContent=vex.getVexByID(id),$vexContent.length?($vex=$vexContent.data().vex.$vex,options=$.extend({},$vexContent.data().vex),beforeClose=function(){return options.beforeClose?options.beforeClose($vexContent,options):void 0},close=function(){return $vexContent.trigger("vexClose",options),$vex.remove(),options.afterClose?options.afterClose($vexContent,options):void 0},animationEndSupport?(beforeClose(),$vex.unbind(vex.animationEndEvent).bind(vex.animationEndEvent,function(){return close()}).addClass(vex.baseClassNames.closing)):(beforeClose(),close()),!0):void 0},closeByEscape:function(){var $lastVex,id,ids;return ids=vex.getAllVexes().map(function(){return $(this).data().vex.id}).toArray(),(null!=ids?ids.length:void 0)?(id=Math.max.apply(Math,ids),$lastVex=vex.getVexByID(id),$lastVex.data().vex.escapeButtonCloses!==!0?!1:vex.closeByID(id)):!1},setupBodyClassName:function($vex){return $vex.bind("vexOpen.vex",function(){return $("body").addClass(vex.baseClassNames.open)}).bind("vexClose.vex",function(){return vex.getAllVexes().length?void 0:$("body").removeClass(vex.baseClassNames.open)})},hideLoading:function(){return $(".vex-loading-spinner").remove()},showLoading:function(){return vex.hideLoading(),$("body").append('<div class="vex-loading-spinner '+vex.defaultOptions.className+'"></div>')}}},"function"==typeof define&&define.amd?define(["jquery"],vexFactory):"object"==typeof exports?module.exports=vexFactory(require("jquery")):window.vex=vexFactory(jQuery)}).call(this),function(){var vexDialogFactory;vexDialogFactory=function($,vex){var $formToObject,dialog;return null==vex?$.error("Vex is required to use vex.dialog"):($formToObject=function($form){var object;return object={},$.each($form.serializeArray(),function(){return object[this.name]?(object[this.name].push||(object[this.name]=[object[this.name]]),object[this.name].push(this.value||"")):object[this.name]=this.value||""}),object},dialog={},dialog.buttons={YES:{text:"OK",type:"submit",className:"vex-dialog-button-primary"},NO:{text:"Cancel",type:"button",className:"vex-dialog-button-secondary",click:function($vexContent){return $vexContent.data().vex.value=!1,vex.close($vexContent.data().vex.id)}}},dialog.defaultOptions={callback:function(){},afterOpen:function(){},message:"Message",input:'<input name="vex" type="hidden" value="_vex-empty-value" />',value:!1,buttons:[dialog.buttons.YES,dialog.buttons.NO],showCloseButton:!1,onSubmit:function(event){var $form,$vexContent;return $form=$(this),$vexContent=$form.parent(),event.preventDefault(),event.stopPropagation(),$vexContent.data().vex.value=dialog.getFormValueOnSubmit($formToObject($form)),vex.close($vexContent.data().vex.id)},focusFirstInput:!0},dialog.defaultAlertOptions={message:"Alert",buttons:[dialog.buttons.YES]},dialog.defaultConfirmOptions={message:"Confirm"},dialog.open=function(options){var $vexContent;return options=$.extend({},vex.defaultOptions,dialog.defaultOptions,options),options.content=dialog.buildDialogForm(options),options.beforeClose=function($vexContent){return options.callback($vexContent.data().vex.value)},$vexContent=vex.open(options),options.focusFirstInput&&$vexContent.find('input[type="submit"], textarea, input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"]').first().focus(),$vexContent},dialog.alert=function(options){return"string"==typeof options&&(options={message:options}),options=$.extend({},dialog.defaultAlertOptions,options),dialog.open(options)},dialog.confirm=function(options){return"string"==typeof options?$.error("dialog.confirm(options) requires options.callback."):(options=$.extend({},dialog.defaultConfirmOptions,options),dialog.open(options))},dialog.prompt=function(options){var defaultPromptOptions;return"string"==typeof options?$.error("dialog.prompt(options) requires options.callback."):(defaultPromptOptions={message:'<label for="vex">'+(options.label||"Prompt:")+"</label>",input:'<input name="vex" type="text" class="vex-dialog-prompt-input" placeholder="'+(options.placeholder||"")+'" value="'+(options.value||"")+'" />'},options=$.extend({},defaultPromptOptions,options),dialog.open(options))},dialog.buildDialogForm=function(options){var $form,$input,$message;return $form=$('<form class="vex-dialog-form" />'),$message=$('<div class="vex-dialog-message" />'),$input=$('<div class="vex-dialog-input" />'),$form.append($message.append(options.message)).append($input.append(options.input)).append(dialog.buttonsToDOM(options.buttons)).bind("submit.vex",options.onSubmit),$form},dialog.getFormValueOnSubmit=function(formData){return formData.vex||""===formData.vex?"_vex-empty-value"===formData.vex?!0:formData.vex:formData},dialog.buttonsToDOM=function(buttons){var $buttons;return $buttons=$('<div class="vex-dialog-buttons" />'),$.each(buttons,function(index,button){return $buttons.append($('<input type="'+button.type+'" />').val(button.text).addClass(button.className+" vex-dialog-button "+(0===index?"vex-first ":"")+(index===buttons.length-1?"vex-last ":"")).bind("click.vex",function(e){return button.click?button.click($(this).parents("."+vex.baseClassNames.content),e):void 0}))}),$buttons},dialog)},"function"==typeof define&&define.amd?define(["jquery","vex"],vexDialogFactory):"object"==typeof exports?module.exports=vexDialogFactory(require("jquery"),require("vex")):window.vex.dialog=vexDialogFactory(window.jQuery,window.vex)}.call(this);var ignore_date=new Date;ignore_date.setTime(ignore_date.getTime()+12096e5),jQuery(document).ready(function($){var li_subscribe_flag=$.cookie("li_subscribe");leadin_subscribe_check_mobile($)||(li_subscribe_flag?"show"==li_subscribe_flag&&bind_leadin_subscribe_widget():leadin_check_visitor_status($.cookie("li_hash"),function(data){"subscribe"!=data?($.cookie("li_subscribe","show",{path:"/",domain:""}),bind_leadin_subscribe_widget()):(alert("ignore "+ignore_date),$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date}))}))});
assets/js/build/leadin-tracking.js CHANGED
@@ -194,6 +194,7 @@ function leadin_submit_form ( $form, $, form_type )
194
  var lead_last_name = '';
195
  var lead_phone = '';
196
  var form_submission_type = ( form_type ? form_type : 'lead' );
 
197
 
198
  // Excludes hidden input fields + submit inputs
199
  $this.find('input[type!="submit"], textarea').not('input[type="hidden"], input[type="radio"], input[type="password"]').each( function ( index ) {
@@ -285,8 +286,14 @@ function leadin_submit_form ( $form, $, form_type )
285
  }
286
  }
287
 
 
 
 
288
  var $label_text = $.trim($label.replaceArray(["(", ")", "required", "Required", "*", ":"], [""]));
289
 
 
 
 
290
  push_form_field($label_text, $value, form_fields);
291
 
292
  if ( $value.indexOf('@') != -1 && $value.indexOf('.') != -1 && !lead_email )
@@ -364,7 +371,24 @@ function leadin_submit_form ( $form, $, form_type )
364
  }
365
  }
366
 
367
- push_form_field($select_label, $select.val(), form_fields);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
368
  });
369
 
370
  $this.find('.li_used').removeClass('li_used'); // Clean up added classes
@@ -374,8 +398,8 @@ function leadin_submit_form ( $form, $, form_type )
374
  form_submission_type = 'comment';
375
  }
376
 
377
- // Save submission into database, send LeadIn email, and submit form as usual
378
- if ( lead_email )
379
  {
380
  var submission_hash = Math.random().toString(36).slice(2);
381
  var hashkey = $.cookie("li_hash");
194
  var lead_last_name = '';
195
  var lead_phone = '';
196
  var form_submission_type = ( form_type ? form_type : 'lead' );
197
+ var ignore_form = false;
198
 
199
  // Excludes hidden input fields + submit inputs
200
  $this.find('input[type!="submit"], textarea').not('input[type="hidden"], input[type="radio"], input[type="password"]').each( function ( index ) {
286
  }
287
  }
288
 
289
+ // Remove fakepath from input[type="file"]
290
+ $value = $value.replace("C:\\fakepath\\", "");
291
+
292
  var $label_text = $.trim($label.replaceArray(["(", ")", "required", "Required", "*", ":"], [""]));
293
 
294
+ if ( $label_text.toLowerCase().indexOf('credit card') != -1 || $label_text.toLowerCase().indexOf('card number') != -1 )
295
+ ignore_form = true;
296
+
297
  push_form_field($label_text, $value, form_fields);
298
 
299
  if ( $value.indexOf('@') != -1 && $value.indexOf('.') != -1 && !lead_email )
371
  }
372
  }
373
 
374
+ var select_value = '';
375
+ if ( $select.val() instanceof Array )
376
+ {
377
+ var select_vals = $select.val();
378
+
379
+ for ( i = 0; i < select_vals.length; i++ )
380
+ {
381
+ select_value += select_vals[i];
382
+ if ( i != select_vals.length - 1 )
383
+ select_value += ', ';
384
+ }
385
+ }
386
+ else
387
+ {
388
+ select_value = $select.val();
389
+ }
390
+
391
+ push_form_field($select_label, select_value, form_fields);
392
  });
393
 
394
  $this.find('.li_used').removeClass('li_used'); // Clean up added classes
398
  form_submission_type = 'comment';
399
  }
400
 
401
+ // Save submission into database if email is present and form is not ignore, send LeadIn email, and submit form as usual
402
+ if ( lead_email && ! ignore_form )
403
  {
404
  var submission_hash = Math.random().toString(36).slice(2);
405
  var hashkey = $.cookie("li_hash");
assets/js/build/leadin-tracking.min.js CHANGED
@@ -1 +1 @@
1
- function leadin_submit_form(a,b,c){var d=a,e=[],f="",g="",h="",i="",j=c?c:"lead";d.find('input[type!="submit"], textarea').not('input[type="hidden"], input[type="radio"], input[type="password"]').each(function(){var a=b(this),c=a.val();if(!a.is(":visible"))return!0;var j=b("label[for='"+a.attr("id")+"']").text();0==j.length&&(j=a.prev("label").not(".li_used").addClass("li_used").first().text(),j.length||(j=a.prevAll("b, strong, span").text())),0==j.length&&(j=a.next("label").not(".li_used").addClass("li_used").first().text(),j.length||(j=a.nextAll("b, strong, span").text())),0==j.length&&(j=a.parent().find("label, b, strong").not(".li_used").first().text()),0==j.length&&b.contains(d,a.parent().parent())&&(j=a.parent().parent().find("label, b, strong").first().text()),0==j.length&&($p=a.closest("p").not(".li_used").addClass("li_used"),$p.length&&(j=$p.text(),j=b.trim(j.replace(c,"")))),0==j.length&&void 0!==a.attr("placeholder")&&(j=a.attr("placeholder").toString()),0==j.length&&void 0!==a.attr("name")&&(j=a.attr("name").toString()),a.is(":checkbox")&&(c=a.is(":checked")?"Checked":"Not checked");var k=b.trim(j.replaceArray(["(",")","required","Required","*",":"],[""]));push_form_field(k,c,e),-1==c.indexOf("@")||-1==c.indexOf(".")||f||(f=c),"leadin-subscribe-fname"==a.attr("id")&&(g=c),"leadin-subscribe-lname"==a.attr("id")&&(h=c),"leadin-subscribe-phone"==a.attr("id")&&(i=c)});var k=[],l=[];d.find(":radio").each(function(){-1==b.inArray(this.name,k)&&k.push(this.name),l.push(b(this).val())});for(var m=0;m<k.length;m++){{var n=b("input:radio[name='"+k[m]+"']");b("input:radio[name='"+k[m]+"']:checked").val()}$p=d.find(".gfield").length?n.closest(".gfield").not(".li_used").addClass("li_used"):d.find(".frm_form_field").length?n.closest(".frm_form_field").not(".li_used").addClass("li_used"):n.closest("div, p").not(".li_used").addClass("li_used"),$p.length&&($rbg_label=$p.text(),$rbg_label=b.trim($rbg_label.replaceArray(l,[""]).replace($p.find(".gfield_description").text(),"")));var o=b("input:radio[name='"+k[m]+"']:checked").val()?b("input:radio[name='"+k[m]+"']:checked").val():"not selected";push_form_field($rbg_label,o,e)}if(d.find("select").each(function(){var a=b(this),c=b("label[for='"+a.attr("id")+"']").text();if(!c.length){var f=[];a.find("option").each(function(){-1==b.inArray(b(this).val(),f)&&f.push(b(this).val())}),$p=a.closest("div, p").not(".li_used").addClass("li_used"),$p=d.find(".gfield").length?a.closest(".gfield").not(".li_used").addClass("li_used"):a.closest("div, p").addClass("li_used"),$p.length&&(c=$p.text(),c=b.trim(c.replaceArray(f,[""]).replace($p.find(".gfield_description").text(),"")))}push_form_field(c,a.val(),e)}),d.find(".li_used").removeClass("li_used"),d.find("#comment_post_ID").length&&(j="comment"),f){var p=Math.random().toString(36).slice(2),q=b.cookie("li_hash"),r=JSON.stringify(e),s={};s={submission_hash:p,hashkey:q,lead_email:f,lead_first_name:g,lead_last_name:h,lead_phone:i,page_title:page_title,page_url:page_url,json_form_fields:r,form_submission_type:j},b.cookie("li_submission",JSON.stringify(s),{path:"/",domain:""}),leadin_insert_form_submission(p,q,page_title,page_url,r,f,g,h,i,j,function(){b.removeCookie("li_submission",{path:"/",domain:""})})}else form_saved=!0}function leadin_check_merged_contact(a){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_check_merged_contact",li_id:a},success:function(a){var b=jQuery.parseJSON(a);b&&jQuery.cookie("li_hash",b,{path:"/",domain:""})},error:function(){}})}function leadin_check_visitor_status(a,b){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_check_visitor_status",li_id:a},success:function(a){var c=jQuery.parseJSON(a);b&&b(c)},error:function(){}})}function leadin_log_pageview(a,b,c,d,e){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_log_pageview",li_id:a,li_title:b,li_url:c,li_referrer:d,li_last_visit:e},success:function(){},error:function(){}})}function leadin_insert_lead(a,b){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_insert_lead",li_id:a,li_referrer:b},success:function(){},error:function(){}})}function leadin_insert_form_submission(a,b,c,d,e,f,g,h,i,j,k){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_insert_form_submission",li_submission_id:a,li_id:b,li_title:c,li_url:d,li_fields:e,li_email:f,li_first_name:g,li_last_name:h,li_phone:i,li_submission_type:j},success:function(a){k&&k(a)},error:function(){}})}function push_form_field(a,b,c){var d={label:a,value:b};c.push(d)}!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setDate(k.getDate()+j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});var page_title=jQuery(document).find("title").text(),page_url=window.location.href,page_referrer=document.referrer,form_saved=!1;jQuery(document).ready(function(a){var b=a.cookie("li_hash"),c=a.cookie("li_submission");if(c){var d=JSON.parse(c);leadin_insert_form_submission(d.submission_hash,d.hashkey,d.page_title,d.page_url,d.json_form_fields,d.lead_email,d.lead_first_name,d.lead_last_name,d.lead_phone,d.form_submission_type,function(){a.removeCookie("li_submission",{path:"/",domain:""})})}b||(b=Math.random().toString(36).slice(2),a.cookie("li_hash",b,{path:"/",domain:""}),leadin_insert_lead(b,page_referrer)),leadin_log_pageview(b,page_title,page_url,page_referrer,a.cookie("li_last_visit"));var e=new Date,f=e.getTime();e.setTime(e.getTime()+36e5),a.cookie("li_last_visit")||leadin_check_merged_contact(b),a.cookie("li_last_visit",f,{path:"/",domain:"",expires:e})}),jQuery(function(a){-1!=a.versioncompare(a.fn.jquery,"1.7.0")?a(document).on("submit","form",function(){var b=a(this).closest("form");leadin_submit_form(b,a)}):a(document).bind("submit","form",function(){var b=a(this).closest("form");leadin_submit_form(b,a)})}),String.prototype.replaceArray=function(a,b){for(var c=this,d=0;d<a.length;d++)c=1!=b.length?c.replace(a[d],b[d]):c.replace(a[d],b[0]);return c},function(a){function b(b){return a.map(b.split("."),function(a){return parseInt(a,10)})}a.versioncompare=function(c,d){if("undefined"==typeof c)throw new Error("$.versioncompare needs at least one parameter.");if(d=d||a.fn.jquery,c==d)return 0;for(var e=b(c),f=b(d),g=Math.max(e.length,f.length),h=0;g>h;h++)if(e[h]=e[h]||0,f[h]=f[h]||0,e[h]!=f[h])return e[h]>f[h]?1:-1;return 0}}(jQuery);
1
+ function leadin_submit_form($form,$,form_type){var $this=$form,form_fields=[],lead_email="",lead_first_name="",lead_last_name="",lead_phone="",form_submission_type=form_type?form_type:"lead",ignore_form=!1;$this.find('input[type!="submit"], textarea').not('input[type="hidden"], input[type="radio"], input[type="password"]').each(function(){var $element=$(this),$value=$element.val();if(!$element.is(":visible"))return!0;var $label=$("label[for='"+$element.attr("id")+"']").text();0==$label.length&&($label=$element.prev("label").not(".li_used").addClass("li_used").first().text(),$label.length||($label=$element.prevAll("b, strong, span").text())),0==$label.length&&($label=$element.next("label").not(".li_used").addClass("li_used").first().text(),$label.length||($label=$element.nextAll("b, strong, span").text())),0==$label.length&&($label=$element.parent().find("label, b, strong").not(".li_used").first().text()),0==$label.length&&$.contains($this,$element.parent().parent())&&($label=$element.parent().parent().find("label, b, strong").first().text()),0==$label.length&&($p=$element.closest("p").not(".li_used").addClass("li_used"),$p.length&&($label=$p.text(),$label=$.trim($label.replace($value,"")))),0==$label.length&&void 0!==$element.attr("placeholder")&&($label=$element.attr("placeholder").toString()),0==$label.length&&void 0!==$element.attr("name")&&($label=$element.attr("name").toString()),$element.is(":checkbox")&&($value=$element.is(":checked")?"Checked":"Not checked"),$value=$value.replace("C:\\fakepath\\","");var $label_text=$.trim($label.replaceArray(["(",")","required","Required","*",":"],[""]));(-1!=$label_text.toLowerCase().indexOf("credit card")||-1!=$label_text.toLowerCase().indexOf("card number"))&&(ignore_form=!0),push_form_field($label_text,$value,form_fields),-1==$value.indexOf("@")||-1==$value.indexOf(".")||lead_email||(lead_email=$value),"leadin-subscribe-fname"==$element.attr("id")&&(lead_first_name=$value),"leadin-subscribe-lname"==$element.attr("id")&&(lead_last_name=$value),"leadin-subscribe-phone"==$element.attr("id")&&(lead_phone=$value)});var radio_groups=[],rbg_label_values=[];$this.find(":radio").each(function(){-1==$.inArray(this.name,radio_groups)&&radio_groups.push(this.name),rbg_label_values.push($(this).val())});for(var i=0;i<radio_groups.length;i++){{var $rbg=$("input:radio[name='"+radio_groups[i]+"']");$("input:radio[name='"+radio_groups[i]+"']:checked").val()}$p=$this.find(".gfield").length?$rbg.closest(".gfield").not(".li_used").addClass("li_used"):$this.find(".frm_form_field").length?$rbg.closest(".frm_form_field").not(".li_used").addClass("li_used"):$rbg.closest("div, p").not(".li_used").addClass("li_used"),$p.length&&($rbg_label=$p.text(),$rbg_label=$.trim($rbg_label.replaceArray(rbg_label_values,[""]).replace($p.find(".gfield_description").text(),"")));var rgb_selected=$("input:radio[name='"+radio_groups[i]+"']:checked").val()?$("input:radio[name='"+radio_groups[i]+"']:checked").val():"not selected";push_form_field($rbg_label,rgb_selected,form_fields)}if($this.find("select").each(function(){var $select=$(this),$select_label=$("label[for='"+$select.attr("id")+"']").text();if(!$select_label.length){var select_values=[];$select.find("option").each(function(){-1==$.inArray($(this).val(),select_values)&&select_values.push($(this).val())}),$p=$select.closest("div, p").not(".li_used").addClass("li_used"),$p=$this.find(".gfield").length?$select.closest(".gfield").not(".li_used").addClass("li_used"):$select.closest("div, p").addClass("li_used"),$p.length&&($select_label=$p.text(),$select_label=$.trim($select_label.replaceArray(select_values,[""]).replace($p.find(".gfield_description").text(),"")))}var select_value="";if($select.val()instanceof Array){var select_vals=$select.val();for(i=0;i<select_vals.length;i++)select_value+=select_vals[i],i!=select_vals.length-1&&(select_value+=", ")}else select_value=$select.val();push_form_field($select_label,select_value,form_fields)}),$this.find(".li_used").removeClass("li_used"),$this.find("#comment_post_ID").length&&(form_submission_type="comment"),lead_email&&!ignore_form){var submission_hash=Math.random().toString(36).slice(2),hashkey=$.cookie("li_hash"),json_form_fields=JSON.stringify(form_fields),form_submission={};form_submission={submission_hash:submission_hash,hashkey:hashkey,lead_email:lead_email,lead_first_name:lead_first_name,lead_last_name:lead_last_name,lead_phone:lead_phone,page_title:page_title,page_url:page_url,json_form_fields:json_form_fields,form_submission_type:form_submission_type},$.cookie("li_submission",JSON.stringify(form_submission),{path:"/",domain:""}),leadin_insert_form_submission(submission_hash,hashkey,page_title,page_url,json_form_fields,lead_email,lead_first_name,lead_last_name,lead_phone,form_submission_type,function(){$.removeCookie("li_submission",{path:"/",domain:""})})}else form_saved=!0}function leadin_check_merged_contact(hashkey){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_check_merged_contact",li_id:hashkey},success:function(data){var json_data=jQuery.parseJSON(data);json_data&&jQuery.cookie("li_hash",json_data,{path:"/",domain:""})},error:function(){}})}function leadin_check_visitor_status(hashkey,callback){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_check_visitor_status",li_id:hashkey},success:function(data){var json_data=jQuery.parseJSON(data);callback&&callback(json_data)},error:function(){}})}function leadin_log_pageview(hashkey,page_title,page_url,page_referrer,last_visit){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_log_pageview",li_id:hashkey,li_title:page_title,li_url:page_url,li_referrer:page_referrer,li_last_visit:last_visit},success:function(){},error:function(){}})}function leadin_insert_lead(hashkey,page_referrer){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_insert_lead",li_id:hashkey,li_referrer:page_referrer},success:function(){},error:function(){}})}function leadin_insert_form_submission(submission_haskey,hashkey,page_title,page_url,json_fields,lead_email,lead_first_name,lead_last_name,lead_phone,form_submission_type,Callback){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_insert_form_submission",li_submission_id:submission_haskey,li_id:hashkey,li_title:page_title,li_url:page_url,li_fields:json_fields,li_email:lead_email,li_first_name:lead_first_name,li_last_name:lead_last_name,li_phone:lead_phone,li_submission_type:form_submission_type},success:function(data){Callback&&Callback(data)},error:function(){}})}function push_form_field(label,value,form_fields){var field={label:label,value:value};form_fields.push(field)}!function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):factory(jQuery)}(function($){function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){0===s.indexOf('"')&&(s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return s=decodeURIComponent(s.replace(pluses," ")),config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var pluses=/\+/g,config=$.cookie=function(key,value,options){if(void 0!==value&&!$.isFunction(value)){if(options=$.extend({},config.defaults,options),"number"==typeof options.expires){var days=options.expires,t=options.expires=new Date;t.setDate(t.getDate()+days)}return document.cookie=[encode(key),"=",stringifyCookieValue(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}for(var result=key?void 0:{},cookies=document.cookie?document.cookie.split("; "):[],i=0,l=cookies.length;l>i;i++){var parts=cookies[i].split("="),name=decode(parts.shift()),cookie=parts.join("=");if(key&&key===name){result=read(cookie,value);break}key||void 0===(cookie=read(cookie))||(result[name]=cookie)}return result};config.defaults={},$.removeCookie=function(key,options){return void 0===$.cookie(key)?!1:($.cookie(key,"",$.extend({},options,{expires:-1})),!$.cookie(key))}});var page_title=jQuery(document).find("title").text(),page_url=window.location.href,page_referrer=document.referrer,form_saved=!1;jQuery(document).ready(function($){var hashkey=$.cookie("li_hash"),li_submission_cookie=$.cookie("li_submission");if(li_submission_cookie){var submission_data=JSON.parse(li_submission_cookie);leadin_insert_form_submission(submission_data.submission_hash,submission_data.hashkey,submission_data.page_title,submission_data.page_url,submission_data.json_form_fields,submission_data.lead_email,submission_data.lead_first_name,submission_data.lead_last_name,submission_data.lead_phone,submission_data.form_submission_type,function(){$.removeCookie("li_submission",{path:"/",domain:""})})}hashkey||(hashkey=Math.random().toString(36).slice(2),$.cookie("li_hash",hashkey,{path:"/",domain:""}),leadin_insert_lead(hashkey,page_referrer)),leadin_log_pageview(hashkey,page_title,page_url,page_referrer,$.cookie("li_last_visit"));var date=new Date,current_time=date.getTime();date.setTime(date.getTime()+36e5),$.cookie("li_last_visit")||leadin_check_merged_contact(hashkey),$.cookie("li_last_visit",current_time,{path:"/",domain:"",expires:date})}),jQuery(function($){-1!=$.versioncompare($.fn.jquery,"1.7.0")?$(document).on("submit","form",function(){var $form=$(this).closest("form");leadin_submit_form($form,$)}):$(document).bind("submit","form",function(){var $form=$(this).closest("form");leadin_submit_form($form,$)})}),String.prototype.replaceArray=function(find,replace){for(var replaceString=this,i=0;i<find.length;i++)replaceString=1!=replace.length?replaceString.replace(find[i],replace[i]):replaceString.replace(find[i],replace[0]);return replaceString},function($){function normalize(version){return $.map(version.split("."),function(value){return parseInt(value,10)})}$.versioncompare=function(version1,version2){if("undefined"==typeof version1)throw new Error("$.versioncompare needs at least one parameter.");if(version2=version2||$.fn.jquery,version1==version2)return 0;for(var v1=normalize(version1),v2=normalize(version2),len=Math.max(v1.length,v2.length),i=0;len>i;i++)if(v1[i]=v1[i]||0,v2[i]=v2[i]||0,v1[i]!=v2[i])return v1[i]>v2[i]?1:-1;return 0}}(jQuery);
assets/js/subscribe/leadin-subscribe.js DELETED
@@ -1,151 +0,0 @@
1
- var ignore_date = new Date();
2
- ignore_date.setTime(ignore_date.getTime() + (60 * 60 * 24 * 14 * 1000));
3
-
4
- jQuery(document).ready( function ( $ ) {
5
- var li_subscribe_flag = $.cookie('li_subscribe');
6
-
7
- if ( !leadin_subscribe_check_mobile($) )
8
- {
9
- if ( !li_subscribe_flag )
10
- {
11
- leadin_check_visitor_status($.cookie("li_hash"), function ( data ) {
12
- if ( data != 'subscribe' )
13
- {
14
- $.cookie("li_subscribe", 'show', {path: "/", domain: ""});
15
- bind_leadin_subscribe_widget();
16
- }
17
- else
18
- {
19
- alert('ignore ' + ignore_date);
20
- $.cookie("li_subscribe", 'ignore', {path: "/", domain: "", expires: ignore_date});
21
- }
22
- });
23
- }
24
- else
25
- {
26
- if ( li_subscribe_flag == 'show' )
27
- bind_leadin_subscribe_widget();
28
- }
29
- }
30
- });
31
-
32
- function bind_leadin_subscribe_widget ()
33
- {
34
- (function(){
35
- var $ = jQuery;
36
- var subscribe = {};
37
-
38
- subscribe.vex = undefined;
39
-
40
- subscribe.init = function() {
41
- $(window).scroll(function() {
42
- if ($(window).scrollTop() + $(window).height() > $(document).height() / 2) {
43
- subscribe.open();
44
- } else {
45
- //subscribe.close();
46
- }
47
- });
48
- };
49
-
50
- subscribe.open = function() {
51
- if (subscribe.vex) {
52
- return subscribe._open();
53
- }
54
-
55
- subscribe.vex = vex.dialog.open({
56
- showCloseButton: true,
57
- className: 'leadin-subscribe ' + $('#leadin-subscribe-vex-class').val(),
58
- message: $('#leadin-subscribe-heading').val(),
59
- input: '<input id="leadin-subscribe-email" name="email" type="email" placeholder="Email address" />' +
60
- (($('#leadin-subscribe-name-fields').val()==0) ? '' : '<input id="leadin-subscribe-fname" name="fname" type="text" placeholder="First Name" /><input id="leadin-subscribe-lname" name="lname" type="text" placeholder="Last Name" />') +
61
- (($('#leadin-subscribe-phone-field').val()==0) ? '' : '<input id="leadin-subscribe-phone" name="phone" type="tel" placeholder="Phone" />'),
62
- buttons: [$.extend({}, vex.dialog.buttons.YES, { text: ( $('#leadin-subscribe-btn-label').val() ? $('#leadin-subscribe-btn-label').val() : 'SUBSCRIBE' ) })],
63
- onSubmit: function ( data )
64
- {
65
- $subscribe_form = $(this);
66
- $subscribe_form.find('input.error').removeClass('error');
67
- var form_validated = true;
68
-
69
- $subscribe_form.find('input').each( function ( e ) {
70
- var $input = $(this);
71
- if ( ! $input.val() )
72
- {
73
- $input.addClass('error');
74
- form_validated = false;
75
- }
76
- });
77
-
78
- if ( ! form_validated )
79
- return false;
80
-
81
- $('.vex-dialog-form').fadeOut(300, function ( e ) {
82
- $('.vex-dialog-form').html(
83
- '<div class="vex-close"></div>' +
84
- '<h3>Thanks!<br>You should receive a confirmation email in your inbox shortly.</h3>' +
85
- '<div>' +
86
- '<span class="powered-by">Powered by LeadIn</span>' +
87
- '<a href="http://leadin.com/wordpress-subscribe-widget/?utm_campaign=subscribe_widget&utm_medium=email&utm_source=' + window.location.host + '"><img alt="LeadIn" height="20px" width="99px" src="http://leadin.com/wp-content/themes/LeadIn-WP-Theme/library/images/logos/Leadin_logo@2x.png" alt="leadin.com"/></a>' +
88
- '</div>'
89
- ).css('text-align', 'center').fadeIn(250);
90
- });
91
-
92
- leadin_submit_form($('.leadin-subscribe form'), $, 'subscribe');
93
- $.cookie("li_subscribe", 'ignore', {path: "/", domain: "", expires: ignore_date});
94
- return false;
95
- },
96
- callback: function(data) {
97
- if (data === false) {
98
- $.cookie("li_subscribe", 'ignore', {path: "/", domain: "", expires: ignore_date});
99
- }
100
-
101
- $.cookie("li_subscribe", 'ignore', {path: "/", domain: "", expires: ignore_date});
102
- }
103
- });
104
-
105
- //leadin_subscribe_show();
106
-
107
- $('.leadin-subscribe form.vex-dialog-form').append('<a href="http://leadin.com/pop-subscribe-form-plugin-wordpress/?utm_campaign=subscribe_widget&utm_medium=widget&utm_source=' + document.URL + '" id="leadin-subscribe-powered-by" class="leadin-subscribe-powered-by">Powered by LeadIn</a>');
108
- };
109
-
110
- subscribe._open = function() {
111
- subscribe.vex.parent().removeClass('vex-closing');
112
- }
113
-
114
- subscribe.close = function() {
115
-
116
- if (!subscribe.vex) {
117
- return;
118
- }
119
- subscribe.vex.parent().addClass('vex-closing');
120
- }
121
-
122
- subscribe.init();
123
- window.subscribe = subscribe;
124
- })();
125
- }
126
-
127
- function leadin_subscribe_check_mobile( $ )
128
- {
129
- var is_mobile = false;
130
-
131
- if ( $('#leadin-subscribe-mobile-check').css('display')=='none' )
132
- is_mobile = true;
133
-
134
- return is_mobile;
135
- }
136
-
137
- function leadin_subscribe_show ()
138
- {
139
- jQuery.ajax({
140
- type: 'POST',
141
- url: li_ajax.ajax_url,
142
- data: {
143
- "action": "leadin_subscribe_show"
144
- },
145
- success: function(data){
146
- },
147
- error: function ( error_data ) {
148
- //alert(error_data);
149
- }
150
- });
151
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/subscribe/vex.dialog.js DELETED
@@ -1,149 +0,0 @@
1
- (function() {
2
- var vexDialogFactory;
3
-
4
- vexDialogFactory = function($, vex) {
5
- var $formToObject, dialog;
6
- if (vex == null) {
7
- return $.error('Vex is required to use vex.dialog');
8
- }
9
- $formToObject = function($form) {
10
- var object;
11
- object = {};
12
- $.each($form.serializeArray(), function() {
13
- if (object[this.name]) {
14
- if (!object[this.name].push) {
15
- object[this.name] = [object[this.name]];
16
- }
17
- return object[this.name].push(this.value || '');
18
- } else {
19
- return object[this.name] = this.value || '';
20
- }
21
- });
22
- return object;
23
- };
24
- dialog = {};
25
- dialog.buttons = {
26
- YES: {
27
- text: 'OK',
28
- type: 'submit',
29
- className: 'vex-dialog-button-primary'
30
- },
31
- NO: {
32
- text: 'Cancel',
33
- type: 'button',
34
- className: 'vex-dialog-button-secondary',
35
- click: function($vexContent, event) {
36
- $vexContent.data().vex.value = false;
37
- return vex.close($vexContent.data().vex.id);
38
- }
39
- }
40
- };
41
- dialog.defaultOptions = {
42
- callback: function(value) {},
43
- afterOpen: function() {},
44
- message: 'Message',
45
- input: "<input name=\"vex\" type=\"hidden\" value=\"_vex-empty-value\" />",
46
- value: false,
47
- buttons: [dialog.buttons.YES, dialog.buttons.NO],
48
- showCloseButton: false,
49
- onSubmit: function(event) {
50
- var $form, $vexContent;
51
- $form = $(this);
52
- $vexContent = $form.parent();
53
- event.preventDefault();
54
- event.stopPropagation();
55
- $vexContent.data().vex.value = dialog.getFormValueOnSubmit($formToObject($form));
56
- return vex.close($vexContent.data().vex.id);
57
- },
58
- focusFirstInput: true
59
- };
60
- dialog.defaultAlertOptions = {
61
- message: 'Alert',
62
- buttons: [dialog.buttons.YES]
63
- };
64
- dialog.defaultConfirmOptions = {
65
- message: 'Confirm'
66
- };
67
- dialog.open = function(options) {
68
- var $vexContent;
69
- options = $.extend({}, vex.defaultOptions, dialog.defaultOptions, options);
70
- options.content = dialog.buildDialogForm(options);
71
- options.beforeClose = function($vexContent) {
72
- return options.callback($vexContent.data().vex.value);
73
- };
74
- $vexContent = vex.open(options);
75
- if (options.focusFirstInput) {
76
- $vexContent.find('input[type="submit"], textarea, input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"]').first().focus();
77
- }
78
- return $vexContent;
79
- };
80
- dialog.alert = function(options) {
81
- if (typeof options === 'string') {
82
- options = {
83
- message: options
84
- };
85
- }
86
- options = $.extend({}, dialog.defaultAlertOptions, options);
87
- return dialog.open(options);
88
- };
89
- dialog.confirm = function(options) {
90
- if (typeof options === 'string') {
91
- return $.error('dialog.confirm(options) requires options.callback.');
92
- }
93
- options = $.extend({}, dialog.defaultConfirmOptions, options);
94
- return dialog.open(options);
95
- };
96
- dialog.prompt = function(options) {
97
- var defaultPromptOptions;
98
- if (typeof options === 'string') {
99
- return $.error('dialog.prompt(options) requires options.callback.');
100
- }
101
- defaultPromptOptions = {
102
- message: "<label for=\"vex\">" + (options.label || 'Prompt:') + "</label>",
103
- input: "<input name=\"vex\" type=\"text\" class=\"vex-dialog-prompt-input\" placeholder=\"" + (options.placeholder || '') + "\" value=\"" + (options.value || '') + "\" />"
104
- };
105
- options = $.extend({}, defaultPromptOptions, options);
106
- return dialog.open(options);
107
- };
108
- dialog.buildDialogForm = function(options) {
109
- var $form, $input, $message;
110
- $form = $('<form class="vex-dialog-form" />');
111
- $message = $('<div class="vex-dialog-message" />');
112
- $input = $('<div class="vex-dialog-input" />');
113
- $form.append($message.append(options.message)).append($input.append(options.input)).append(dialog.buttonsToDOM(options.buttons)).bind('submit.vex', options.onSubmit);
114
- return $form;
115
- };
116
- dialog.getFormValueOnSubmit = function(formData) {
117
- if (formData.vex || formData.vex === '') {
118
- if (formData.vex === '_vex-empty-value') {
119
- return true;
120
- }
121
- return formData.vex;
122
- } else {
123
- return formData;
124
- }
125
- };
126
- dialog.buttonsToDOM = function(buttons) {
127
- var $buttons;
128
- $buttons = $('<div class="vex-dialog-buttons" />');
129
- $.each(buttons, function(index, button) {
130
- return $buttons.append($("<input type=\"" + button.type + "\" />").val(button.text).addClass(button.className + ' vex-dialog-button ' + (index === 0 ? 'vex-first ' : '') + (index === buttons.length - 1 ? 'vex-last ' : '')).bind('click.vex', function(e) {
131
- if (button.click) {
132
- return button.click($(this).parents("." + vex.baseClassNames.content), e);
133
- }
134
- }));
135
- });
136
- return $buttons;
137
- };
138
- return dialog;
139
- };
140
-
141
- if (typeof define === 'function' && define.amd) {
142
- define(['jquery', 'vex'], vexDialogFactory);
143
- } else if (typeof exports === 'object') {
144
- module.exports = vexDialogFactory(require('jquery'), require('vex'));
145
- } else {
146
- window.vex.dialog = vexDialogFactory(window.jQuery, window.vex);
147
- }
148
-
149
- }).call(this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/subscribe/vex.js DELETED
@@ -1,189 +0,0 @@
1
- (function() {
2
- var vexFactory;
3
-
4
- vexFactory = function($) {
5
- var animationEndSupport, vex;
6
- animationEndSupport = false;
7
- $(function() {
8
- var s;
9
- s = (document.body || document.documentElement).style;
10
- animationEndSupport = s.animation !== void 0 || s.WebkitAnimation !== void 0 || s.MozAnimation !== void 0 || s.MsAnimation !== void 0 || s.OAnimation !== void 0;
11
- return $(window).bind('keyup.vex', function(event) {
12
- if (event.keyCode === 27) {
13
- return vex.closeByEscape();
14
- }
15
- });
16
- });
17
- return vex = {
18
- globalID: 1,
19
- animationEndEvent: 'animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend',
20
- baseClassNames: {
21
- vex: 'vex',
22
- content: 'vex-content',
23
- overlay: 'vex-overlay',
24
- close: 'vex-close',
25
- closing: 'vex-closing',
26
- open: 'vex-open'
27
- },
28
- defaultOptions: {
29
- content: '',
30
- showCloseButton: true,
31
- escapeButtonCloses: true,
32
- overlayClosesOnClick: true,
33
- appendLocation: 'body',
34
- className: '',
35
- css: {},
36
- overlayClassName: '',
37
- overlayCSS: {},
38
- contentClassName: '',
39
- contentCSS: {},
40
- closeClassName: '',
41
- closeCSS: {}
42
- },
43
- open: function(options) {
44
- options = $.extend({}, vex.defaultOptions, options);
45
- options.id = vex.globalID;
46
- vex.globalID += 1;
47
- options.$vex = $('<div>').addClass(vex.baseClassNames.vex).addClass(options.className).css(options.css).data({
48
- vex: options
49
- });
50
- options.$vexOverlay = $('<div>').addClass(vex.baseClassNames.overlay).addClass(options.overlayClassName).css(options.overlayCSS).data({
51
- vex: options
52
- });
53
- if (options.overlayClosesOnClick) {
54
- options.$vexOverlay.bind('click.vex', function(e) {
55
- if (e.target !== this) {
56
- return;
57
- }
58
- return vex.close($(this).data().vex.id);
59
- });
60
- }
61
- options.$vex.append(options.$vexOverlay);
62
- options.$vexContent = $('<div>').addClass(vex.baseClassNames.content).addClass(options.contentClassName).css(options.contentCSS).append(options.content).data({
63
- vex: options
64
- });
65
- options.$vex.append(options.$vexContent);
66
- if (options.showCloseButton) {
67
- options.$closeButton = $('<div>').addClass(vex.baseClassNames.close).addClass(options.closeClassName).css(options.closeCSS).data({
68
- vex: options
69
- }).bind('click.vex', function() {
70
- return vex.close($(this).data().vex.id);
71
- });
72
- options.$vexContent.append(options.$closeButton);
73
- }
74
- $(options.appendLocation).append(options.$vex);
75
- vex.setupBodyClassName(options.$vex);
76
- if (options.afterOpen) {
77
- options.afterOpen(options.$vexContent, options);
78
- }
79
- setTimeout((function() {
80
- return options.$vexContent.trigger('vexOpen', options);
81
- }), 0);
82
- return options.$vexContent;
83
- },
84
- getAllVexes: function() {
85
- return $("." + vex.baseClassNames.vex + ":not(\"." + vex.baseClassNames.closing + "\") ." + vex.baseClassNames.content);
86
- },
87
- getVexByID: function(id) {
88
- return vex.getAllVexes().filter(function() {
89
- return $(this).data().vex.id === id;
90
- });
91
- },
92
- close: function(id) {
93
- var $lastVex;
94
- if (!id) {
95
- $lastVex = vex.getAllVexes().last();
96
- if (!$lastVex.length) {
97
- return false;
98
- }
99
- id = $lastVex.data().vex.id;
100
- }
101
- return vex.closeByID(id);
102
- },
103
- closeAll: function() {
104
- var ids;
105
- ids = vex.getAllVexes().map(function() {
106
- return $(this).data().vex.id;
107
- }).toArray();
108
- if (!(ids != null ? ids.length : void 0)) {
109
- return false;
110
- }
111
- $.each(ids.reverse(), function(index, id) {
112
- return vex.closeByID(id);
113
- });
114
- return true;
115
- },
116
- closeByID: function(id) {
117
- var $vex, $vexContent, beforeClose, close, options;
118
- $vexContent = vex.getVexByID(id);
119
- if (!$vexContent.length) {
120
- return;
121
- }
122
- $vex = $vexContent.data().vex.$vex;
123
- options = $.extend({}, $vexContent.data().vex);
124
- beforeClose = function() {
125
- if (options.beforeClose) {
126
- return options.beforeClose($vexContent, options);
127
- }
128
- };
129
- close = function() {
130
- $vexContent.trigger('vexClose', options);
131
- $vex.remove();
132
- if (options.afterClose) {
133
- return options.afterClose($vexContent, options);
134
- }
135
- };
136
- if (animationEndSupport) {
137
- beforeClose();
138
- $vex.unbind(vex.animationEndEvent).bind(vex.animationEndEvent, function() {
139
- return close();
140
- }).addClass(vex.baseClassNames.closing);
141
- } else {
142
- beforeClose();
143
- close();
144
- }
145
- return true;
146
- },
147
- closeByEscape: function() {
148
- var $lastVex, id, ids;
149
- ids = vex.getAllVexes().map(function() {
150
- return $(this).data().vex.id;
151
- }).toArray();
152
- if (!(ids != null ? ids.length : void 0)) {
153
- return false;
154
- }
155
- id = Math.max.apply(Math, ids);
156
- $lastVex = vex.getVexByID(id);
157
- if ($lastVex.data().vex.escapeButtonCloses !== true) {
158
- return false;
159
- }
160
- return vex.closeByID(id);
161
- },
162
- setupBodyClassName: function($vex) {
163
- return $vex.bind('vexOpen.vex', function() {
164
- return $('body').addClass(vex.baseClassNames.open);
165
- }).bind('vexClose.vex', function() {
166
- if (!vex.getAllVexes().length) {
167
- return $('body').removeClass(vex.baseClassNames.open);
168
- }
169
- });
170
- },
171
- hideLoading: function() {
172
- return $('.vex-loading-spinner').remove();
173
- },
174
- showLoading: function() {
175
- vex.hideLoading();
176
- return $('body').append("<div class=\"vex-loading-spinner " + vex.defaultOptions.className + "\"></div>");
177
- }
178
- };
179
- };
180
-
181
- if (typeof define === 'function' && define.amd) {
182
- define(['jquery'], vexFactory);
183
- } else if (typeof exports === 'object') {
184
- module.exports = vexFactory(require('jquery'));
185
- } else {
186
- window.vex = vexFactory(jQuery);
187
- }
188
-
189
- }).call(this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/tracking/jquery.cookie.js DELETED
@@ -1,113 +0,0 @@
1
- /*!
2
- * jQuery Cookie Plugin v1.4.0
3
- * https://github.com/carhartl/jquery-cookie
4
- *
5
- * Copyright 2013 Klaus Hartl
6
- * Released under the MIT license
7
- */
8
- (function (factory) {
9
- if (typeof define === 'function' && define.amd) {
10
- // AMD. Register as anonymous module.
11
- define(['jquery'], factory);
12
- } else {
13
- // Browser globals.
14
- factory(jQuery);
15
- }
16
- }(function ($) {
17
-
18
- var pluses = /\+/g;
19
-
20
- function encode(s) {
21
- return config.raw ? s : encodeURIComponent(s);
22
- }
23
-
24
- function decode(s) {
25
- return config.raw ? s : decodeURIComponent(s);
26
- }
27
-
28
- function stringifyCookieValue(value) {
29
- return encode(config.json ? JSON.stringify(value) : String(value));
30
- }
31
-
32
- function parseCookieValue(s) {
33
- if (s.indexOf('"') === 0) {
34
- // This is a quoted cookie as according to RFC2068, unescape...
35
- s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
36
- }
37
-
38
- try {
39
- // Replace server-side written pluses with spaces.
40
- // If we can't decode the cookie, ignore it, it's unusable.
41
- // If we can't parse the cookie, ignore it, it's unusable.
42
- s = decodeURIComponent(s.replace(pluses, ' '));
43
- return config.json ? JSON.parse(s) : s;
44
- } catch(e) {}
45
- }
46
-
47
- function read(s, converter) {
48
- var value = config.raw ? s : parseCookieValue(s);
49
- return $.isFunction(converter) ? converter(value) : value;
50
- }
51
-
52
- var config = $.cookie = function (key, value, options) {
53
-
54
- // Write
55
- if (value !== undefined && !$.isFunction(value)) {
56
- options = $.extend({}, config.defaults, options);
57
-
58
- if (typeof options.expires === 'number') {
59
- var days = options.expires, t = options.expires = new Date();
60
- t.setDate(t.getDate() + days);
61
- }
62
-
63
- return (document.cookie = [
64
- encode(key), '=', stringifyCookieValue(value),
65
- options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
66
- options.path ? '; path=' + options.path : '',
67
- options.domain ? '; domain=' + options.domain : '',
68
- options.secure ? '; secure' : ''
69
- ].join(''));
70
- }
71
-
72
- // Read
73
-
74
- var result = key ? undefined : {};
75
-
76
- // To prevent the for loop in the first place assign an empty array
77
- // in case there are no cookies at all. Also prevents odd result when
78
- // calling $.cookie().
79
- var cookies = document.cookie ? document.cookie.split('; ') : [];
80
-
81
- for (var i = 0, l = cookies.length; i < l; i++) {
82
- var parts = cookies[i].split('=');
83
- var name = decode(parts.shift());
84
- var cookie = parts.join('=');
85
-
86
- if (key && key === name) {
87
- // If second argument (value) is a function it's a converter...
88
- result = read(cookie, value);
89
- break;
90
- }
91
-
92
- // Prevent storing a cookie that we couldn't decode.
93
- if (!key && (cookie = read(cookie)) !== undefined) {
94
- result[name] = cookie;
95
- }
96
- }
97
-
98
- return result;
99
- };
100
-
101
- config.defaults = {};
102
-
103
- $.removeCookie = function (key, options) {
104
- if ($.cookie(key) === undefined) {
105
- return false;
106
- }
107
-
108
- // Must not alter options, thus extending a fresh object...
109
- $.cookie(key, '', $.extend({}, options, { expires: -1 }));
110
- return !$.cookie(key);
111
- };
112
-
113
- }));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/tracking/leadin.js DELETED
@@ -1,501 +0,0 @@
1
- var page_title = jQuery(document).find("title").text();
2
- var page_url = window.location.href;
3
- var page_referrer = document.referrer;
4
- var form_saved = false;
5
-
6
- jQuery(document).ready( function ( $ ) {
7
-
8
- var hashkey = $.cookie("li_hash");
9
- var li_submission_cookie = $.cookie("li_submission");
10
-
11
- // The submission didn't officially finish before the page refresh, so try it again
12
- if ( li_submission_cookie )
13
- {
14
- var submission_data = JSON.parse(li_submission_cookie);
15
- leadin_insert_form_submission(
16
- submission_data.submission_hash,
17
- submission_data.hashkey,
18
- submission_data.page_title,
19
- submission_data.page_url,
20
- submission_data.json_form_fields,
21
- submission_data.lead_email,
22
- submission_data.lead_first_name,
23
- submission_data.lead_last_name,
24
- submission_data.lead_phone,
25
- submission_data.form_submission_type,
26
- function ( data ) {
27
- // Form was submitted successfully before page reload. Delete cookie for this submission
28
- $.removeCookie('li_submission', {path: "/", domain: ""});
29
- }
30
- );
31
- }
32
-
33
- if ( !hashkey )
34
- {
35
- hashkey = Math.random().toString(36).slice(2);
36
- $.cookie("li_hash", hashkey, {path: "/", domain: ""});
37
- leadin_insert_lead(hashkey, page_referrer);
38
- }
39
-
40
- leadin_log_pageview(hashkey, page_title, page_url, page_referrer, $.cookie('li_last_visit'));
41
-
42
- var date = new Date();
43
- var current_time = date.getTime();
44
- date.setTime(date.getTime() + (60 * 60 * 1000));
45
-
46
- // The li_last_visit has expired, so check to see if this is a stale contact that has been merged
47
- if ( !$.cookie('li_last_visit') )
48
- {
49
- leadin_check_merged_contact(hashkey);
50
- }
51
-
52
- $.cookie("li_last_visit", current_time, {path: "/", domain: "", expires: date});
53
- });
54
-
55
- jQuery(function($){
56
-
57
- // Many WordPress sites run outdated version of jQuery. This is a fix to support jQuery < 1.7.0 and futureproof the plugin when bind, live, etc are deprecated
58
- if ( $.versioncompare($.fn.jquery, '1.7.0') != -1 )
59
- {
60
- $(document).on('submit', 'form', function( e ) {
61
- var $form = $(this).closest('form');
62
- leadin_submit_form($form, $);
63
- });
64
- }
65
- else
66
- {
67
- $(document).bind('submit', 'form', function( e ) {
68
- var $form = $(this).closest('form');
69
- leadin_submit_form($form, $);
70
- });
71
- }
72
- });
73
-
74
- function leadin_submit_form ( $form, $, form_type )
75
- {
76
- var $this = $form;
77
-
78
- var form_fields = [];
79
- var lead_email = '';
80
- var lead_first_name = '';
81
- var lead_last_name = '';
82
- var lead_phone = '';
83
- var form_submission_type = ( form_type ? form_type : 'lead' );
84
- var ignore_form = false;
85
-
86
- // Excludes hidden input fields + submit inputs
87
- $this.find('input[type!="submit"], textarea').not('input[type="hidden"], input[type="radio"], input[type="password"]').each( function ( index ) {
88
- var $element = $(this);
89
- var $value = $element.val();
90
-
91
- if ( !$element.is(':visible' ) )
92
- return true;
93
-
94
- // Check if input has an attached lable using for= tag
95
- var $label = $("label[for='" + $element.attr('id') + "']").text();
96
-
97
- // Check for label in same container immediately before input
98
- if ($label.length == 0)
99
- {
100
- $label = $element.prev('label').not('.li_used').addClass('li_used').first().text();
101
-
102
- if ( !$label.length )
103
- {
104
- $label = $element.prevAll('b, strong, span').text(); // Find previous closest string
105
- }
106
- }
107
-
108
- // Check for label in same container immediately after input
109
- if ($label.length == 0)
110
- {
111
- $label = $element.next('label').not('.li_used').addClass('li_used').first().text();
112
-
113
- if ( !$label.length )
114
- {
115
- $label = $element.nextAll('b, strong, span').text(); // Find next closest string
116
- }
117
- }
118
-
119
- // Checks the parent for a label or bold text
120
- if ($label.length == 0)
121
- {
122
- $label = $element.parent().find('label, b, strong').not('.li_used').first().text();
123
- }
124
-
125
- // Checks the parent's parent for a label or bold text
126
- if ($label.length == 0)
127
- {
128
- if ( $.contains($this, $element.parent().parent()) )
129
- {
130
- $label = $element.parent().parent().find('label, b, strong').first().text();
131
- }
132
- }
133
-
134
- // Looks for closests p tag parent, and looks for label inside
135
- if ( $label.length == 0 )
136
- {
137
- $p = $element.closest('p').not('.li_used').addClass('li_used');
138
-
139
- // This gets the text from the p tag parent if it exists
140
- if ( $p.length )
141
- {
142
- $label = $p.text();
143
- $label = $.trim($label.replace($value, "")); // Hack to exclude the textarea text from the label text
144
- }
145
- }
146
-
147
- // Check for placeholder attribute
148
- if ( $label.length == 0 )
149
- {
150
- if ( $element.attr('placeholder') !== undefined )
151
- {
152
- $label = $element.attr('placeholder').toString();
153
- }
154
- }
155
-
156
- if ( $label.length == 0 )
157
- {
158
- if ( $element.attr('name') !== undefined )
159
- {
160
- $label = $element.attr('name').toString();
161
- }
162
- }
163
-
164
- if ( $element.is(':checkbox') )
165
- {
166
- if ( $element.is(':checked'))
167
- {
168
- $value = 'Checked';
169
- }
170
- else
171
- {
172
- $value = 'Not checked';
173
- }
174
- }
175
-
176
- // Remove fakepath from input[type="file"]
177
- $value = $value.replace("C:\\fakepath\\", "");
178
-
179
- var $label_text = $.trim($label.replaceArray(["(", ")", "required", "Required", "*", ":"], [""]));
180
-
181
- if ( $label_text.toLowerCase().indexOf('credit card') != -1 || $label_text.toLowerCase().indexOf('card number') != -1 )
182
- ignore_form = true;
183
-
184
- push_form_field($label_text, $value, form_fields);
185
-
186
- if ( $value.indexOf('@') != -1 && $value.indexOf('.') != -1 && !lead_email )
187
- lead_email = $value;
188
-
189
- if ( $element.attr('id') == 'leadin-subscribe-fname')
190
- lead_first_name = $value;
191
-
192
- if ( $element.attr('id') == 'leadin-subscribe-lname')
193
- lead_last_name = $value;
194
-
195
- if ( $element.attr('id') == 'leadin-subscribe-phone')
196
- lead_phone = $value;
197
- });
198
-
199
- var radio_groups = [];
200
- var rbg_label_values = [];
201
- $this.find(":radio").each(function(){
202
- if ( $.inArray(this.name, radio_groups) == -1 )
203
- radio_groups.push(this.name);
204
- rbg_label_values.push($(this).val());
205
- });
206
-
207
- for ( var i = 0; i < radio_groups.length; i++ )
208
- {
209
- var $rbg = $("input:radio[name='" + radio_groups[i] + "']");
210
- var $rbg_value = $("input:radio[name='" + radio_groups[i] + "']:checked").val();
211
-
212
- if ( $this.find('.gfield').length ) // Hack for gravity forms
213
- $p = $rbg.closest('.gfield').not('.li_used').addClass('li_used');
214
- else if ( $this.find('.frm_form_field').length ) // Hack for Formidable
215
- $p = $rbg.closest('.frm_form_field').not('.li_used').addClass('li_used');
216
- else
217
- $p = $rbg.closest('div, p').not('.li_used').addClass('li_used');
218
-
219
- // This gets the text from the p tag parent if it exists
220
- if ( $p.length )
221
- {
222
- //$p.find('label, strong, span, b').html();
223
- $rbg_label = $p.text();
224
- $rbg_label = $.trim($rbg_label.replaceArray(rbg_label_values, [""]).replace($p.find('.gfield_description').text(), ''));
225
- // Remove .gfield_description from gravity forms
226
- }
227
-
228
- var rgb_selected = ( !$("input:radio[name='" + radio_groups[i] + "']:checked").val() ) ? 'not selected' : $("input:radio[name='" + radio_groups[i] + "']:checked").val();
229
-
230
- push_form_field($rbg_label, rgb_selected, form_fields);
231
- }
232
-
233
- $this.find('select').each( function ( ) {
234
- var $select = $(this);
235
- var $select_label = $("label[for='" + $select.attr('id') + "']").text();
236
-
237
- if ( !$select_label.length )
238
- {
239
- var select_values = [];
240
- $select.find("option").each(function(){
241
- if ( $.inArray($(this).val(), select_values) == -1 )
242
- select_values.push($(this).val());
243
- });
244
-
245
- $p = $select.closest('div, p').not('.li_used').addClass('li_used');
246
-
247
- if ( $this.find('.gfield').length ) // Hack for gravity forms
248
- $p = $select.closest('.gfield').not('.li_used').addClass('li_used');
249
- else
250
- {
251
- $p = $select.closest('div, p').addClass('li_used');
252
- }
253
-
254
- if ( $p.length )
255
- {
256
- $select_label = $p.text();
257
- $select_label = $.trim($select_label.replaceArray(select_values, [""]).replace($p.find('.gfield_description').text(), ''));
258
- }
259
- }
260
-
261
- var select_value = '';
262
- if ( $select.val() instanceof Array )
263
- {
264
- var select_vals = $select.val();
265
-
266
- for ( i = 0; i < select_vals.length; i++ )
267
- {
268
- select_value += select_vals[i];
269
- if ( i != select_vals.length - 1 )
270
- select_value += ', ';
271
- }
272
- }
273
- else
274
- {
275
- select_value = $select.val();
276
- }
277
-
278
- push_form_field($select_label, select_value, form_fields);
279
- });
280
-
281
- $this.find('.li_used').removeClass('li_used'); // Clean up added classes
282
-
283
- if ( $this.find('#comment_post_ID').length )
284
- {
285
- form_submission_type = 'comment';
286
- }
287
-
288
- // Save submission into database if email is present and form is not ignore, send LeadIn email, and submit form as usual
289
- if ( lead_email && ! ignore_form )
290
- {
291
- var submission_hash = Math.random().toString(36).slice(2);
292
- var hashkey = $.cookie("li_hash");
293
- var json_form_fields = JSON.stringify(form_fields);
294
-
295
- var form_submission = {};
296
- form_submission = {
297
- "submission_hash": submission_hash,
298
- "hashkey": hashkey,
299
- "lead_email": lead_email,
300
- "lead_first_name": lead_first_name,
301
- "lead_last_name": lead_last_name,
302
- "lead_phone": lead_phone,
303
- "page_title": page_title,
304
- "page_url": page_url,
305
- "json_form_fields": json_form_fields,
306
- "form_submission_type": form_submission_type,
307
- };
308
-
309
- $.cookie("li_submission", JSON.stringify(form_submission), {path: "/", domain: ""});
310
-
311
- leadin_insert_form_submission(
312
- submission_hash,
313
- hashkey,
314
- page_title,
315
- page_url,
316
- json_form_fields,
317
- lead_email,
318
- lead_first_name,
319
- lead_last_name,
320
- lead_phone,
321
- form_submission_type,
322
- function ( data ) {
323
- // Form was executed 100% successfully before page reload. Delete cookie for this submission
324
- $.removeCookie('li_submission', {path: "/", domain: ""});
325
- }
326
- );
327
- }
328
- else // No lead - submit form as usual
329
- {
330
- form_saved = true;
331
- }
332
- }
333
-
334
- function leadin_check_merged_contact ( hashkey )
335
- {
336
- jQuery.ajax({
337
- type: 'POST',
338
- url: li_ajax.ajax_url,
339
- data: {
340
- "action": "leadin_check_merged_contact",
341
- "li_id": hashkey
342
- },
343
- success: function(data){
344
- // Force override the current tracking with the merged value
345
- var json_data = jQuery.parseJSON(data);
346
- if ( json_data )
347
- jQuery.cookie("li_hash", json_data, {path: "/", domain: ""});
348
- },
349
- error: function ( error_data ) {
350
- //alert(error_data);
351
- }
352
- });
353
- }
354
-
355
- function leadin_check_visitor_status ( hashkey, callback )
356
- {
357
- jQuery.ajax({
358
- type: 'POST',
359
- url: li_ajax.ajax_url,
360
- data: {
361
- "action": "leadin_check_visitor_status",
362
- "li_id": hashkey
363
- },
364
- success: function(data){
365
- // Force override the current tracking with the merged value
366
- var json_data = jQuery.parseJSON(data);
367
-
368
- if ( callback )
369
- callback(json_data);
370
- },
371
- error: function ( error_data ) {
372
- //alert(error_data);
373
- }
374
- });
375
- }
376
-
377
- function leadin_log_pageview ( hashkey, page_title, page_url, page_referrer, last_visit )
378
- {
379
- jQuery.ajax({
380
- type: 'POST',
381
- url: li_ajax.ajax_url,
382
- data: {
383
- "action": "leadin_log_pageview",
384
- "li_id": hashkey,
385
- "li_title": page_title,
386
- "li_url": page_url,
387
- "li_referrer": page_referrer,
388
- "li_last_visit": last_visit
389
- },
390
- success: function(data){
391
- },
392
- error: function ( error_data ) {
393
- //alert(error_data);
394
- }
395
- });
396
- }
397
-
398
- function leadin_insert_lead ( hashkey, page_referrer ) {
399
- jQuery.ajax({
400
- type: 'POST',
401
- url: li_ajax.ajax_url,
402
- data: {
403
- "action": "leadin_insert_lead",
404
- "li_id": hashkey,
405
- "li_referrer": page_referrer
406
- },
407
- success: function(data){
408
- },
409
- error: function ( error_data ) {
410
- //alert(error_data);
411
- }
412
- });
413
- }
414
-
415
- function leadin_insert_form_submission ( submission_haskey, hashkey, page_title, page_url, json_fields, lead_email, lead_first_name, lead_last_name, lead_phone, form_submission_type, Callback )
416
- {
417
- jQuery.ajax({
418
- type: 'POST',
419
- url: li_ajax.ajax_url,
420
- data: {
421
- "action": "leadin_insert_form_submission",
422
- "li_submission_id": submission_haskey,
423
- "li_id": hashkey,
424
- "li_title": page_title,
425
- "li_url": page_url,
426
- "li_fields": json_fields,
427
- "li_email": lead_email,
428
- "li_first_name": lead_first_name,
429
- "li_last_name": lead_last_name,
430
- "li_phone": lead_phone,
431
- "li_submission_type": form_submission_type
432
- },
433
- success: function(data){
434
- if ( Callback )
435
- Callback(data);
436
- },
437
- error: function ( error_data ) {
438
- //alert(error_data);
439
- }
440
- });
441
-
442
- }
443
-
444
- function push_form_field ( label, value, form_fields )
445
- {
446
- var field = {
447
- label: label,
448
- value: value
449
- };
450
-
451
- form_fields.push(field);
452
- }
453
-
454
- String.prototype.replaceArray = function(find, replace) {
455
- var replaceString = this;
456
- for (var i = 0; i < find.length; i++) {
457
- if ( replace.length != 1 )
458
- replaceString = replaceString.replace(find[i], replace[i]);
459
- else
460
- replaceString = replaceString.replace(find[i], replace[0]);
461
- }
462
- return replaceString;
463
- };
464
-
465
- /**
466
- * Checks the version number of jQuery and compares to string
467
- *
468
- * @param string
469
- * @param string
470
- *
471
- * @return bool
472
- */
473
-
474
- (function($){
475
- $.versioncompare = function(version1, version2){
476
- if ('undefined' === typeof version1) {
477
- throw new Error("$.versioncompare needs at least one parameter.");
478
- }
479
- version2 = version2 || $.fn.jquery;
480
- if (version1 == version2) {
481
- return 0;
482
- }
483
- var v1 = normalize(version1);
484
- var v2 = normalize(version2);
485
- var len = Math.max(v1.length, v2.length);
486
- for (var i = 0; i < len; i++) {
487
- v1[i] = v1[i] || 0;
488
- v2[i] = v2[i] || 0;
489
- if (v1[i] == v2[i]) {
490
- continue;
491
- }
492
- return v1[i] > v2[i] ? 1 : -1;
493
- }
494
- return 0;
495
- };
496
- function normalize(version){
497
- return $.map(version.split('.'), function(value){
498
- return parseInt(value, 10);
499
- });
500
- }
501
- }(jQuery));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/admin/_contact_detail_page.sass DELETED
@@ -1,125 +0,0 @@
1
- #leadin
2
-
3
- .header-wrap
4
- @include pie-clearfix
5
- padding: 9px 15px 4px 0
6
-
7
- h1, img
8
- float: left
9
-
10
- h1
11
- padding: 0 0 0 10px
12
- margin: 0
13
-
14
- .contact-name
15
- line-height: 40px
16
-
17
- .contact-info
18
- h3
19
- margin: 0
20
-
21
- label
22
- font-weight: bold
23
- line-height: 1
24
- cursor: default
25
-
26
- .contact-history
27
- padding-left: 20px
28
- margin-left: 20px
29
- border-left: 2px solid $color-border
30
-
31
- .session
32
-
33
- & + .session
34
- margin-top: $base-vertical-unit*5
35
-
36
- .session-date
37
- position: relative
38
-
39
- &:before
40
- content: "\2022"
41
- font-size: 32px
42
- line-height: 0
43
- height: 31px
44
- width: 31px
45
- position: absolute
46
- left: -27px
47
- top: 9px
48
- color: $color-border
49
-
50
- .session-time-range
51
- color: $color-text-light
52
- font-weight: 400
53
-
54
- .events
55
- background-color: #fff
56
- border: 1px solid $color-border
57
- @include box-shadow(0 1px 1px rgba(0,0,0,.04))
58
-
59
- .event
60
- margin: 0
61
- padding: 10px 20px
62
- border:
63
- bottom: 1px solid $color-border
64
- left: 4px solid
65
- +pie-clearfix()
66
-
67
- &:first-child
68
- border-top: 0
69
-
70
- &.pageview
71
- border-left-color: $blue
72
- color: $blue
73
-
74
- &.form-submission
75
- border-left-color: $orange
76
- color: $orange
77
-
78
- &.source
79
- border-left-color: $green
80
- color: $green
81
-
82
- .event-title
83
- margin: 0
84
- font-size: 13px
85
- font-weight: 600
86
-
87
- .event-time
88
- float: left
89
- font-weight: 400
90
- width: 75px
91
-
92
- .event-content
93
- margin-left: 75px
94
-
95
- .event-detail
96
- margin:
97
- top: 20px
98
- color: $color-text
99
-
100
- li + li
101
- padding-top: $base-vertical-unit
102
- border-top: 1px solid $color-border-light
103
-
104
- &.pageview-url
105
- color: $color-text-lighter
106
-
107
- .visit-source
108
- p
109
- margin: 0
110
- color: $blue-dark
111
-
112
- .field-label
113
- text-transform: uppercase
114
- letter-spacing: 0.05em
115
- color: $color-text-light
116
- margin-bottom: 6px
117
- font-size: 0.9em
118
-
119
- .field-value
120
- margin: 0
121
-
122
- &.pre-mp6
123
-
124
- .events
125
- background-color: #f9f9f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/admin/_contacts_list_page.sass DELETED
@@ -1,12 +0,0 @@
1
- #leadin-contacts
2
-
3
- th
4
-
5
- &#source
6
- width: 20%
7
-
8
- &#visits, &#submissions
9
- width: 8%
10
-
11
- &#status, &#last_visit, &#date, &#pageviews
12
- width: 10%
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/admin/_grid.sass DELETED
@@ -1,26 +0,0 @@
1
- @import "susyone"
2
-
3
- // Settings
4
-
5
- $break: 782px 12
6
-
7
- $total-columns: 12
8
- $column-width: 80px
9
- $gutter-width: 20px
10
- $grid-padding: 20px
11
-
12
- #leadin
13
- @include container($total-columns, $break)
14
- margin: 10px 0 0
15
- padding: 0
16
-
17
- *
18
- box-sizing: border-box
19
-
20
- @include at-breakpoint($break)
21
- margin: 10px 0 0
22
- padding: 0
23
-
24
- // Layout
25
-
26
- @include at-breakpoint($break)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/admin/_metabox.sass DELETED
@@ -1,16 +0,0 @@
1
- #li_analytics-meta
2
-
3
- .li-analytics-link
4
- float: left
5
-
6
- .li-analytics__face
7
- height: 35px
8
- width: 35px
9
- margin-right: 5px
10
- margin-bottom: 5px
11
-
12
- .hidden_face
13
- display: none
14
-
15
- .show-all-faces-container
16
- clear: both
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/admin/_powerups_page.sass DELETED
@@ -1,27 +0,0 @@
1
- .powerup-list
2
- margin: 0
3
-
4
- .powerup
5
- border: 2px solid
6
- width: 20%
7
- min-width: 250px
8
- float: left
9
- margin: $grid-padding
10
- padding: 15px
11
- background-color: #f9f9f9
12
- border-color: #ccc
13
- text-align: center
14
- @include border-radius(10px)
15
-
16
- h2, p, img
17
- margin: 0
18
- padding: 0
19
- color: #666
20
- margin-bottom: 15px
21
-
22
- &.activated
23
- background-color: $teal-background
24
- border-color: $teal-dark
25
-
26
- h2, p
27
- color: $teal-dark
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/admin/_settings_page.sass DELETED
@@ -1,175 +0,0 @@
1
- .li-settings
2
- h3
3
- border-left: 1px solid #e5e5e5
4
- border-right: 1px solid #e5e5e5
5
- border-top: 1px solid #e5e5e5
6
- border-bottom: 1px solid #e5e5e5
7
- margin-bottom: 0px
8
- background: #fff
9
- padding: 8px 12px
10
- font-size: 15px
11
-
12
- .form-table
13
- margin-top: 0px
14
- border-left: 1px solid #e5e5e5
15
- border-right: 1px solid #e5e5e5
16
- border-bottom: 1px solid #e5e5e5
17
- background-color: #fff
18
- +box-shadow(0 1px 1px rgba(0,0,0,.04))
19
-
20
- th
21
- padding-left: 12px
22
-
23
- .leadin-section
24
- background-color: #fff
25
- border-left: 1px solid #e5e5e5
26
- border-right: 1px solid #e5e5e5
27
- font-size: 14px
28
- padding: 15px 12px 5px 12px
29
-
30
- p
31
- margin: 0
32
- padding: 0
33
-
34
- &.pre-mp6
35
- h3
36
- font-family: Georgia
37
-
38
- select, input
39
- font-family: sans-serif
40
- font-size: 12px
41
-
42
- .form-table, .leadin-section, h3
43
- background-color: #f9f9f9 !important
44
-
45
- .form-table
46
- +border-bottom-left-radius(3px)
47
- +border-bottom-right-radius(3px)
48
-
49
- h3
50
- background-color: #f9f9f9 !important
51
- +border-top-left-radius(3px)
52
- +border-top-right-radius(3px)
53
-
54
- .leadin-section
55
- font-size: 12px
56
- padding-left: 6px
57
-
58
- h3
59
- padding-left: 6px
60
- font-weight: normal
61
- color: #464646
62
- text-shadow: #fff 0px 1px 0px
63
-
64
- label
65
- font-size: 12px
66
-
67
- input[type="checkbox"], input[type="radio"]
68
- margin-right: 2px
69
-
70
- #icon-leadin
71
- background: url('../../images/leadin-icon-32x32.png') top center no-repeat
72
-
73
- .help-notification
74
- background: #d9edf7
75
- border: 1px solid #bce8f1
76
- padding: 10px
77
- -webkit-border-radius: 3px
78
- -moz-border-radius: 3px
79
- border-radius: 3px
80
-
81
- .toplevel_page_leadin_contacts .wp-menu-image img
82
- width: 16px
83
- height: 16px
84
-
85
- .leadin-contact-avatar
86
- margin-right: 10px
87
-
88
- .power-up-settings-icon
89
- padding-right: 10px
90
- float: left
91
- max-height: 20px
92
- margin-top: -1px
93
-
94
- .dashicons
95
- margin-right: 10px
96
- float: left
97
- margin-top: -1px
98
-
99
- .steps
100
- margin: $base-vertical-unit*8 auto 0
101
- text-align: center
102
- max-width: 600px
103
-
104
- h3, p
105
- margin: 0
106
-
107
- .step-names
108
- margin: 0
109
- +pie-clearfix
110
-
111
- .step-name
112
- color: #ccc
113
- display: list-item
114
- float: left
115
- width: 33%
116
- margin: 0
117
- padding-bottom: $base-vertical-unit*3
118
- font-size: 16px
119
- list-style: decimal inside none
120
-
121
- &.active
122
- color: $teal-dark
123
- background-image: url(../../images/triangle.png)
124
- background-position: bottom center
125
- background-repeat: no-repeat
126
-
127
- &.completed
128
- list-style-image: url(../../images/checkmark.png)
129
-
130
- .step-content
131
- margin: 0
132
-
133
- .description
134
- margin: 10px 0 20px
135
- display: block
136
-
137
- .step
138
- display: none
139
- padding: $base-vertical-unit*3
140
- background-color: $teal-background
141
- border: 2px solid $teal
142
- +border-radius(5px)
143
- color: $teal-dark
144
-
145
- h2
146
- color: $teal-dark
147
- margin:
148
- top: 0
149
- bottom: $base-vertical-unit*3
150
-
151
- ol
152
- text-align: left
153
- margin-bottom: $base-vertical-unit*3
154
-
155
- label
156
- text-align: right
157
-
158
- &.active
159
- display: block
160
-
161
- .form-table
162
- th
163
- display: none
164
-
165
- td
166
- text-align: center
167
- width: auto
168
- display: block
169
-
170
- input
171
- width: 100%
172
- font-size: 16px
173
- line-height: 1.5
174
- padding: 7px 10px
175
- display: block
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/admin/_tables.sass DELETED
@@ -1,94 +0,0 @@
1
- $table-controls-pading: $base-vertical-unit*2
2
- $table-controls-border-size: 2px
3
-
4
- #leadin
5
-
6
- .top_table_controls
7
- border-bottom: $table-controls-border-size solid $color-border
8
- margin: 0 0 $base-vertical-unit*3 0
9
- margin-bottom: $base-vertical-unit*3 - $table-controls-border-size
10
- @include pie-clearfix
11
-
12
- .table_segment_picker
13
- float: left
14
- margin: 0
15
-
16
- li
17
- display: inline-block
18
- margin: 0
19
-
20
- & + li
21
- margin-left: 2em
22
- a
23
- display: block
24
- padding: $table-controls-pading 0
25
- line-height: $base-vertical-unit*4
26
- font-weight: 300
27
- font-size: 16px
28
- text-decoration: none
29
-
30
- @include at-breakpoint($break)
31
- font-size: 20px
32
-
33
- &.current
34
- margin-bottom: -2px
35
- font-weight: 400
36
- border-bottom: 2px solid $color-primary
37
-
38
- &.current, &:hover, &:active
39
- color: $color-primary
40
-
41
- .table_search
42
- float: right
43
- padding: ($table-controls-pading - 2px) 0
44
- padding-bottom: $table-controls-pading - 3px
45
-
46
- table
47
- .leadin-contact-avatar
48
- float: left
49
-
50
- th, td
51
- display: none
52
-
53
- &:nth-child(-n+3)
54
- display: table-cell
55
-
56
- @include at-breakpoint($break)
57
- display: table-cell
58
-
59
- &.pre-mp6
60
- .table_search
61
- float: right
62
- padding: $table-controls-pading 0
63
- padding-bottom: $table-controls-pading - 1px
64
-
65
- table
66
- background-color: #fff
67
- border-color: $color-border
68
-
69
- tr
70
-
71
- &.alternate
72
- background-color: #fff
73
-
74
- th, td
75
- border-top: 0
76
- padding: $base-vertical-unit*2 $base-vertical-unit $base-vertical-unit*2 - 1px
77
-
78
- a
79
- padding: 0
80
-
81
- th[scope="col"]
82
- background: #eee
83
- font-family: $font-sans
84
- font-size: 12px
85
- text-shadow: none
86
-
87
- td
88
- border-color: $color-border
89
- line-height: $base-vertical-unit*3
90
- font-size: 14px
91
-
92
- .row-actions
93
- float: left
94
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/admin/_variables.sass DELETED
@@ -1,60 +0,0 @@
1
- $base-vertical-unit: 6px
2
- $font-sans: sans-serif
3
-
4
- $color-primary: #F66000
5
- $color-secondary: #F66000
6
-
7
- $color-text: #444
8
- $color-text-light: #999
9
- $color-text-lighter: #ccc
10
-
11
- $color-border: #dedede
12
- $color-border-light: #eeeeee
13
-
14
- // orange
15
- $orange-darker: #71350E
16
- $orange-dark: #B34A12
17
- $orange: #F66000
18
- $orange-light: #F88E4B
19
- $orange-lighter: #FBBF99
20
- $orange-background: #FDDFCC
21
-
22
- // blue
23
- $blue-darker: #1D5072
24
- $blue-dark: #1F6696
25
- $blue: #2288CC
26
- $blue-light: #64AADA
27
- $blue-lighter: #A7CFEB
28
- $blue-background: #D3E7F5
29
-
30
- // teal
31
- $teal-darker: #1D524C
32
- $teal-dark: #1F7D71
33
- $teal: #22AA99
34
- $teal-light: #64C2B6
35
- $teal-lighter: #A7DDD6
36
- $teal-background: #D3EEEB
37
-
38
- // fucia
39
- $fucia-darker: #5A2A45
40
- $fucia-dark: #1F7E72
41
- $fucia: #BB4488
42
- $fucia-light: #CF7BAA
43
- $fucia-lighter: #E4B4CF
44
- $fucia-background: #F1DAE7
45
-
46
- // green
47
- $green-darker: #4C530F
48
- $green-dark: #A27E18
49
- $green: #99AA1F
50
- $green-light: #B7C24B
51
- $green-lighter: #D6DD99
52
- $green-background: #EBEECC
53
-
54
- // grey
55
- $grey: #666
56
- $grey-light: #999
57
- $grey-lighter: #ccc
58
- $grey-background: #f9f9f9
59
- $grey-dark: #444
60
- $grey-darker: #222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/leadin-admin.sass DELETED
@@ -1,86 +0,0 @@
1
- @import "compass/utilities/general/clearfix"
2
- @import "compass/css3"
3
-
4
- @import admin/variables.sass
5
- @import admin/grid.sass
6
- @import admin/tables.sass
7
-
8
- //WordPress stuff
9
- #leadin
10
- padding-right: 20px
11
-
12
- @media screen and (min-width: 500px)
13
- padding-right: 10px
14
-
15
- label
16
- cursor: default
17
-
18
- .col-wrap
19
- padding: 0 14px 0 0
20
-
21
- .metabox-holder
22
- +pie-clearfix
23
-
24
- #leadin-footer
25
- +pie-clearfix
26
- clear: both
27
- margin-top: $base-vertical-unit*8
28
- color: $color-text-light
29
- border-top: 1px solid $color-border
30
-
31
- .support .sharing
32
- height: 18px
33
- text-align: left
34
-
35
- @media screen and (min-width: 500px)
36
- .support, .version, .sharing
37
- width: 50%
38
- float: left
39
-
40
- .sharing
41
- text-align: right
42
-
43
- #wp-admin-bar-leadin-admin-menu
44
-
45
- img
46
- height: 16px
47
- width: 16px
48
- opacity: 0.6
49
-
50
- .leadin-dynamic-avatar_0
51
- background-color: #F88E4B
52
-
53
- .leadin-dynamic-avatar_1
54
- background-color: #64AADA
55
-
56
- .leadin-dynamic-avatar_2
57
- background-color: #64C2B6
58
-
59
- .leadin-dynamic-avatar_3
60
- background-color: #CF7BAA
61
-
62
- .leadin-dynamic-avatar_4
63
- background-color: #E7C24B
64
-
65
- .leadin-dynamic-avatar_5
66
- background-color: #9387DA
67
-
68
- .leadin-dynamic-avatar_6
69
- background-color: #D6DD99
70
-
71
- .leadin-dynamic-avatar_7
72
- background-color: #FF4C4C
73
-
74
- .leadin-dynamic-avatar_8
75
- background-color: #99583D
76
-
77
- .leadin-dynamic-avatar_9
78
- background-color: #54CC14
79
-
80
- // Pages
81
- @import admin/settings_page.sass
82
- @import admin/contacts_list_page.sass
83
- @import admin/contact_detail_page.sass
84
- @import admin/powerups_page.sass
85
- @import admin/metabox.sass
86
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/leadin-lead-notifcation.sass DELETED
@@ -1,63 +0,0 @@
1
- body, .body
2
- background-color: #F1F1F1
3
-
4
- h1
5
- font-size: 26px
6
- line-height: 60px
7
-
8
- h2
9
- font-size: 23px
10
-
11
- h3
12
- font-size: 18px
13
-
14
- h4
15
- font-size: 14px
16
- font-weight: bold
17
-
18
- .submission-detail
19
- h3
20
- color: #666666
21
-
22
- .lead-timeline__pageview-url
23
- a
24
- color: #999999
25
-
26
- .lead-timeline__submission-label
27
- text-transform: uppercase
28
- font-size: 12px
29
- color: #999999
30
- letter-spacing: 0.05em
31
-
32
- .lead-timeline__previous-activity
33
- h2
34
- margin-top: 15px
35
-
36
- .lead-timeline__event
37
- background-color: #FFFFFF
38
- border:
39
- top: 1px solid #DEDEDE
40
- right: 1px solid #DEDEDE
41
-
42
- &.pageview
43
- border-left: 4px solid #2288CC
44
-
45
- .lead-timeline__event-title, .lead-timeline__event-time
46
- color: #1F6696
47
-
48
- &.submission
49
- border-left: 4px solid #F6601D
50
-
51
- .lead-timeline__event-title, .lead-timeline__event-time
52
- color: #B34A12
53
-
54
- &.traffic-source
55
- border-left: 4px solid #99AA1F
56
- border-bottom: 1px solid #DEDEDE
57
- margin-bottom: 20px
58
-
59
- .lead-timeline__event-title, .lead-timeline__event-time
60
- color: #727E14
61
-
62
- .footer
63
- margin-bottom: 20px
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/leadin-subscribe.sass DELETED
@@ -1 +0,0 @@
1
- @import subscribe/vex
 
assets/sass/subscribe/_keyframes.sass DELETED
@@ -1,141 +0,0 @@
1
- @import compass/css3
2
-
3
- @import mixins
4
-
5
- // Overlay/content animations
6
-
7
- =keyframes-vex-fadein
8
- +vex-keyframes("vex-fadein")
9
- 0%
10
- opacity: 0
11
- 100%
12
- opacity: 1
13
-
14
- =keyframes-vex-fadeout
15
- +vex-keyframes("vex-fadeout")
16
- 0%
17
- opacity: 1
18
- 100%
19
- opacity: 0
20
-
21
- // Content animations
22
-
23
- =keyframes-vex-flyin
24
- +vex-keyframes("vex-flyin")
25
- 0%
26
- opacity: 0
27
- +vex-transform(translateY(-40px))
28
- 100%
29
- opacity: 1
30
- +vex-transform(translateY(0))
31
-
32
- =keyframes-vex-flyout
33
- +vex-keyframes("vex-flyout")
34
- 0%
35
- opacity: 1
36
- +vex-transform(translateY(0))
37
- 100%
38
- opacity: 0
39
- +vex-transform(translateY(-40px))
40
-
41
- =keyframes-vex-dropin
42
- +vex-keyframes("vex-dropin")
43
- // We start at 0 first and, while hidden
44
- // move to -800px, where the animation
45
- // really begins. This was necessary because
46
- // otherwise, when starting the animation
47
- // at -800px, the browser scrolls up 800px
48
- // to try to display this object positioned
49
- // above the page.
50
- // https://github.com/HubSpot/vex/issues/21
51
- 0%
52
- +vex-transform(translateY(0))
53
- opacity: 0
54
- 1%
55
- +vex-transform(translateY(-800px))
56
- opacity: 0
57
-
58
- // Real animation begins here
59
- 2%
60
- +vex-transform(translateY(-800px))
61
- opacity: 1
62
- 100%
63
- +vex-transform(translateY(0))
64
- opacity: 1
65
-
66
- =keyframes-vex-dropout
67
- +vex-keyframes("vex-dropout")
68
- 0%
69
- +vex-transform(translateY(0))
70
- 100%
71
- +vex-transform(translateY(-800px))
72
-
73
- =keyframes-vex-slideup
74
- +vex-keyframes("vex-slideup")
75
- // We start at 0 first and, while hidden
76
- // move to -800px, where the animation
77
- // really begins. This was necessary because
78
- // otherwise, when starting the animation
79
- // at -800px, the browser scrolls up 800px
80
- // to try to display this object positioned
81
- // above the page.
82
- // https://github.com/HubSpot/vex/issues/21
83
- 0%
84
- +vex-transform(translateY(0))
85
- opacity: 0
86
- 1%
87
- +vex-transform(translateY(800px))
88
- opacity: 0
89
-
90
- // Real animation begins here
91
- 2%
92
- +vex-transform(translateY(800px))
93
- opacity: 1
94
- 100%
95
- +vex-transform(translateY(0))
96
- opacity: 1
97
-
98
- =keyframes-vex-slidedown
99
- +vex-keyframes("vex-slidedown")
100
- 0%
101
- +vex-transform(translateY(0))
102
- 100%
103
- +vex-transform(translateY(800px))
104
-
105
- =keyframes-vex-flipin-horizontal
106
- +vex-keyframes("vex-flipin-horizontal")
107
- 0%
108
- opacity: 0
109
- +vex-transform(rotateY(-90deg))
110
- 100%
111
- opacity: 1
112
- +vex-transform(rotateY(0deg))
113
-
114
- =keyframes-vex-flipout-horizontal
115
- +vex-keyframes("vex-flipout-horizontal")
116
- 0%
117
- opacity: 1
118
- +vex-transform(rotateY(0deg))
119
- 100%
120
- opacity: 0
121
- +vex-transform(rotateY(90deg))
122
-
123
- // Spinner animations
124
-
125
- =keyframes-vex-rotation
126
- +vex-keyframes("vex-rotation")
127
- 0%
128
- +vex-transform(rotate(0deg))
129
- 100%
130
- +vex-transform(rotate(359deg))
131
-
132
- // Button animations
133
-
134
- =keyframes-vex-pulse
135
- +vex-keyframes("vex-pulse")
136
- 0%
137
- +box-shadow(inset 0 0 0 300px transparent)
138
- 70%
139
- +box-shadow(inset 0 0 0 300px rgba(255, 255, 255, .25))
140
- 100%
141
- +box-shadow(inset 0 0 0 300px transparent)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/subscribe/_mixins.sass DELETED
@@ -1,31 +0,0 @@
1
- =vex-keyframes($name)
2
- @keyframes #{$name}
3
- @content
4
- @-webkit-keyframes #{$name}
5
- @content
6
- @-moz-keyframes #{$name}
7
- @content
8
- @-ms-keyframes #{$name}
9
- @content
10
- @-o-keyframes #{$name}
11
- @content
12
-
13
- =vex-animation($animation)
14
- animation: $animation
15
- -webkit-animation: $animation
16
- -moz-animation: $animation
17
- -ms-animation: $animation
18
- -o-animation: $animation
19
- -webkit-backface-visibility: hidden
20
-
21
- =vex-transform($transform)
22
- transform: $transform
23
- -webkit-transform: $transform
24
- -moz-transform: $transform
25
- -ms-transform: $transform
26
- -o-transform: $transform
27
-
28
- =vex-preserve-3d
29
- -webkit-transform-style: preserve-3d
30
- -moz-transform-style: preserve-3d
31
- transform-style: preserve-3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/subscribe/_vex-theme-bottom-right-corner.sass DELETED
@@ -1,118 +0,0 @@
1
- @import compass/css3
2
- @import compass/utilities/general/clearfix
3
-
4
- @import mixins
5
- @import keyframes
6
-
7
- +keyframes-vex-slideup
8
- +keyframes-vex-slidedown
9
- +keyframes-vex-pulse
10
-
11
- $blue: #3288e6
12
-
13
- .vex.vex-theme-bottom-right-corner,
14
- .vex.vex-theme-bottom-left-corner
15
- top: auto
16
- bottom: 0
17
- right: 0
18
- overflow: visible
19
-
20
- .vex-overlay
21
- display: none
22
-
23
- &.vex-closing .vex-content
24
- +vex-animation(vex-slidedown .5s)
25
-
26
- .vex-content
27
- +vex-animation(vex-slideup .5s)
28
-
29
- .vex-content
30
- font-family: "Helvetica Neue", sans-serif
31
- background: #f0f0f0
32
- color: #444
33
- padding: 1em
34
- max-width: 100%
35
- width: 450px
36
- font-size: 1.1em
37
- line-height: 1.5em
38
- position: fixed
39
- bottom: 0
40
-
41
- h1, h2, h3, h4, h5, h6, p, ul, li
42
- color: inherit
43
-
44
- .vex-close
45
- +border-radius(5px)
46
- position: absolute
47
- top: 0
48
- right: 0
49
- cursor: pointer
50
-
51
- &:before
52
- +border-radius(3px)
53
- position: absolute
54
- content: "\00D7"
55
- font-size: 26px
56
- font-weight: normal
57
- line-height: 31px
58
- height: 30px
59
- width: 30px
60
- text-align: center
61
- top: 3px
62
- right: 3px
63
- color: #bbb
64
- background: transparent
65
-
66
- &:hover:before, &:active:before
67
- color: #777
68
- background: #e0e0e0
69
-
70
- .vex-dialog-form
71
-
72
- .vex-dialog-message
73
- margin-bottom: .5em
74
-
75
- .vex-dialog-input
76
- margin-bottom: 1em
77
-
78
- textarea, input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"]
79
- +border-radius(3px)
80
- background: #fff
81
- width: 100%
82
- padding: .25em .67em
83
- border: 0
84
- font-family: inherit
85
- font-weight: inherit
86
- font-size: inherit
87
- min-height: 2.5em
88
- margin: 0 0 .25em
89
-
90
- &:focus
91
- +box-shadow(inset 0 0 0 2px lighten($blue, 20%))
92
- outline: none
93
-
94
- .vex-dialog-buttons
95
- +pie-clearfix()
96
-
97
- .vex.vex-theme-bottom-right-corner
98
-
99
- .vex-content
100
- +border-radius(5px 0 0 0)
101
- right: 0
102
- left: auto
103
-
104
- .vex.vex-theme-bottom-left-corner
105
-
106
- .vex-content
107
- +border-radius(0 5px 0 0)
108
- left: 0
109
- right: auto
110
-
111
- .vex-loading-spinner.vex-theme-bottom-right-corner
112
- +box-shadow(0 0 0 .5em #f0f0f0, 0 0 1px .5em rgba(0, 0, 0, 0.3))
113
- +border-radius(100%)
114
- background: #f0f0f0
115
- border: .2em solid transparent
116
- border-top-color: #bbb
117
- top: -1.1em
118
- bottom: auto
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/subscribe/_vex-theme-default.sass DELETED
@@ -1,133 +0,0 @@
1
- @import compass/css3
2
- @import compass/utilities/general/clearfix
3
-
4
- @import mixins
5
- @import keyframes
6
-
7
- +keyframes-vex-flyin
8
- +keyframes-vex-flyout
9
- +keyframes-vex-pulse
10
-
11
- $blue: #3288e6
12
-
13
- .vex.vex-theme-default
14
- padding-top: 160px
15
- padding-bottom: 160px
16
-
17
- &.vex-closing .vex-content
18
- +vex-animation(vex-flyout .5s)
19
-
20
- .vex-content
21
- +vex-animation(vex-flyin .5s)
22
-
23
- .vex-content
24
- +border-radius(5px)
25
- font-family: "Helvetica Neue", sans-serif
26
- background: #f0f0f0
27
- color: #444
28
- padding: 1em
29
- position: relative
30
- margin: 0 auto
31
- max-width: 100%
32
- width: 450px
33
- font-size: 1.1em
34
- line-height: 1.5em
35
-
36
- h1, h2, h3, h4, h5, h6, p, ul, li
37
- color: inherit
38
-
39
- .vex-close
40
- +border-radius(5px)
41
- position: absolute
42
- top: 0
43
- right: 0
44
- cursor: pointer
45
-
46
- &:before
47
- +border-radius(3px)
48
- position: absolute
49
- content: "\00D7"
50
- font-size: 26px
51
- font-weight: normal
52
- line-height: 31px
53
- height: 30px
54
- width: 30px
55
- text-align: center
56
- top: 3px
57
- right: 3px
58
- color: #bbb
59
- background: transparent
60
-
61
- &:hover:before, &:active:before
62
- color: #777
63
- background: #e0e0e0
64
-
65
- .vex-dialog-form
66
-
67
- .vex-dialog-message
68
- margin-bottom: .5em
69
-
70
- .vex-dialog-input
71
- margin-bottom: 1em
72
-
73
- textarea, input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"]
74
- +border-radius(3px)
75
- background: #fff
76
- width: 100%
77
- padding: .25em .67em
78
- border: 0
79
- font-family: inherit
80
- font-weight: inherit
81
- font-size: inherit
82
- min-height: 2.5em
83
- margin: 0 0 .25em
84
-
85
- &:focus
86
- +box-shadow(inset 0 0 0 2px lighten($blue, 20%))
87
- outline: none
88
-
89
- .vex-dialog-buttons
90
- +pie-clearfix()
91
-
92
- .vex-dialog-button
93
- +border-radius(3px)
94
- border: 0
95
- float: right
96
- margin: 0 0 0 .5em
97
- font-family: inherit
98
- text-transform: uppercase
99
- letter-spacing: .1em
100
- font-size: .8em
101
- line-height: 1em
102
- padding: .75em 2em
103
-
104
- &.vex-last
105
- margin-left: 0
106
-
107
- &:focus
108
- +vex-animation(vex-pulse 1.1s infinite)
109
- outline: none
110
-
111
- // vex-pulse uses -webkit-filter which
112
- // doesn't play so nice in mobile webkit
113
- @media (max-width: 568px)
114
- +vex-animation(none)
115
-
116
- &.vex-dialog-button-primary
117
- background: $blue
118
- color: #fff
119
-
120
- &.vex-dialog-button-secondary
121
- background: #e0e0e0
122
- color: #777
123
-
124
-
125
-
126
- .vex-loading-spinner.vex-theme-default
127
- +box-shadow(0 0 0 .5em #f0f0f0, 0 0 1px .5em rgba(0, 0, 0, 0.3))
128
- +border-radius(100%)
129
- background: #f0f0f0
130
- border: .2em solid transparent
131
- border-top-color: #bbb
132
- top: -1.1em
133
- bottom: auto
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/subscribe/_vex-theme-top.sass DELETED
@@ -1,144 +0,0 @@
1
- @import compass/css3
2
- @import compass/utilities/general/clearfix
3
-
4
- @import mixins
5
- @import keyframes
6
-
7
- +keyframes-vex-dropin
8
- +keyframes-vex-dropout
9
- +keyframes-vex-pulse
10
-
11
- $blue: #3288e6
12
-
13
- .vex.vex-theme-top
14
- bottom: inherit
15
-
16
- .vex-overlay
17
- display: none
18
-
19
- &.vex-closing .vex-content
20
- +vex-animation(vex-dropout .5s)
21
-
22
- .vex-content
23
- +vex-animation(vex-dropin .5s)
24
- +pie-clearfix()
25
- font-family: "Helvetica Neue", sans-serif
26
- background: #f0f0f0
27
- color: #444
28
- padding: 0.5em 0.5em 0.25em
29
- position: relative
30
- margin: 0 auto
31
- max-width: 100%
32
- font-size: 1.1em
33
- line-height: 1.5em
34
-
35
- h1, h2, h3, h4, h5, h6, p, ul, li
36
- color: inherit
37
-
38
- .vex-close
39
- +border-radius(5px)
40
- position: absolute
41
- top: 0
42
- right: 0
43
- cursor: pointer
44
-
45
- &:before
46
- +border-radius(3px)
47
- position: absolute
48
- content: "\00D7"
49
- font-size: 26px
50
- font-weight: normal
51
- line-height: 31px
52
- height: 30px
53
- width: 30px
54
- text-align: center
55
- top: 3px
56
- right: 3px
57
- color: #bbb
58
- background: transparent
59
-
60
- &:hover:before, &:active:before
61
- color: #777
62
- background: #e0e0e0
63
-
64
- .vex-dialog-form
65
- text-align: center
66
- margin: 0 90px
67
-
68
- @media only screen and (max-width: 760px)
69
- margin: 0 auto
70
-
71
- .vex-dialog-message, .vex-dialog-input, .vex-dialog-buttons
72
- display: inline-block
73
-
74
- .vex-dialog-input
75
- min-width: 200px
76
- margin: 0 1em
77
-
78
- textarea, input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"]
79
- +border-radius(3px)
80
- background: #fff
81
- width: 100%
82
- padding: .25em .67em
83
- border: 0
84
- font-family: inherit
85
- font-weight: inherit
86
- font-size: inherit
87
- min-height: 2.5em
88
- margin: 0 0 0 0
89
-
90
- &:focus
91
- +box-shadow(inset 0 0 0 2px lighten($blue, 20%))
92
- outline: none
93
-
94
- .vex-dialog-buttons
95
- +pie-clearfix()
96
-
97
- input
98
- float: none
99
-
100
- .leadin-subscribe-powered-by
101
- position: absolute
102
- bottom: 0.5em
103
- right: 0.5em
104
-
105
- .vex-dialog-button
106
- +border-radius(3px)
107
- border: 0
108
- float: right
109
- margin: 0 0 0 .5em
110
- font-family: inherit
111
- text-transform: uppercase
112
- letter-spacing: .1em
113
- font-size: .8em
114
- line-height: 1em
115
- padding: .75em 2em
116
-
117
- &.vex-last
118
- margin-left: 0
119
-
120
- &:focus
121
- +vex-animation(vex-pulse 1.1s infinite)
122
- outline: none
123
-
124
- // vex-pulse uses -webkit-filter which
125
- // doesn't play so nice in mobile webkit
126
- @media (max-width: 568px)
127
- +vex-animation(none)
128
-
129
- &.vex-dialog-button-primary
130
- background: $blue
131
- color: #fff
132
-
133
- &.vex-dialog-button-secondary
134
- background: #e0e0e0
135
- color: #777
136
-
137
- .vex-loading-spinner.vex-theme-top
138
- +box-shadow(0 0 0 .5em #f0f0f0, 0 0 1px .5em rgba(0, 0, 0, 0.3))
139
- +border-radius(100%)
140
- background: #f0f0f0
141
- border: .2em solid transparent
142
- border-top-color: #bbb
143
- top: -1.1em
144
- bottom: auto
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sass/subscribe/_vex.sass DELETED
@@ -1,135 +0,0 @@
1
- @import compass/css3
2
-
3
- @import mixins
4
- @import keyframes
5
-
6
- @import vex-theme-default
7
- @import vex-theme-bottom-right-corner
8
- @import vex-theme-top
9
-
10
- +keyframes-vex-fadein
11
- +keyframes-vex-fadeout
12
- +keyframes-vex-rotation
13
-
14
- .vex, .vex *, .vex *:before, .vex *:after
15
- +box-sizing(border-box)
16
-
17
- .vex
18
- position: fixed
19
- overflow: visible
20
- -webkit-overflow-scrolling: touch
21
- z-index: 1111
22
- top: 0
23
- right: 0
24
- bottom: 0
25
- left: 0
26
-
27
- // IE
28
- .vex-overlay
29
- background: #000
30
- filter: alpha(opacity=40) /* IE 5–7 */
31
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)" /* IE 8 */
32
-
33
- .vex-overlay
34
- +vex-animation(vex-fadein .5s)
35
- position: fixed
36
- background: rgba(0, 0, 0, .4)
37
- top: 0
38
- right: 0
39
- bottom: 0
40
- left: 0
41
-
42
- .vex.vex-closing &
43
- +vex-animation(vex-fadeout .5s)
44
-
45
- .vex-content
46
- +pie-clearfix()
47
- +vex-animation(vex-fadein .5s)
48
- +box-shadow(0px 1px 2px rgba(0,0,0,.15))
49
- background: #fff
50
-
51
- .vex.vex-closing &
52
- +vex-animation(vex-fadeout .5s)
53
-
54
- .powered-by
55
- display: block
56
- font-size: 11px
57
- color: #888
58
- padding: 10px 0 0 0
59
-
60
- .vex-dialog-message, .vex-dialog-input, .vex-dialog-buttons
61
- +pie-clearfix()
62
- font-size: 16px
63
-
64
- .leadin-subscribe-powered-by
65
- float: right
66
- font-size: 12px
67
- font-weight: bold
68
- color: #3288e6
69
-
70
- .vex-close:before
71
- font-family: Arial, sans-serif
72
- content: "\00D7"
73
-
74
- .vex-dialog-form
75
- margin: 0 // Browser reset
76
-
77
- .vex-dialog-message
78
- font-weight: bold
79
-
80
- .vex-dialog-input
81
- .error
82
- +box-shadow(inset 0 0 0 2px #f33f33)
83
-
84
- .vex-dialog-button
85
- -webkit-appearance: none
86
- cursor: pointer
87
- +border-radius(3px)
88
- float: right
89
- margin: 0 0 0 .5em
90
- font-family: inherit
91
- text-transform: uppercase
92
- letter-spacing: .1em
93
- font-size: .8em
94
- line-height: 1em
95
- padding: .75em 2em
96
-
97
- &.vex-last
98
- margin-left: 0
99
-
100
- &:focus, &:hover
101
- outline: none
102
-
103
- &.vex-dialog-button-primary
104
- +box-shadow(none)
105
- border: 0
106
- background: $blue
107
- color: #fff
108
-
109
- &:hover
110
- background: lighten($blue, 10%)
111
-
112
- &.vex-dialog-button-secondary
113
- +box-shadow(none)
114
- border: 0
115
- background: #e0e0e0
116
- color: #777
117
-
118
- .vex-loading-spinner
119
- +vex-animation(vex-rotation .7s linear infinite)
120
- +box-shadow(0 0 1em rgba(0, 0, 0, 0.1))
121
- position: fixed
122
- z-index: 1112
123
- margin: auto
124
- top: 0
125
- right: 0
126
- bottom: 0
127
- left: 0
128
- height: 2em
129
- width: 2em
130
- background: #fff
131
-
132
-
133
- @media only screen and (max-width: 760px)
134
- #leadin-subscribe-mobile-check, .leadin-subscribe-powered-by
135
- display: none
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
images/select2-spinner.gif ADDED
Binary file
images/select2.png ADDED
Binary file
images/select2x2.png ADDED
Binary file
inc/class-emailer-new.php DELETED
@@ -1,160 +0,0 @@
1
- <?php
2
- //=============================================
3
- // LI_Emailer Class
4
- //=============================================
5
- class LI_Emailer_new {
6
-
7
- /**
8
- * Class constructor
9
- */
10
- function __construct ()
11
- {
12
-
13
- }
14
-
15
- /**
16
- * Sends the leads history email
17
- *
18
- * @param string
19
- * @return bool $email_sent Whether the email contents were sent successfully. A true return value does not automatically mean that the user received the email successfully. It just only means that the method used was able to process the request without any errors.
20
- */
21
- function send_new_lead_email ( $hashkey )
22
- {
23
- $li_contact = new LI_Contact();
24
- $li_contact->hashkey = $hashkey;
25
- $li_contact->get_contact_history();
26
- $history = $li_contact->history;
27
-
28
- $body = "";
29
-
30
- $body = $this->build_body($li_contact);
31
-
32
- // Each line in an email can only be 998 characters long, so lines need to be broken with a wordwrap
33
- $body = wordwrap($body, 900, "\r\n");
34
-
35
- $from = $history->lead->lead_email;
36
- $headers = "From: LeadIn <team@leadin.com>\r\n";
37
- $headers.= "Reply-To: LeadIn <" . $from . ">\r\n";
38
- $headers.= "X-Mailer: PHP/" . phpversion() . "\r\n";
39
- $headers.= "MIME-Version: 1.0\r\n";
40
- $headers.= "Content-type: text/html; charset=utf-8\r\n";
41
-
42
- // Get email from plugin settings, if none set, use admin email
43
- $options = get_option('leadin_options');
44
- $to = ( $options['li_email'] ? $options['li_email'] : get_bloginfo('admin_email') ); // Get email from plugin settings, if none set, use admin email
45
-
46
- if ( $history->lead->last_submission_type == "comment" )
47
- {
48
- $subject = "New comment posted on " . $history->submission->form_page_title;
49
- $subject .= " by " . $history->lead->lead_email;
50
- }
51
- else
52
- {
53
- $subject = "New submission on " . get_bloginfo('name') . " - " . $history->lead->lead_email;
54
- }
55
-
56
- $email_sent = wp_mail($to, $subject, $body, $headers);
57
-
58
- return $email_sent;
59
- }
60
-
61
- function build_body ( $li_contact )
62
- {
63
- $format = '<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"/><meta name="viewport" content="width=device-width"/></head><body style="width: 100%%;min-width: 100%%;-webkit-text-size-adjust: 100%%;-ms-text-size-adjust: 100%%;margin: 0;padding: 0;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;text-align: left;line-height: 19px;font-size: 14px;background-color: #f1f1f1;"><table class="body" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;height: 100%%;width: 100%%;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;background-color: #f1f1f1;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="center" align="center" valign="top" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: center;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><center style="width: 100%%;min-width: 580px;"><table class="container" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: inherit;width: 580px;margin: 0 auto;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;">%s%s%s%s</td></tr></table></center></td></tr></table></body></html>';
64
- $built_body = sprintf($format, $this->build_submission_details(get_bloginfo('url')), $this->build_contact_identity($li_contact->history->lead->lead_email), $this->build_sessions($li_contact->history), $this->build_footer($li_contact));
65
-
66
- return $built_body;
67
- }
68
-
69
- function build_submission_details ( $url ) {
70
- $format = '<table class="row submission-detail" style="border-spacing: 0;border-collapse: collapse;padding: 0px;vertical-align: top;text-align: left;width: 100%%;position: relative;display: block;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="wrapper last" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;padding-right: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="twelve columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 580px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><h3 style="color: #666;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;margin: 0;text-align: left;line-height: 1.3;word-break: normal;font-size: 18px;">New submission on <a href="%s" style="color: #2ba6cb;text-decoration: none;">%s</a></h3></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td></tr></table>';
71
- $built_submission_details = sprintf($format, $url, get_bloginfo('name'));
72
-
73
- return $built_submission_details;
74
- }
75
-
76
- function build_contact_identity ( $email ) {
77
- $avatar_img = "https://app.getsignals.com/avatar/image/?emails=" . $email;
78
-
79
- $format = '<table class="row lead-identity" style="border-spacing: 0;border-collapse: collapse;padding: 0px;vertical-align: top;text-align: left;width: 100%%;position: relative;display: block;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="wrapper" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="two columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 80px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><img height="60" width="60" src="%s" style="background-color:#F6601D;outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;width: auto;max-width: 100%%;float: left;clear: both;display: block;"/></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td><td class="wrapper last" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;padding-right: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="ten columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 480px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><h1 style="color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;margin: 0;text-align: left;line-height: 60px;word-break: normal;font-size: 26px;">%s</h1></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td></tr></table>';
80
- $built_identity = sprintf($format, $avatar_img, $email);
81
-
82
- return $built_identity;
83
- }
84
-
85
- function build_sessions ( $history ) {
86
- $built_sessions = "";
87
-
88
- $sessions = $history->sessions;
89
-
90
- foreach ( $sessions as &$session ) {
91
- $first_event = end($session['events']);
92
- $first_event_date = $first_event['activities'][0]['event_date'];
93
- $session_date = date('F j, Y, g:i a', strtotime($first_event_date));
94
-
95
- $last_event = array_values($session['events']);
96
- $last_event = $last_event[0];
97
- $last_activity = end($last_event['activities']);
98
- $session_end_time = date('g:i a', strtotime($last_activity['event_date']));
99
-
100
- $format = '<table class="row lead-timeline__date" style="border-spacing: 0;border-collapse: collapse;padding: 0px;vertical-align: top;text-align: left;width: 100%%;position: relative;display: block;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="wrapper last" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;padding-right: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="twelve columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 580px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><h4 style="color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: bold;padding: 0;margin: 0;text-align: left;line-height: 1.3;word-break: normal;font-size: 14px;">%s - %s</h4></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td></tr></table>';
101
- $built_sessions .= sprintf($format, $session_date, $session_end_time);
102
-
103
- $events = $session['events'];
104
-
105
- foreach ( $events as &$event ) {
106
- if ( $event['event_type'] == 'pageview' ) {
107
- $pageview = $event['activities'][0];
108
- $pageview_time = date('g:ia', strtotime($pageview['event_date']));
109
- $pageview_url = $pageview['pageview_url'];
110
- $pageview_title = $pageview['pageview_title'];
111
- $pageview_source = $pageview['pageview_source'];
112
-
113
- $format = '<table class="row lead-timeline__event pageview" style="border-spacing: 0;border-collapse: collapse;padding: 0px;vertical-align: top;text-align: left;width: 100%%;position: relative;display: block;background-color: #fff;border-top: 1px solid #dedede;border-right: 1px solid #dedede;border-left: 4px solid #28c;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="wrapper" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="two columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 80px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><p class="lead-timeline__event-time" style="margin: 0;color: #1f6696;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px;margin-bottom: 10px;">%s</p></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td><td class="wrapper last" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;padding-right: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="ten columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 480px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><p class="lead-timeline__event-title" style="margin: 0;color: #1f6696;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px;margin-bottom: 10px;">%s</p><p class="lead-timeline__pageview-url" style="margin: 0;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px;margin-bottom: 10px;"><a href="%s" style="color: #999;text-decoration: none;">%s</a></p></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td></tr></table>';
114
- $built_sessions .= sprintf($format, $pageview_time, $pageview_title, $pageview_url, $pageview_url);
115
-
116
- if ( $pageview['event_date'] == $first_event_date ) {
117
- $format = '<table class="row lead-timeline__event traffic-source" style="margin-bottom: 20px;border-spacing: 0;border-collapse: collapse;padding: 0px;vertical-align: top;text-align: left;width: 100%%;position: relative;display: block;background-color: #fff;border-top: 1px solid #dedede;border-right: 1px solid #dedede;border-left: 4px solid #99aa1f;border-bottom: 1px solid #dedede;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="wrapper" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="two columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 80px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><p class="lead-timeline__event-time" style="margin: 0;color: #727e14;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px;margin-bottom: 10px;">%s</p></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td><td class="wrapper last" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;padding-right: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="ten columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 480px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><p class="lead-timeline__event-title" style="margin: 0;color: #727e14;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px;margin-bottom: 10px;">Traffic Source: %s</p></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td></tr></table>';
118
- $built_sessions .= sprintf($format, $pageview_time, ( $pageview_source ? '<a href="' . $pageview_source . '">' . $pageview_source . '</a>' : 'Direct' ));
119
- }
120
- }
121
- else if ( $event['event_type'] == 'form' ) {
122
- $submission = $event['activities'][0];
123
- $submission_Time = date('g:ia', strtotime($submission['event_date']));
124
- $submission_url = $submission['form_page_url'];
125
- $submission_page_title = $submission['form_page_title'];
126
- $submission_form_fields = json_decode(stripslashes($submission['form_fields']));
127
-
128
- $format = '<table class="row lead-timeline__event submission" style="border-spacing: 0;border-collapse: collapse;padding: 0px;vertical-align: top;text-align: left;width: 100%%;position: relative;display: block;background-color: #fff;border-top: 1px solid #dedede;border-right: 1px solid #dedede;border-left: 4px solid #f6601d;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="wrapper" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="two columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 80px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><p class="lead-timeline__event-time" style="margin: 0;color: #b34a12;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px;margin-bottom: 10px;">%s</p></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td><td class="wrapper last" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;padding-right: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="ten columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 480px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><p class="lead-timeline__event-title" style="margin: 0;color: #b34a12;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px;margin-bottom: 10px;">Filled out form on page <a href="%s" style="color: #2ba6cb;text-decoration: none;">%s</a></p> %s </td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td></tr></table>';
129
- $built_sessions .= sprintf($format, $submission_Time, $submission_url, $submission_page_title, $this->build_form_fields($submission_form_fields));
130
- }
131
- }
132
- }
133
-
134
- return $built_sessions;
135
- }
136
-
137
- function build_form_fields ( $form_fields ) {
138
- $built_form_fields = "";
139
-
140
- foreach ( $form_fields as $field )
141
- {
142
- $format = '<p class="lead-timeline__submission-field" style="margin: 0;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px;margin-bottom: 10px;"><label class="lead-timeline__submission-label" style="text-transform: uppercase;font-size: 12px;color: #999;letter-spacing: 0.05em;">%s</label><br/>%s </p>';
143
- $built_form_fields .= sprintf($format, $field->label, $field->value);
144
- }
145
-
146
- return $built_form_fields;
147
- }
148
-
149
- function build_footer ( $li_contact ) {
150
- $built_footer = "";
151
- $button_text = "View Contact Record";
152
- $contactViewUrl = get_bloginfo('wpurl') . "/wp-admin/admin.php?page=leadin_contacts&action=view&lead=" . $li_contact->history->lead->lead_id;
153
-
154
- $format = '<table class="row footer" style="margin-bottom: 20px;border-spacing: 0;border-collapse: collapse;padding: 0px;vertical-align: top;text-align: left;width: 100%%;position: relative;display: block;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="wrapper last" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;padding-right: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="eight columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 380px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td align="center" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><center style="width: 100%%;min-width: 380px;"><table class="button medium-button radius" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;width: 100%%;overflow: hidden;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 12px 0 10px;vertical-align: top;text-align: center;color: #ffffff;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;display: block;width: auto;background: #2ba6cb;border: 1px solid #2284a1;-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;"><a href="%s" style="color: #ffffff;text-decoration: none;font-weight: bold;font-family: Helvetica, Arial, sans-serif;font-size: 20px;display: block;height: 100%%;width: 100%%;">%s</a></td></tr></table></center></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td></tr></table>';
155
- $built_footer .= sprintf($format, $contactViewUrl, $button_text);
156
-
157
- return $built_footer;
158
- }
159
-
160
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/class-emailer.php CHANGED
@@ -3,427 +3,160 @@
3
  // LI_Emailer Class
4
  //=============================================
5
  class LI_Emailer {
6
-
7
- /**
8
- * Class constructor
9
- */
10
- function __construct ()
11
- {
12
-
13
- }
14
-
15
- /**
16
- * Sends the leads history email
17
- *
18
- * @param string
19
- * @return bool $email_sent Whether the email contents were sent successfully. A true return value does not automatically mean that the user received the email successfully. It just only means that the method used was able to process the request without any errors.
20
- */
21
- function send_new_lead_email ( $hashkey )
22
- {
23
- $history = $this->get_lead_history($hashkey);
24
-
25
- $avatar_img = "https://app.getsignals.com/avatar/image/?emails=" . $history->lead->lead_email;
26
-
27
- // @EMAIL - Use this variable to concatenate your HTML
28
- $body = "";
29
-
30
- // Email Base open
31
- $body .= "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'><html xmlns='http://www.w3.org/1999/xhtml' xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html;charset=utf-8'/><meta name='viewport' content='width=device-width'/></head><body style='width: 100% !important;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;color: #222222;display: block;font-family: Helvetica, Arial, sans-serif;font-weight: normal;text-align: left;line-height: 19px;font-size: 14px;margin: 0;padding: 0;'><style type='text/css'>a:hover{color: #2795b6 !important;}a:active{color: #2795b6 !important;}a:visited{color: #2ba6cb !important;}h1 a:active{color: #2ba6cb !important;}h2 a:active{color: #2ba6cb !important;}h3 a:active{color: #2ba6cb !important;}h4 a:active{color: #2ba6cb !important;}h5 a:active{color: #2ba6cb !important;}h6 a:active{color: #2ba6cb !important;}h1 a:visited{color: #2ba6cb !important;}h2 a:visited{color: #2ba6cb !important;}h3 a:visited{color: #2ba6cb !important;}h4 a:visited{color: #2ba6cb !important;}h5 a:visited{color: #2ba6cb !important;}h6 a:visited{color: #2ba6cb !important;}.button:hover table td{background: #2795b6 !important;}.tiny-button:hover table td{background: #2795b6 !important;}.small-button:hover table td{background: #2795b6 !important;}.medium-button:hover table td{background: #2795b6 !important;}.large-button:hover table td{background: #2795b6 !important;}.button:hover{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.button:active{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.button:visited{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.tiny-button:hover{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.tiny-button:active{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.tiny-button:visited{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.small-button:hover{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.small-button:active{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.small-button:visited{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.medium-button:hover{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.medium-button:active{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.medium-button:visited{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.large-button:hover{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.large-button:active{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.large-button:visited{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.secondary:hover table td{background: #d0d0d0 !important;}.success:hover table td{background: #457a1a !important;}.alert:hover table td{background: #970b0e !important;}@media only screen and (max-width: 600px){table[class='body'] img{width: auto !important;height: auto !important;}table[class='body'] .container{width: 95% !important;}table[class='body'] .row{width: 100% !important;display: block !important;}table[class='body'] .wrapper{display: block !important;padding-right: 0 !important;}table[class='body'] .columns{table-layout: fixed !important;float: none !important;width: 100% !important;padding-right: 0px !important;padding-left: 0px !important;display: block !important;}table[class='body'] .column{table-layout: fixed !important;float: none !important;width: 100% !important;padding-right: 0px !important;padding-left: 0px !important;display: block !important;}table[class='body'] .wrapper.first .columns{display: table !important;}table[class='body'] .wrapper.first .column{display: table !important;}table[class='body'] table.columns td{width: 100%;}table[class='body'] table.column td{width: 100%;}table[class='body'] td.offset-by-one{padding-left: 0 !important;}table[class='body'] td.offset-by-two{padding-left: 0 !important;}table[class='body'] td.offset-by-three{padding-left: 0 !important;}table[class='body'] td.offset-by-four{padding-left: 0 !important;}table[class='body'] td.offset-by-five{padding-left: 0 !important;}table[class='body'] td.offset-by-six{padding-left: 0 !important;}table[class='body'] td.offset-by-seven{padding-left: 0 !important;}table[class='body'] td.offset-by-eight{padding-left: 0 !important;}table[class='body'] td.offset-by-nine{padding-left: 0 !important;}table[class='body'] td.offset-by-ten{padding-left: 0 !important;}table[class='body'] td.offset-by-eleven{padding-left: 0 !important;}table[class='body'] .expander{width: 9999px !important;}table[class='body'] .hide-for-small{display: none !important;}table[class='body'] .show-for-desktop{display: none !important;}table[class='body'] .show-for-small{display: inherit !important;}table[class='body'] .hide-for-desktop{display: inherit !important;}table[class='body'] .container.main{width: 100% !important;}}</style><table class='body' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;height: 100%;width: 100%;padding: 0;'><tr align='left' style='vertical-align: top; text-align: left; padding: 0;'><td class='center' align='center' valign='top' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: center;padding: 0 0 20px;'><center style='width: 100%;'>";
32
-
33
- // Email Header open
34
- $body .= "<table class='row header' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;position: relative;padding: 0px;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='center' align='center' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: center;padding: 0;' valign='top'><center style='width: 100%;'><table class='container' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: inherit;width: 580px;margin:0 auto 10px auto; padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='wrapper last' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;position: relative;padding: 10px 0px 0px;' align='left' valign='top'><table class='twelve columns' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 580px;margin: 0 auto;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='two sub-columns' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;width: 16.66667% !important;padding: 0px 3.44828% 10px 0px;' align='left' valign='top'><img width='77' height='77' src='" . $avatar_img . "' style='outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;width: auto;max-width: 100%;float: left;clear: both;display: block;' align='left'/></td><td class='ten sub-columns last' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: middle;text-align: left;width: 83.33333% !important;padding: 0px 0px 10px;' align='left' valign='middle'>";
35
-
36
- $body .= "<h1 class='lead-name' style='color: #222222; display: block; font-family: Helvetica, Arial, sans-serif; font-weight: bold; text-align: left; line-height: 1.3; word-break: normal; font-size: 20px; margin: 0; padding: 0;' align='left'>" . $history->lead->lead_email . "</h1>";
37
-
38
- // Email Header close
39
- $body .= "</td><td class='expander' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;visibility: hidden;width: 0px;padding: 0;' align='left' valign='top'></td></tr></table></td></tr></table></center></td></tr></table>";
40
-
41
- // Main container open
42
- $body .= "<table class='container main' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: inherit;width: 580px;margin: 0 auto;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;padding: 0;' align='left' valign='top'>";
43
-
44
- // Form Submission section open
45
- $body .= "<table class='row section form-submission' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;position: relative;display: block;background: #deedf8;padding: 0px;' bgcolor='#deedf8'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='wrapper last' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;position: relative;padding: 0 0px 0 0;' align='left' valign='top'>";
46
-
47
- // Form Submission section header
48
- $body .= $this->build_submission_header($history->submission, FALSE);
49
-
50
- // Form Submission Rows
51
- $fields = json_decode(stripslashes($history->submission->form_fields), true);
52
-
53
- foreach ( $fields as $field )
54
- {
55
- $body .= $this->build_submission_row($field);
56
- }
57
-
58
- // Form Submission Section Close
59
- $body .= "</td></tr></table>";
60
-
61
- // @EMAIL - end form section
62
-
63
- // History section title
64
- $body .= "<h2 class='section-title' style='color: #222222; display: block; font-family: Helvetica, Arial, sans-serif; font-weight: bold; text-align: left; line-height: 1.3; word-break: normal; font-size: 18px; margin: 0; padding: 30px 0px 0px 20px;' align='left'>Lead History</h2>";
65
-
66
- foreach ( array_reverse($history->pageviews_by_session) as $session )
67
- {
68
- // History section open
69
- $body .= "<table class='row section lead-history' style='border-spacing: 0; border-collapse: collapse; vertical-align: top; text-align: left; width: 100%; position: relative; display: block; background: #ffefe6; padding: 0px; margin-top: 20px;' bgcolor='#ffefe6'><tr style='vertical-align: top; text-align: left; padding: 0;' align='left'><td class='wrapper last' style='word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; text-align: left; position: relative; padding: 0 0px 0 0;' align='left' valign='top'>";
70
-
71
- $body .= $this->build_history_header($session);
72
-
73
- // History section rows
74
- foreach ( $session as $pageview )
75
- {
76
- $body .= $this->build_history_row($pageview);
77
- }
78
-
79
- // History section close
80
- $body .= '</td></tr></table>';
81
-
82
- // @EMAIL - end session
83
- }
84
- // @EMAIL - end visit history
85
-
86
- // Button row
87
- $body .= $this->build_button_row($history->lead->lead_id);
88
-
89
- // Main container close
90
- $body .= '</td></tr></table>';
91
-
92
- // Email Base close
93
- $body .= '</center></td></tr></table></body></html>';
94
-
95
- // Each line in an email can only be 998 characters long, so lines need to be broken with a wordwrap
96
- $body = wordwrap($body, 900, "\r\n");
97
-
98
- $from = $history->lead->lead_email;
99
- $headers = "From: LeadIn <team@leadin.com>\r\n";
100
- $headers.= "Reply-To: LeadIn <" . $from . ">\r\n";
101
- $headers.= "X-Mailer: PHP/" . phpversion() . "\r\n";
102
- $headers.= "MIME-Version: 1.0\r\n";
103
- $headers.= "Content-type: text/html; charset=utf-8\r\n";
104
-
105
- // Get email from plugin settings, if none set, use admin email
106
- $options = get_option('leadin_options');
107
- $to = ( $options['li_email'] ? $options['li_email'] : get_bloginfo('admin_email') ); // Get email from plugin settings, if none set, use admin email
108
-
109
- if ( $history->submission->form_type == "comment" )
110
- {
111
- $subject = "New comment posted on " . $history->submission->form_page_title;
112
- $subject .= " by " . $history->lead->lead_email;
113
- }
114
- else if ( $history->submission->form_type == "subscribe" )
115
- {
116
- $subject = "New subscriber from " . $history->submission->form_page_title;
117
- }
118
- else
119
- {
120
- if ( $history->new_contact )
121
- $subject = "New lead from " . get_bloginfo('name') . " - Say hello to " . $history->lead->lead_email;
122
- else
123
- $subject = "Lead from " . get_bloginfo('name') . " - Say hello again to " . $history->lead->lead_email;
124
- }
125
-
126
- $email_sent = wp_mail($to, $subject, $body, $headers);
127
- return $email_sent;
128
- }
129
-
130
- /**
131
- * Gets lead history from the database (pageviews, form submission, and lead details)
132
- *
133
- * @param string
134
- * @return object $history (pageviews_by_session, submission, lead)
135
- */
136
- function get_lead_history ( $hashkey )
137
- {
138
- global $wpdb;
139
-
140
- $q = $wpdb->prepare(
141
- "SELECT
142
- pageview_id,
143
- DATE_FORMAT(pageview_date, %s) AS pageview_day,
144
- DATE_FORMAT(pageview_date, %s) AS pageview_date,
145
- lead_hashkey, pageview_title, pageview_url, pageview_source, pageview_session_start
146
- FROM
147
- li_pageviews
148
- WHERE
149
- pageview_deleted = 0 AND
150
- lead_hashkey LIKE %s ORDER BY pageview_date ASC", '%b %e', '%b %e %l:%i%p', $hashkey);
151
-
152
- $pageviews = $wpdb->get_results($q);
153
-
154
- $pageviews_by_session = array();
155
- $cur_array = '0';
156
- $count = 0;
157
- foreach ( $pageviews as $pageview )
158
- {
159
- if ( $pageview->pageview_session_start )
160
- {
161
- $cur_array = $count;
162
- $pageviews_by_session['session_' . $cur_array] = array();
163
- }
164
-
165
- $pageviews_by_session['session_' . $cur_array][] = $pageview;
166
- $count++;
167
- }
168
-
169
- $q = $wpdb->prepare("SELECT form_date AS form_datetime, DATE_FORMAT(form_date, %s) AS form_date, form_page_title, form_page_url, form_fields, form_type FROM li_submissions WHERE lead_hashkey = '%s' AND form_deleted = 0 ORDER BY form_datetime DESC", '%b %e %l:%i%p', $hashkey);
170
- $submissions = $wpdb->get_results($q);
171
-
172
- $q = $wpdb->prepare("SELECT lead_id, lead_date, lead_ip, lead_source, lead_email, lead_status FROM li_leads WHERE hashkey LIKE %s AND lead_email != '' AND lead_deleted = 0", $hashkey);
173
- $lead = $wpdb->get_row($q);
174
-
175
- $history = (object)NULL;
176
- $history->pageviews_by_session = $pageviews_by_session;
177
- $history->submission = $submissions[0];
178
- $history->new_contact = ( count($submissions) == 1 ? true : false );
179
- $history->lead = $lead;
180
-
181
- return $history;
182
- }
183
-
184
- /**
185
- * Builds the blue form submission header for the lead email
186
- * @param object $submission
187
- * @return string
188
- */
189
- function build_submission_header ( $submission, $confirmation_email = FALSE )
190
- {
191
- // @EMAIL Use these variables to construct the heading for the form section
192
- $form_page_title = "<a href='" . $submission->form_page_url . "'>" . $submission->form_page_title . "</a>";
193
- $form_submission_day = date('M j' , strtotime($submission->form_date));
194
- $form_submission_time = date('g:i a', strtotime($submission->form_date));
195
- $form_submission_type = $submission->form_type;
196
-
197
- $submissionHeader = "";
198
-
199
- // Form Submission header open
200
- $submissionHeader .= "<table class='twelve columns' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 580px;margin: 0 auto;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='section-header' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;border-bottom-width: 1px;border-bottom-color: #c9e1f3;border-bottom-style: solid;background: #c9e1f3;padding: 15px 20px;' align='left' bgcolor='#c9e1f3' valign='top'>";
201
-
202
- // Form Submission header content
203
- $submissionHeader .= "<h3 style='color: #153d60;display: block;font-family: Helvetica, Arial, sans-serif;font-weight: bold;text-align: left;line-height: 1.3;word-break: normal;font-size: 16px;margin: 0;padding: 0;' align='left'>";
204
-
205
- if ( $form_submission_type == "comment" )
206
- {
207
- $submissionHeader .= "Commented on " . $form_page_title . " on " . $form_submission_day . ' at ' . $form_submission_time;
208
- }
209
- else
210
- {
211
- $submissionHeader .= ( $confirmation_email ? "You filled out the subscription form on " : "Filled out a form on " ) . $form_page_title . " on " . $form_submission_day . ' at ' . $form_submission_time;
212
- }
213
-
214
- $submissionHeader .= "</h3>";
215
-
216
- // Form Submission header close
217
- $submissionHeader .= "</td><td class='expander' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;visibility: hidden;width: 0px;border-bottom-color: #c9e1f3;border-bottom-style: solid;padding: 0;border-width: 0 0 1px;' align='left' valign='top'></td></tr></table>";
218
-
219
- return $submissionHeader;
220
- }
221
-
222
- /**
223
- * Builds a row containing a form field in the submission section for the lead email
224
- * @param object $field
225
- * @return string
226
- */
227
- function build_submission_row ( $field )
228
- {
229
- $submissionRow = "\r\n";
230
-
231
- // Form Submission Row open
232
- $submissionRow .= "<table class='twelve columns' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 580px;margin: 0 auto;padding: 0;'><tr align='left' style='vertical-align: top; text-align: left; padding: 0;'><td align='left' valign='top' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;border-bottom-width: 1px;border-bottom-color: #c9e1f3;border-bottom-style: solid;padding: 10px 20px;'>";
233
-
234
- // Form Submission Label
235
- $submissionRow .= "<p class='form-field-label' style='color: #222222; display: block; font-family: Helvetica, Arial, sans-serif; font-weight: bold; text-align: left; line-height: 19px; font-size: 12px; margin: 0; padding: 0;' align='left'>" . $field['label'] . "</p>";
236
-
237
- // Form Submission Value
238
- $submissionRow .= "<p class='form-field' style='color: #222222; display: block; font-family: Helvetica, Arial, sans-serif; font-weight: normal; text-align: left; line-height: 19px; font-size: 14px; margin: 0; padding: 3px 0 0;' align='left'>" . ( $field['value'] ? $field['value'] : 'not provided' ) . "</p>";
239
-
240
- // Form Submission Row close
241
- $submissionRow .= "<td class='expander' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;visibility: hidden;width: 0px;border-bottom-color: #c9e1f3;border-bottom-style: solid;padding: 0;border-width: 0 0 1px;' align='left' valign='top'></td></tr></table>";
242
-
243
- return $submissionRow;
244
- }
245
-
246
- /**
247
- * Builds the orange session heading for the lead email
248
- * @param object $session
249
- * @return string
250
- */
251
- function build_history_header ( $session )
252
- {
253
- // @EMAIL - Use these variables to construct the heading for a specfic session
254
- $session_header = $session[0]->pageview_day;
255
- $session_start_time = str_replace(array('PM', 'AM'), array('pm', 'am'), str_replace($session[0]->pageview_day . " ", "", $session[0]->pageview_date));
256
- $session_end_time = str_replace(array('PM', 'AM'), array('pm', 'am'), str_replace($session[0]->pageview_day . " ", "", $session[count($session)-1]->pageview_date));
257
- $session_num_pages = ( count($session) != 1 ? count($session) . ' pages' : '1 page' ); // Fix plural on page/pages
258
- $session_time_string = $session_start_time;
259
- $session_source = $session[0]->pageview_source;
260
-
261
- // Append the end time if it doesn't match the start time
262
- if ( $session_start_time != $session_end_time )
263
- {
264
- $session_time_string .= " - " . $session_end_time;
265
- }
266
-
267
- $historyHeader = "\r\n";
268
-
269
- // History section header open
270
- $historyHeader .= "<table class='twelve columns' style='border-spacing: 0; border-collapse: collapse; vertical-align: top; text-align: left; width: 580px; margin: 0 auto; padding: 0;'><tr style='vertical-align: top; text-align: left; padding: 0;' align='left'><td class='section-header' style='word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; text-align: left; border-bottom-width: 1px; border-bottom-style: solid; background: #fdd8c0; border-bottom-color: #fdd8c0; padding: 15px 20px;' align='left' bgcolor='#fdd8c0' valign='top'>";
271
-
272
- // History section header content
273
- $historyHeader .= "<h3 style='color: #a43700; display: block; font-family: Helvetica, Arial, sans-serif; font-weight: bold; text-align: left; line-height: 1.3; word-break: normal; font-size: 16px; margin: 0; padding: 0;' align='left'>Viewed " . $session_num_pages . " - " . $session_header . " " . $session_time_string . "</h3>";
274
-
275
- // History section header close
276
- $historyHeader .= "</td><td class='expander' style='word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; text-align: left; visibility: hidden; width: 0px; padding:0;' align='left' valign='top'></td></tr></table>";
277
-
278
- // Source section open
279
- $historyHeader .= "<table class='twelve columns' style='border-spacing: 0; border-collapse: collapse; vertical-align: top; text-align: left; width: 580px; margin: 0 auto; padding: 0;'><tr style='vertical-align: top; text-align: left; padding: 0;' align='left'><td style='word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; text-align: left; border-bottom-width: 1px; border-bottom-color: #fdd8c0; border-bottom-style: solid; padding: 10px 20px;' align='left' valign='top'>";
280
-
281
- // Source section content
282
- // If source isn't set, set it to direct
283
- if ( $session_source )
284
- {
285
- $session_source_text = "<a href='" . $session_source . "' style='color: #2ba6cb; text-decoration: none !important;'>" . $session_source . "</a>";
286
- }
287
- else
288
- {
289
- $session_source_text = "Direct";
290
-
291
- }
292
-
293
- $historyHeader .= "<p class='form-field' style='color: #222222; display: block; font-family: Helvetica, Arial, sans-serif; font-weight: normal; text-align: left; line-height: 19px; font-size: 14px; margin: 0; padding: 3px 0 0;' align='left'><span class='traffic-source' style='font-weight: bold; color: #a43700;'>Traffic Source: </span>" . $session_source_text . "</p>";
294
-
295
- // Source section close
296
- $historyHeader .= "</td><td class='expander' style='word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; text-align: left; visibility: hidden; width: 0px; border-bottom-color: #fdd8c0; border-bottom-style: solid; padding: 0; border: 0;' align='left' valign='top'></td></tr></table>";
297
-
298
- return $historyHeader;
299
- }
300
-
301
- /**
302
- * Builds a row containing a page view for the lead email
303
- * @param object $pageview
304
- * @return string
305
- */
306
- function build_history_row ( $pageview )
307
- {
308
- $historyRow = "\r\n";
309
-
310
- $historyRow .= "<table class='twelve columns' style='border-spacing: 0; border-collapse: collapse; vertical-align: top;text-align: left; width: 580px; margin: 0 auto; padding: 0;'>";
311
- $historyRow .= "<tr style='vertical-align: top;text-align: left;padding: 0;' align='left'>";
312
- $historyRow .= "<td align='left' valign='top' style='border-bottom-color: #fdd8c0; word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; text-align: left; border-bottom-width: 1px; border-bottom-style: solid; padding: 10px 20px;'>";
313
- $historyRow .= "<a href='" . $pageview->pageview_url . "'>" . ( str_replace('&nbsp;)','', trim($pageview->pageview_title)) ? $pageview->pageview_title : '(blank page title tag)' ) . "</a>";
314
- $historyRow .= "</td>";
315
- $historyRow .= "<td class='expander' style='word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; text-align: left; visibility: hidden; width: 0px; padding:0;' align='left' valign='top'></td>";
316
- $historyRow .= "</tr>";
317
- $historyRow .= "</table>";
318
-
319
- return $historyRow;
320
- }
321
-
322
- /**
323
- * Builds the View All Contacts button for the lead email
324
- * @return string
325
- */
326
- function build_button_row ( $lead_id )
327
- {
328
- $buttonRow = "\r\n";
329
- $contactViewUrl = get_bloginfo('wpurl') . "/wp-admin/admin.php?page=leadin_contacts&action=view&lead=" . $lead_id;
330
-
331
- $buttonRow .= "<table class='row section' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;position: relative;display: block;margin-top: 20px;padding: 0px;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='wrapper last' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;position: relative;padding: 0 0px 0 0;' align='left' valign='top'><table class='twelve columns' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 580px;margin: 0 auto;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;padding: 10px 20px;' align='left' valign='top'><table class='button round' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;overflow: hidden;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: center;display: block;width: auto !important;font-weight: bold;text-decoration: none;font-family: Helvetica, Arial, sans-serif;color: white;font-size: 16px;-webkit-border-radius: 500px;-moz-border-radius: 500px;border-radius: 500px;background: #f88e4b;padding: 10px 20px;border: 1px solid #f6601d;' align='center' bgcolor='#f88e4b' valign='top'>";
332
- $buttonRow .="<a href='" . $contactViewUrl . "' style='color: white !important; text-decoration: none !important; font-family: Helvetica, Arial, sans-serif;'>View Contact History</a>";
333
- $buttonRow .= "</td></tr></table></td><td class='expander' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;visibility: hidden;width: 0px;padding: 0;border: 0;' align='left' valign='top'></td></tr></table></td></tr></table>";
334
-
335
- return $buttonRow;
336
- }
337
-
338
- /**
339
- * Sends the subscription confirmation email
340
- *
341
- * @param object history from get_lead_history()
342
- * @return bool $email_sent Whether the email contents were sent successfully. A true return value does not automatically mean that the user received the email successfully. It just only means that the method used was able to process the request without any errors.
343
- */
344
- function send_subscriber_confirmation_email ( $history )
345
- {
346
- // Get email from plugin settings, if none set, use admin email
347
- $options = get_option('leadin_options');
348
- $leadin_email = ( $options['li_email'] ? $options['li_email'] : get_bloginfo('admin_email') ); // Get email from plugin settings, if none set, use admin email
349
- $site_name = get_bloginfo('name');
350
- $site_url = get_bloginfo('wpurl');
351
-
352
- // @EMAIL - Use this variable to concatenate your HTML
353
- $body = "";
354
-
355
- // Email Base open
356
- $body .= "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'><html xmlns='http://www.w3.org/1999/xhtml' xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html;charset=utf-8'/><meta name='viewport' content='width=device-width'/></head><body style='width: 100% !important;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;color: #222222;display: block;font-family: Helvetica, Arial, sans-serif;font-weight: normal;text-align: left;line-height: 19px;font-size: 14px;margin: 0;padding: 0;'><style type='text/css'>a:hover{color: #2795b6 !important;}a:active{color: #2795b6 !important;}a:visited{color: #2ba6cb !important;}h1 a:active{color: #2ba6cb !important;}h2 a:active{color: #2ba6cb !important;}h3 a:active{color: #2ba6cb !important;}h4 a:active{color: #2ba6cb !important;}h5 a:active{color: #2ba6cb !important;}h6 a:active{color: #2ba6cb !important;}h1 a:visited{color: #2ba6cb !important;}h2 a:visited{color: #2ba6cb !important;}h3 a:visited{color: #2ba6cb !important;}h4 a:visited{color: #2ba6cb !important;}h5 a:visited{color: #2ba6cb !important;}h6 a:visited{color: #2ba6cb !important;}.button:hover table td{background: #2795b6 !important;}.tiny-button:hover table td{background: #2795b6 !important;}.small-button:hover table td{background: #2795b6 !important;}.medium-button:hover table td{background: #2795b6 !important;}.large-button:hover table td{background: #2795b6 !important;}.button:hover{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.button:active{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.button:visited{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.tiny-button:hover{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.tiny-button:active{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.tiny-button:visited{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.small-button:hover{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.small-button:active{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.small-button:visited{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.medium-button:hover{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.medium-button:active{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.medium-button:visited{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.large-button:hover{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.large-button:active{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.large-button:visited{color: white !important;font-family: Helvetica, Arial, sans-serif;text-decoration: none;}.secondary:hover table td{background: #d0d0d0 !important;}.success:hover table td{background: #457a1a !important;}.alert:hover table td{background: #970b0e !important;}@media only screen and (max-width: 600px){table[class='body'] img{width: auto !important;height: auto !important;}table[class='body'] .container{width: 95% !important;}table[class='body'] .row{width: 100% !important;display: block !important;}table[class='body'] .wrapper{display: block !important;padding-right: 0 !important;}table[class='body'] .columns{table-layout: fixed !important;float: none !important;width: 100% !important;padding-right: 0px !important;padding-left: 0px !important;display: block !important;}table[class='body'] .column{table-layout: fixed !important;float: none !important;width: 100% !important;padding-right: 0px !important;padding-left: 0px !important;display: block !important;}table[class='body'] .wrapper.first .columns{display: table !important;}table[class='body'] .wrapper.first .column{display: table !important;}table[class='body'] table.columns td{width: 100%;}table[class='body'] table.column td{width: 100%;}table[class='body'] td.offset-by-one{padding-left: 0 !important;}table[class='body'] td.offset-by-two{padding-left: 0 !important;}table[class='body'] td.offset-by-three{padding-left: 0 !important;}table[class='body'] td.offset-by-four{padding-left: 0 !important;}table[class='body'] td.offset-by-five{padding-left: 0 !important;}table[class='body'] td.offset-by-six{padding-left: 0 !important;}table[class='body'] td.offset-by-seven{padding-left: 0 !important;}table[class='body'] td.offset-by-eight{padding-left: 0 !important;}table[class='body'] td.offset-by-nine{padding-left: 0 !important;}table[class='body'] td.offset-by-ten{padding-left: 0 !important;}table[class='body'] td.offset-by-eleven{padding-left: 0 !important;}table[class='body'] .expander{width: 9999px !important;}table[class='body'] .hide-for-small{display: none !important;}table[class='body'] .show-for-desktop{display: none !important;}table[class='body'] .show-for-small{display: inherit !important;}table[class='body'] .hide-for-desktop{display: inherit !important;}table[class='body'] .container.main{width: 100% !important;}}</style><table class='body' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;height: 100%;width: 100%;padding: 0;'><tr align='left' style='vertical-align: top; text-align: left; padding: 0;'><td class='center' align='center' valign='top' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: center;padding: 0 0 20px;'><center style='width: 100%;'>";
357
-
358
- // Email Header open
359
- $body .= "<table class='row header' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;position: relative;padding: 0px;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='center' align='center' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: center;padding: 0;' valign='top'><center style='width: 100%;'><table class='container' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: inherit;width: 580px;margin:0 auto 10px auto; padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='wrapper last' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;position: relative;padding: 10px 0px 0px;' align='left' valign='top'><table class='twelve columns' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 580px;margin: 0 auto;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='two sub-columns' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;width: 100% !important;padding: 0px 0px 10px 0px;' align='left' valign='top'>";
360
-
361
- $body .= "<h1 class='lead-name' style='color: #222222; display: block; font-family: Helvetica, Arial, sans-serif; font-weight: bold; text-align: left; line-height: 1.3; word-break: normal; font-size: 20px; margin: 0; padding: 0;' align='left'>" . $site_name . "</h1>";
362
-
363
- // Email Header close
364
- $body .= "</td><td class='expander' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;visibility: hidden;width: 0px;padding: 0;' align='left' valign='top'></td></tr></table></td></tr></table></center></td></tr></table>";
365
-
366
- $body .= "<table class='row header' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;position: relative;padding: 0px;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='center' align='center' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: center;padding: 0;' valign='top'><center style='width: 100%;'><table class='container' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: inherit;width: 580px;margin:0 auto 10px auto; padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='wrapper last' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;position: relative;padding: 10px 0px 0px;' align='left' valign='top'><table class='twelve columns' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 580px;margin: 0 auto;padding: 0;'>";
367
-
368
- $body .= "<tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td>";
369
- $body .= "<td style='padding: 0px 0px 10px 0px;'>Your subscription to <i><a href='" . $site_url . "'>" . $site_name . "</a></i> has been confirmed.</td>";
370
- $body .= "</tr>";
371
-
372
- $body .= "<tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td>";
373
- $body .= "<td style='padding: 10px 0px 20px 0px;'>Just so you have it, here is a copy of the information you submitted to us...</td>";
374
- $body .= "</tr>";
375
-
376
- $body .= "</table>";
377
-
378
- // Main container open
379
- $body .= "<table class='container main' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: inherit;width: 580px;margin: 0 auto;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;padding: 0;' align='left' valign='top'>";
380
-
381
- // Form Submission section open
382
- $body .= "<table class='row section form-submission' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;position: relative;display: block;background: #deedf8;padding: 0px;' bgcolor='#deedf8'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='wrapper last' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;position: relative;padding: 0 0px 0 0;' align='left' valign='top'>";
383
-
384
- // Form Submission section header
385
- $body .= $this->build_submission_header($history->submission, TRUE);
386
-
387
- // Form Submission Rows
388
- $fields = json_decode(stripslashes($history->submission->form_fields), true);
389
-
390
- foreach ( $fields as $field )
391
- {
392
- $body .= $this->build_submission_row($field);
393
- }
394
-
395
- // Form Submission Section Close
396
- $body .= "</td></tr></table>";
397
-
398
- // Build [you may contact us at:] row
399
- $body .= "<table class='row section' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;position: relative;display: block;margin-top: 20px;padding: 0px;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='wrapper last' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;position: relative;padding: 0 0px 0 0;' align='left' valign='top'><table class='twelve columns' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 580px;margin: 0 auto;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;padding: 0px;' align='left' valign='top'><table class='button round' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;overflow: hidden;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td>";
400
- $body .="You may also contact us at:<br/><a href='mailto:" . $leadin_email . "'>" . $leadin_email . "</a>";
401
- $body .= "</td></tr></table></td><td class='expander' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;visibility: hidden;width: 0px;padding: 0;border: 0;' align='left' valign='top'></td></tr></table></td></tr></table>";
402
-
403
- // Build Powered by LeadIn row
404
- $body .= "<table class='row section' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;position: relative;display: block;margin-top: 20px;padding: 0px;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='wrapper last' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;position: relative;padding: 0 0px 0 0;' align='left' valign='top'><table class='twelve columns' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 580px;margin: 0 auto;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td style='padding: 10px 20px;' align='left' valign='top'><table style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;overflow: hidden;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: center;display: block;width: auto !important;font-size: 16px;padding: 10px 20px;' align='center' valign='top'>";
405
- $body .="<div style='font-size: 11px; color: #888; padding: 0 0 5px 0;'>Powered by</div><a href='http://leadin.com/wordpress-subscribe-widget/?utm_campaign=subscribe_widget&utm_medium=email&utm_source=" . $site_url . "'><img alt='LeadIn' height='20px' width='99px' src='http://leadin.com/wp-content/themes/LeadIn-WP-Theme/library/images/logos/leadin_logo_small_grey.png' alt='leadin.com'/></a>";
406
- $body .= "</td></tr></table></td><td class='expander' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;visibility: hidden;width: 0px;padding: 0;border: 0;' align='left' valign='top'></td></tr></table></td></tr></table>";
407
-
408
- // @EMAIL - end form section
409
-
410
- // Email Base close
411
- $body .= '</center></td></tr></table></body></html>';
412
- $from = apply_filters( 'li_subscribe_from', $leadin_email );
413
-
414
- // Each line in an email can only be 998 characters long, so lines need to be broken with a wordwrap
415
- $body = wordwrap($body, 900, "\r\n");
416
-
417
- $headers = "From: LeadIn <team@leadin.com>\r\n";
418
- $headers.= "Reply-To: LeadIn <" . $from . ">\r\n";
419
- $headers.= "X-Mailer: PHP/" . phpversion() . "\r\n";
420
- $headers.= "MIME-Version: 1.0\r\n";
421
- $headers.= "Content-type: text/html; charset=utf-8\r\n";
422
-
423
- $subject = $site_name . ': Subscription Confirmed';
424
-
425
- $email_sent = wp_mail($history->lead->lead_email, $subject, $body, $headers);
426
- return $email_sent;
427
- }
428
- }
429
- ?>
3
  // LI_Emailer Class
4
  //=============================================
5
  class LI_Emailer {
6
+
7
+ /**
8
+ * Class constructor
9
+ */
10
+ function __construct ()
11
+ {
12
+
13
+ }
14
+
15
+ /**
16
+ * Sends the leads history email
17
+ *
18
+ * @param string
19
+ * @return bool $email_sent Whether the email contents were sent successfully. A true return value does not automatically mean that the user received the email successfully. It just only means that the method used was able to process the request without any errors.
20
+ */
21
+ function send_new_lead_email ( $hashkey )
22
+ {
23
+ $li_contact = new LI_Contact();
24
+ $li_contact->hashkey = $hashkey;
25
+ $li_contact->get_contact_history();
26
+ $history = $li_contact->history;
27
+
28
+ $body = "";
29
+
30
+ $body = $this->build_body($li_contact);
31
+
32
+ // Each line in an email can only be 998 characters long, so lines need to be broken with a wordwrap
33
+ $body = wordwrap($body, 900, "\r\n");
34
+
35
+ $from = $history->lead->lead_email;
36
+ $headers = "From: LeadIn <team@leadin.com>\r\n";
37
+ $headers.= "Reply-To: LeadIn <" . $from . ">\r\n";
38
+ $headers.= "X-Mailer: PHP/" . phpversion() . "\r\n";
39
+ $headers.= "MIME-Version: 1.0\r\n";
40
+ $headers.= "Content-type: text/html; charset=utf-8\r\n";
41
+
42
+ // Get email from plugin settings, if none set, use admin email
43
+ $options = get_option('leadin_options');
44
+ $to = ( $options['li_email'] ? $options['li_email'] : get_bloginfo('admin_email') ); // Get email from plugin settings, if none set, use admin email
45
+
46
+ if ( $history->lead->last_submission_type == "comment" ) {
47
+ $subject = "Comment posted on " . $history->submission->form_page_title;
48
+ $subject .= " by " . $history->lead->lead_email;
49
+ }
50
+ elseif ( $history->lead->last_submission_type == "subscribe" ) {
51
+ $subject = "LeadIn Subscribe submission on " . $history->submission->form_page_title;
52
+ $subject .= " by " . $history->lead->lead_email;
53
+ }
54
+ else {
55
+ $subject = "Form submission on " . get_bloginfo('name') . " - " . $history->lead->lead_email;
56
+ }
57
+
58
+ $email_sent = wp_mail($to, $subject, $body, $headers);
59
+
60
+ return $email_sent;
61
+ }
62
+
63
+ function build_body ( $li_contact )
64
+ {
65
+ $format = '<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"/><meta name="viewport" content="width=device-width"/></head><body style="width: 100%%;min-width: 100%%;-webkit-text-size-adjust: 100%%;-ms-text-size-adjust: 100%%;margin: 0;padding: 0;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;text-align: left;line-height: 19px;font-size: 14px;background-color: #f1f1f1;"><table class="body" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;height: 100%%;width: 100%%;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;background-color: #f1f1f1;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="center" align="center" valign="top" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: center;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><center style="width: 100%%;min-width: 580px;"><table class="container" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: inherit;width: 580px;margin: 0 auto;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;">%s%s%s%s</td></tr></table></center></td></tr></table></body></html>';
66
+ $built_body = sprintf($format, $this->build_submission_details(get_bloginfo('url')), $this->build_contact_identity($li_contact->history->lead->lead_email), $this->build_sessions($li_contact->history), $this->build_footer($li_contact));
67
+
68
+ return $built_body;
69
+ }
70
+
71
+ function build_submission_details ( $url ) {
72
+ $format = '<table class="row submission-detail" style="border-spacing: 0;border-collapse: collapse;padding: 0px;vertical-align: top;text-align: left;width: 100%%;position: relative;display: block;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="wrapper last" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;padding-right: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="twelve columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 580px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><h3 style="color: #666;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;margin: 0;text-align: left;line-height: 1.3;word-break: normal;font-size: 18px;">New submission on <a href="%s" style="color: #2ba6cb;text-decoration: none;">%s</a></h3></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td></tr></table>';
73
+ $built_submission_details = sprintf($format, $url, get_bloginfo('name'));
74
+
75
+ return $built_submission_details;
76
+ }
77
+
78
+ function build_contact_identity ( $email ) {
79
+ $avatar_img = "https://app.getsignals.com/avatar/image/?emails=" . $email;
80
+
81
+ $format = '<table class="row lead-identity" style="border-spacing: 0;border-collapse: collapse;padding: 0px;vertical-align: top;text-align: left;width: 100%%;position: relative;display: block;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="wrapper" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="two columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 80px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><img height="60" width="60" src="%s" style="background-color:#F6601D;outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;width: auto;max-width: 100%%;float: left;clear: both;display: block;"/></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td><td class="wrapper last" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;padding-right: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="ten columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 480px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><h1 style="color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;margin: 0;text-align: left;line-height: 60px;word-break: normal;font-size: 26px;">%s</h1></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens