Popup Maker – Popup Forms, Optins & More - Version 1.6.5

Version Description

Download this release

Release Info

Developer danieliser
Plugin Icon 128x128 Popup Maker – Popup Forms, Optins & More
Version 1.6.5
Comparing to
See all releases

Code changes from version 1.6.4 to 1.6.5

Beginnings_of_work_on_WP_Multisite_support_in_the_upgrade_manager_.patch DELETED
@@ -1,1542 +0,0 @@
1
- Index: wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine-6.php
2
- IDEA additional info:
3
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
4
- <+>UTF-8
5
- ===================================================================
6
- --- wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine-6.php (date 1460354639000)
7
- +++ wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine-6.php (revision )
8
- @@ -56,9 +56,8 @@
9
- @set_time_limit( 0 );
10
- }
11
-
12
- - $upgrades = PUM_Admin_Upgrades::instance();
13
- - $completed = $upgrades->get_arg( 'completed' );
14
- - $total = $upgrades->get_arg( 'total' );
15
- + $completed = static::$upgrades->get_arg( 'completed' );
16
- + $total = static::$upgrades->get_arg( 'total' );
17
-
18
- // Install new themes
19
- pum_install_built_in_themes();
20
- @@ -73,12 +72,12 @@
21
- foreach ( $popups as $status ) {
22
- $total += $status;
23
- }
24
- - $upgrades->set_arg( 'total', $total );
25
- + static::$upgrades->set_arg( 'total', $total );
26
- }
27
-
28
- $popups = new PUM_Popup_Query( array(
29
- - 'number' => $upgrades->get_arg( 'number' ),
30
- - 'page' => $upgrades->get_arg( 'step' ),
31
- + 'number' => static::$upgrades->get_arg( 'number' ),
32
- + 'page' => static::$upgrades->get_arg( 'step' ),
33
- 'status' => array( 'any', 'trash', 'auto-draft' ),
34
- 'order' => 'ASC',
35
- ) );
36
- @@ -108,7 +107,7 @@
37
- }
38
-
39
- if ( $completed < $total ) {
40
- - $upgrades->set_arg( 'completed', $completed );
41
- + static::$upgrades->set_arg( 'completed', $completed );
42
- static::next_step();
43
- }
44
-
45
- Index: wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine-5.php
46
- IDEA additional info:
47
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
48
- <+>UTF-8
49
- ===================================================================
50
- --- wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine-5.php (date 1460354639000)
51
- +++ wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine-5.php (revision )
52
- @@ -44,9 +44,8 @@
53
- @set_time_limit( 0 );
54
- }
55
-
56
- - $upgrades = PUM_Admin_Upgrades::instance();
57
- - $completed = $upgrades->get_arg( 'completed' );
58
- - $total = $upgrades->get_arg( 'total' );
59
- + $completed = static::$upgrades->get_arg( 'completed' );
60
- + $total = static::$upgrades->get_arg( 'total' );
61
-
62
- // Set the correct total.
63
- if ( $total <= 1 ) {
64
- @@ -55,12 +54,12 @@
65
- foreach ( $popups as $status ) {
66
- $total += $status;
67
- }
68
- - $upgrades->set_arg( 'total', $total );
69
- + static::$upgrades->set_arg( 'total', $total );
70
- }
71
-
72
- $popups = new PUM_Popup_Query( array(
73
- - 'number' => $upgrades->get_arg( 'number' ),
74
- - 'page' => $upgrades->get_arg( 'step' ),
75
- + 'number' => static::$upgrades->get_arg( 'number' ),
76
- + 'page' => static::$upgrades->get_arg( 'step' ),
77
- 'status' => array( 'any', 'trash', 'auto-draft' ),
78
- 'order' => 'ASC',
79
- ) );
80
- @@ -79,7 +78,7 @@
81
- }
82
-
83
- if ( $completed < $total ) {
84
- - $upgrades->set_arg( 'completed', $completed );
85
- + static::$upgrades->set_arg( 'completed', $completed );
86
- static::next_step();
87
- }
88
-
89
- Index: wp-content/plugins/popup-maker/includes/admin/class-pum-admin-upgrades.php
90
- IDEA additional info:
91
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
92
- <+>UTF-8
93
- ===================================================================
94
- --- wp-content/plugins/popup-maker/includes/admin/class-pum-admin-upgrades.php (date 1460354639000)
95
- +++ wp-content/plugins/popup-maker/includes/admin/class-pum-admin-upgrades.php (revision )
96
- @@ -12,7 +12,7 @@
97
-
98
- // Exit if accessed directly
99
- if ( ! defined( 'ABSPATH' ) ) {
100
- - exit;
101
- + exit;
102
- }
103
-
104
- /**
105
- @@ -20,643 +20,731 @@
106
- */
107
- class PUM_Admin_Upgrades {
108
-
109
- - /**
110
- - * @var PUM_Admin_Upgrades The one true PUM_Admin_Upgrades
111
- - */
112
- - private static $instance;
113
- + /**
114
- + * @var PUM_Admin_Upgrades The one true PUM_Admin_Upgrades
115
- + */
116
- + private static $instance;
117
-
118
- - /**
119
- - * @var $upgrade_args
120
- - */
121
- - public $upgrade_args = array();
122
- + /**
123
- + * @var $upgrade_args
124
- + */
125
- + public $upgrade_args = array();
126
-
127
- - public $page = null;
128
- + public $page = null;
129
-
130
- - public $doing_upgrades = false;
131
- + public $doing_upgrades = false;
132
-
133
- - public $current_routine = null;
134
- + public $current_routine = null;
135
-
136
- - public $next_routine = null;
137
- + public $next_routine = null;
138
-
139
- - /**
140
- - * Initialize the actions needed to process upgrades.
141
- - */
142
- - public static function instance() {
143
- - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof PUM_Admin_Upgrades ) ) {
144
- - self::$instance = new PUM_Admin_Upgrades;
145
- - self::$instance->init();
146
- - }
147
- + /**
148
- + * Initialize the actions needed to process upgrades.
149
- + */
150
- + public static function instance() {
151
- + if ( ! isset( self::$instance ) && ! ( self::$instance instanceof PUM_Admin_Upgrades ) ) {
152
- + self::$instance = new PUM_Admin_Upgrades;
153
- + self::$instance->init();
154
- + }
155
-
156
- - return self::$instance;
157
- - }
158
- + return self::$instance;
159
- + }
160
-
161
- + public function is_network() {
162
- + return function_exists( 'is_multisite' ) && is_multisite();
163
- + }
164
- +
165
- + public function is_network_admin() {
166
- + return $this->is_network() && is_network_admin();
167
- + }
168
- +
169
- + public function required_cap() {
170
- + return $this->is_network_admin() ? 'manage_network_plugins' : 'manage_options';
171
- + }
172
- +
173
- + public function is_network_ajax() {
174
- + return $this->is_network() && isset( $_REQUEST['hash'] ) && $_REQUEST['hash'] == wp_hash( 'pum-network-admin' );
175
- + }
176
- +
177
- + public function is_network_admin_request() {
178
- + return $this->is_network_admin() || $this->is_network_ajax();
179
- + }
180
- +
181
- - /**
182
- - * Initialize the actions needed to process upgrades.
183
- - */
184
- - public function init() {
185
- + /**
186
- + * Initialize the actions needed to process upgrades.
187
- + */
188
- + public function init() {
189
-
190
- - $this->update_plugin_version();
191
- + $this->update_plugin_version();
192
-
193
- - // bail if this plugin data doesn't need updating
194
- + // bail if this plugin data doesn't need updating
195
- - if ( pum_get_db_ver() >= PUM::DB_VER ) {
196
- + if ( ! $this->is_network_admin() && pum_get_db_ver() >= PUM::DB_VER ) {
197
- - return;
198
- - }
199
- + return;
200
- + }
201
-
202
- - add_action( 'admin_menu', array( $this, 'register_pages' ) );
203
- - add_action( 'network_admin_menu', array( $this, 'register_pages' ) );
204
- + add_action( 'admin_menu', array( $this, 'register_pages' ) );
205
- + add_action( 'network_admin_menu', array( $this, 'register_pages' ) );
206
-
207
- - add_action( 'admin_init', array( $this, 'process_upgrade_args' ) );
208
- + add_action( 'admin_notices', array( $this, 'show_upgrade_notices' ) );
209
- + add_action( 'network_admin_notices', array( $this, 'show_upgrade_notices' ) );
210
-
211
- + add_action( 'admin_init', array( $this, 'process_upgrade_args' ) );
212
- - add_action( 'wp_ajax_pum_trigger_upgrades', array( $this, 'trigger_upgrades' ) );
213
- + add_action( 'wp_ajax_pum_trigger_upgrades', array( $this, 'trigger_upgrades' ) );
214
- - add_action( 'admin_notices', array( $this, 'show_upgrade_notices' ) );
215
- - }
216
- + }
217
-
218
- - public function update_plugin_version() {
219
- + public function update_plugin_version() {
220
-
221
- - $current_ver = get_option( 'pum_ver', false );
222
- + $current_ver = get_site_option( 'pum_ver', false );
223
-
224
- - if ( ! $current_ver ) {
225
- + if ( ! $current_ver ) {
226
-
227
- - $deprecated_ver = get_site_option( 'popmake_version', false );
228
- + $deprecated_ver = get_site_option( 'popmake_version', false );
229
-
230
- - $current_ver = $deprecated_ver ? $deprecated_ver : PUM::VER;
231
- + $current_ver = $deprecated_ver ? $deprecated_ver : PUM::VER;
232
- - add_option( 'pum_ver', PUM::VER );
233
- + add_site_option( 'pum_ver', PUM::VER );
234
-
235
- - }
236
- + }
237
-
238
- - if ( version_compare( $current_ver, PUM::VER, '<' ) ) {
239
- - // Save Upgraded From option
240
- + if ( version_compare( $current_ver, PUM::VER, '<' ) ) {
241
- + // Save Upgraded From option
242
- - update_option( 'pum_ver_upgraded_from', $current_ver );
243
- - update_option( 'pum_ver', PUM::VER );
244
- + update_site_option( 'pum_ver_upgraded_from', $current_ver );
245
- + update_site_option( 'pum_ver', PUM::VER );
246
- - }
247
- + }
248
-
249
- - }
250
- + }
251
-
252
- - /**
253
- - * Registers the pum-upgrades admin page.
254
- - */
255
- - public function register_pages() {
256
- - global $pum_upgrades_page;
257
- + /**
258
- + * Registers the pum-upgrades admin page.
259
- + */
260
- + public function register_pages() {
261
- + global $pum_upgrades_page;
262
- -
263
- - $parent = null;
264
- -
265
- - if ( function_exists( 'is_network_admin' ) && is_network_admin() ) {
266
- - add_menu_page(
267
- - __( 'Popup Maker', 'popup-maker' ),
268
- - __( 'Popup Maker', 'popup-maker' ),
269
- - 'manage_network_plugins',
270
- - 'popup-maker',
271
- - '',
272
- - POPMAKE_URL . '/assets/images/admin/dashboard-icon.png'
273
- - );
274
- - $parent = 'popup-maker';
275
- - }
276
- -
277
- - $this->page = add_submenu_page(
278
- + $this->page = add_submenu_page(
279
- - $parent,
280
- + $this->is_network_admin() ? 'index.php' : null,
281
- - __( 'Popup Maker Upgrades', 'popup-maker' ),
282
- - __( 'Popup Maker Upgrades', 'popup-maker' ),
283
- + __( 'Popup Maker Upgrades', 'popup-maker' ),
284
- + __( 'Popup Maker Upgrades', 'popup-maker' ),
285
- - 'manage_options',
286
- + $this->required_cap(),
287
- - 'pum-upgrades',
288
- + 'pum-upgrades',
289
- - array( $this, 'upgrades_screen' )
290
- + array(
291
- + $this,
292
- + 'upgrades_screen',
293
- + )
294
- - );
295
- + );
296
-
297
- - $pum_upgrades_page = $this->page;
298
- - }
299
- + $pum_upgrades_page = $this->page;
300
- + }
301
-
302
- + public function get_site_list() {
303
- + $current_args = get_site_transient( 'pum-network-site-list-args' );
304
- + $current_list = get_site_transient( 'pum-network-site-list' );
305
- + $new_args = array(
306
- + 'network_id' => null,
307
- + 'limit' => $this->get_arg( 'site_limit' ),
308
- + 'offset' => $this->get_arg( 'site_offset' ),
309
- + );
310
- +
311
- + if ( ! $current_list || $current_args != $new_args ) {
312
- + $current_list = wp_get_sites( $new_args );
313
- + set_site_transient( 'pum-network-site-list', $current_list );
314
- + set_site_transient( 'pum-network-site-list-args', $current_args );
315
- + }
316
- +
317
- + return $current_list;
318
- +
319
- + }
320
- +
321
- + public function get_current_blog_id() {
322
- + $list = $this->get_site_list();
323
- +
324
- + if ( empty( $this->upgrade_args['site_index'] ) ) {
325
- + $this->upgrade_args['site_index'] = 0;
326
- + }
327
- +
328
- + return $list[ $this->upgrade_args['site_index'] ]['blog_id'];
329
- + }
330
- +
331
- + public function get_next_blog_id() {
332
- + $list = $this->get_site_list();
333
- +
334
- + if ( empty( $this->upgrade_args['site_index'] ) ) {
335
- + $this->upgrade_args['site_index'] = 0;
336
- + }
337
- +
338
- + $next_key = $this->upgrade_args['site_index'] + 1;
339
- +
340
- + // If the current list is complete, get the next page and reset counts.
341
- + if ( ! isset ( $list[ $next_key ] ) && $next_key >= ( count( $list ) - 1 ) ) {
342
- + $this->step_up();
343
- + }
344
- +
345
- + return $list[ $this->upgrade_args['site_index'] ]['blog_id'];
346
- + }
347
- +
348
- - /**
349
- - * Process upgrade args.
350
- - */
351
- - public function process_upgrade_args() {
352
- + /**
353
- + * Process upgrade args.
354
- + */
355
- + public function process_upgrade_args() {
356
-
357
- - $page = isset( $_GET['page'] ) ? $_GET['page'] : '';
358
- + $page = isset( $_GET['page'] ) ? $_GET['page'] : '';
359
-
360
- - if ( ! ( defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['action'] == 'pum_trigger_upgrades' ) && $page != 'pum-upgrades' ) {
361
- + if ( ! $this->is_network_ajax() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['action'] == 'pum_trigger_upgrades' ) && $page != 'pum-upgrades' ) {
362
- - return;
363
- - }
364
- + return;
365
- + }
366
-
367
- - $this->doing_upgrades = true;
368
- + $this->doing_upgrades = true;
369
-
370
- - $action = isset( $_REQUEST['pum-upgrade'] ) ? sanitize_text_field( $_REQUEST['pum-upgrade'] ) : $this->get_pum_db_ver() + 1;
371
- - $step = isset( $_REQUEST['step'] ) ? absint( $_REQUEST['step'] ) : 1;
372
- - $total = isset( $_REQUEST['total'] ) ? absint( $_REQUEST['total'] ) : false;
373
- - $custom = isset( $_REQUEST['custom'] ) ? absint( $_REQUEST['custom'] ) : 0;
374
- - $number = isset( $_REQUEST['number'] ) ? absint( $_REQUEST['number'] ) : 100;
375
- - $completed = isset( $_REQUEST['completed'] ) ? absint( $_REQUEST['completed'] ) : false;
376
- - $steps = ceil( $total / $number );
377
- + $action = isset( $_REQUEST['pum-upgrade'] ) ? sanitize_text_field( $_REQUEST['pum-upgrade'] ) : $this->get_pum_db_ver() + 1;
378
- + $step = isset( $_REQUEST['step'] ) ? absint( $_REQUEST['step'] ) : 1;
379
- + $total = isset( $_REQUEST['total'] ) ? absint( $_REQUEST['total'] ) : false;
380
- + $custom = isset( $_REQUEST['custom'] ) ? absint( $_REQUEST['custom'] ) : 0;
381
- + $number = isset( $_REQUEST['number'] ) ? absint( $_REQUEST['number'] ) : 100;
382
- + $completed = isset( $_REQUEST['completed'] ) ? absint( $_REQUEST['completed'] ) : false;
383
- + $steps = ceil( $total / $number );
384
-
385
- +
386
- - if ( $step > $steps ) {
387
- - // Prevent a weird case where the estimate was off. Usually only a couple.
388
- - $steps = $step;
389
- - }
390
- + if ( $step > $steps ) {
391
- + // Prevent a weird case where the estimate was off. Usually only a couple.
392
- + $steps = $step;
393
- + }
394
-
395
- - $this->upgrade_args = array(
396
- - 'page' => 'pum-upgrades',
397
- - 'pum-upgrade' => $action,
398
- - 'step' => $step,
399
- - 'total' => $total,
400
- - 'custom' => $custom,
401
- - 'steps' => $steps,
402
- - 'number' => $number,
403
- - 'completed' => $completed,
404
- - );
405
- + $this->upgrade_args = array(
406
- + 'page' => 'pum-upgrades',
407
- + 'pum-upgrade' => $action,
408
- + 'step' => $step,
409
- + 'total' => $total,
410
- + 'custom' => $custom,
411
- + 'steps' => $steps,
412
- + 'number' => $number,
413
- + 'completed' => $completed,
414
- + );
415
- +
416
- + if ( $this->is_network_admin_request() ) {
417
- + $this->upgrade_args['site_index'] = isset( $_REQUEST['site_index'] ) ? absint( $_REQUEST['site_index'] ) : 0;
418
- + $this->upgrade_args['site_total'] = isset( $_REQUEST['site_total'] ) ? absint( $_REQUEST['site_total'] ) : get_site_option( 'blog_count' );
419
- + $this->upgrade_args['site_limit'] = isset( $_REQUEST['site_limit'] ) ? absint( $_REQUEST['site_limit'] ) : 100;
420
- + $this->upgrade_args['site_offset'] = isset( $_REQUEST['site_offset'] ) ? absint( $_REQUEST['site_offset'] ) : 0;
421
- + // Hash key to verify the ajax comes from a verified network admin.
422
- + $this->upgrade_args['hash'] = wp_hash( 'pum-network-admin' );
423
- +
424
- + update_site_option( 'pum_doing_network_upgrade', $this->upgrade_args );
425
- + update_blog_option ( $this->get_current_blog_id(), 'pum_doing_upgrade', $this->upgrade_args );
426
- + } else {
427
- - update_option( 'pum_doing_upgrade', $this->upgrade_args );
428
- + update_option( 'pum_doing_upgrade', $this->upgrade_args );
429
- + }
430
-
431
- - }
432
- + }
433
-
434
- - /**
435
- + /**
436
- - * Get upgrade arg.
437
- + * Gets the pum_db_ver or sets and returns the correct one.
438
- - *
439
- + *
440
- - * @param string $key
441
- + * @see PUM_Upgrades::set_pum_db_ver()
442
- - *
443
- + *
444
- - * @return bool|null
445
- + * return $pum_db_ver
446
- - */
447
- + */
448
- - public function set_arg( $key, $value = null ) {
449
- + public function get_pum_db_ver() {
450
-
451
- - $this->upgrade_args[ $key ] = $value;
452
- - if ( $key == 'number' || $key == 'total' ) {
453
- - $this->upgrade_args['steps'] = ceil( $this->upgrade_args['total'] / $this->upgrade_args['number'] );
454
- + // this is the current database schema version number
455
- + $pum_db_ver = pum_get_db_ver();
456
- +
457
- + if ( ! $pum_db_ver ) {
458
- + $this->set_pum_db_ver();
459
- + $pum_db_ver = pum_get_db_ver();
460
- - }
461
- + }
462
- - if ( $this->upgrade_args['step'] > $this->upgrade_args['steps'] ) {
463
- - // Prevent a weird case where the estimate was off. Usually only a couple.
464
- - $this->upgrade_args['steps'] = $this->upgrade_args['step'];
465
- - } elseif ( $this->upgrade_args['step'] * $this->upgrade_args['steps'] ) {
466
- - update_option( 'pum_doing_upgrade', $this->upgrade_args );
467
- +
468
- + return preg_replace( '/[^0-9.].*/', '', $pum_db_ver );
469
- - }
470
- + }
471
-
472
- + /**
473
- + * Updates the pum_db_ver to the passed $version.
474
- + *
475
- + * If no $version is passed a default value will be established.
476
- + *
477
- + * @param null $version
478
- + */
479
- + public function set_pum_db_ver( $version = null ) {
480
- +
481
- + if ( $version ) {
482
- + $version = preg_replace( '/[^0-9.].*/', '', $version );
483
- + update_option( 'pum_db_ver', $version );
484
- +
485
- + return;
486
- - }
487
- + }
488
-
489
- + $upgraded_from = get_site_option( 'pum_ver_upgraded_from', false );
490
- +
491
- + // this is the current database schema version number
492
- + $current_db_ver = pum_get_db_ver();
493
- +
494
- + // If no current db version, but prior install detected, set db version correctly.
495
- + if ( ! $current_db_ver ) {
496
- + if ( $upgraded_from ) {
497
- + if ( version_compare( $upgraded_from, '1.3.0', '<' ) ) {
498
- + $current_db_ver = 1;
499
- + } else {
500
- + $current_db_ver = 2;
501
- + }
502
- + } else {
503
- + $current_db_ver = PUM::DB_VER;
504
- + }
505
- + add_option( 'pum_db_ver', $current_db_ver );
506
- + }
507
- +
508
- + }
509
- +
510
- - /**
511
- - * Get upgrade arg.
512
- - *
513
- - * @param string $key
514
- - *
515
- - * @return bool|null
516
- - */
517
- + /**
518
- + * Get upgrade arg.
519
- + *
520
- + * @param string $key
521
- + *
522
- + * @return bool|null
523
- + */
524
- - public function get_arg( $key = null ) {
525
- + public function set_arg( $key, $value = null ) {
526
-
527
- - if ( ! $key ) {
528
- - return null;
529
- - }
530
- + $this->upgrade_args[ $key ] = $value;
531
-
532
- - if ( ! isset( $this->upgrade_args[ $key ] ) ) {
533
- - return false;
534
- + if ( $key == 'number' || $key == 'total' ) {
535
- + $this->upgrade_args['steps'] = ceil( $this->upgrade_args['total'] / $this->upgrade_args['number'] );
536
- - }
537
- + }
538
-
539
- - return $this->upgrade_args[ $key ];
540
- -
541
- + if ( $this->upgrade_args['step'] > $this->upgrade_args['steps'] ) {
542
- + // Prevent a weird case where the estimate was off. Usually only a couple.
543
- + $this->upgrade_args['steps'] = $this->upgrade_args['step'];
544
- - }
545
- + }
546
-
547
- - public function get_args() {
548
- - return $this->upgrade_args;
549
- + if ( $this->is_network_admin_request() ) {
550
- + update_site_option( 'pum_doing_network_upgrade', $this->upgrade_args );
551
- + update_blog_option ( $this->get_current_blog_id(), 'pum_doing_upgrade', $this->upgrade_args );
552
- + } else {
553
- + update_option( 'pum_doing_upgrade', $this->upgrade_args );
554
- - }
555
- + }
556
- + }
557
-
558
- - public function doing_upgrades() {
559
- - return $this->doing_upgrades;
560
- - }
561
- + public function doing_upgrades() {
562
- + return $this->doing_upgrades;
563
- + }
564
-
565
- - /**
566
- - * Display Upgrade Notices
567
- - *
568
- - * @return void
569
- - */
570
- - public function show_upgrade_notices() {
571
- + /**
572
- + * Display Upgrade Notices
573
- + *
574
- + * @return void
575
- + */
576
- + public function show_upgrade_notices() {
577
-
578
- - $screen = get_current_screen();
579
- + $screen = get_current_screen();
580
-
581
- - if ( $screen->id == $this->page ) {
582
- - return; // Don't show notices on the upgrades page
583
- - }
584
- + if ( $screen->id == $this->page ) {
585
- + return; // Don't show notices on the upgrades page
586
- + }
587
-
588
- - if ( ! $this->has_upgrades() ) {
589
- - return;
590
- - }
591
- + if ( ! $this->has_upgrades() ) {
592
- + return;
593
- + }
594
-
595
- - // Sequential Orders was the first stepped upgrade, so check if we have a stalled upgrade
596
- - $resume_upgrade = $this->maybe_resume_upgrade();
597
- + // Sequential Orders was the first stepped upgrade, so check if we have a stalled upgrade
598
- + $resume_upgrade = $this->maybe_resume_upgrade();
599
-
600
- - if ( ! empty( $resume_upgrade ) ) {
601
- + if ( ! empty( $resume_upgrade ) ) {
602
-
603
- - $resume_url = add_query_arg( $resume_upgrade, admin_url( 'index.php' ) );
604
- - printf(
605
- - '<div class="error"><p>' . __( 'Popup Maker needs to complete a database upgrade that was previously started, click <a href="%s">here</a> to resume the upgrade.', 'popup-maker' ) . '</p></div>',
606
- - esc_url( $resume_url )
607
- - );
608
- + printf( '<div class="error"><p>' . __( 'Popup Maker needs to complete a database upgrade that was previously started, click <a href="%s">here</a> to resume the upgrade.', 'popup-maker' ) . '</p></div>', esc_url( $this->get_resume_url() ) );
609
-
610
- - } else {
611
- + } else {
612
-
613
- - printf(
614
- - '<div class="error"><p><strong>%s:</strong> <span class="dashicons dashicons-warning" style="color: #dc3232;"></span> %s %s %s</p></div>',
615
- - __( 'Popup Maker', 'popup-maker' ),
616
- - __( 'Important', 'popup-maker' ),
617
- - __( 'Database upgrades required.', 'popup-maker' ),
618
- - sprintf(
619
- - __( 'Please click %shere%s to complete these changes now.', 'popup-maker' ),
620
- - '<a href="' . esc_url( admin_url( 'options.php?page=pum-upgrades' ) ) . '">',
621
- - '</a>'
622
- - )
623
- - );
624
- + printf( '<div class="error"><p><strong>%s:</strong> <span class="dashicons dashicons-warning" style="color: #dc3232;"></span> %s %s %s</p></div>', __( 'Popup Maker', 'popup-maker' ), __( 'Important', 'popup-maker' ), __( 'Database upgrades required.', 'popup-maker' ), sprintf( __( 'Please click %shere%s to complete these changes now.', 'popup-maker' ), '<a href="' . esc_url( $this->get_upgrade_link() ) . '">', '</a>' ) );
625
-
626
- - }
627
- + }
628
-
629
- - }
630
- + }
631
-
632
- - /**
633
- + /**
634
- - * Triggers all upgrade functions
635
- + * Returns true if there are unprocessed upgrades.
636
- - *
637
- + *
638
- - * This function is usually triggered via AJAX
639
- - *
640
- - * @return void
641
- + * @return bool
642
- - */
643
- + */
644
- - public function trigger_upgrades() {
645
- -
646
- - if ( ! current_user_can( 'manage_options' ) ) {
647
- - wp_die( __( 'You do not have permission to do upgrades', 'popup-maker' ), __( 'Error', 'popup-maker' ), array( 'response' => 403 ) );
648
- + public function has_upgrades() {
649
- + return boolval( count( $this->get_upgrades() ) );
650
- - }
651
- + }
652
-
653
- - $deprecated_ver = get_site_option( 'popmake_version', false );
654
- - $current_ver = get_option( 'pum_ver', $deprecated_ver );
655
- -
656
- - // Save Upgraded From option
657
- - if ( $current_ver ) {
658
- - update_option( 'pum_ver_upgraded_from', $current_ver );
659
- - }
660
- -
661
- - update_option( 'pum_ver', PUM::VER );
662
- -
663
- - // Process DB Upgrades
664
- - $this->process_upgrades();
665
- -
666
- - if ( DOING_AJAX ) {
667
- - echo json_encode( array(
668
- - 'complete' => true,
669
- - 'status' => sprintf(
670
- - '<strong>%s</strong><br/>%s',
671
- - __( 'Upgrades have been completed successfully.', 'popup-maker' ),
672
- - sprintf( 'You will automatically be redirected in %s seconds', '<span id="pum-countdown">5</span>' )
673
- - ),
674
- - 'redirect' => admin_url( 'index.php?page=pum-about' ),
675
- - 'countdown' => 5000,
676
- - ) ); // Let AJAX know that the upgrade is complete
677
- - exit;
678
- - }
679
- - }
680
- -
681
- - /**
682
- + /**
683
- - * Updates the pum_db_ver to the passed $version.
684
- + * For use when doing 'stepped' upgrade routines, to see if we need to start somewhere in the middle
685
- - *
686
- + *
687
- - * If no $version is passed a default value will be established.
688
- - *
689
- - * @param null $version
690
- + * @return mixed When nothing to resume returns false, otherwise starts the upgrade where it left off
691
- - */
692
- + */
693
- - public function set_pum_db_ver( $version = null ) {
694
- + public function maybe_resume_upgrade() {
695
-
696
- - if ( $version ) {
697
- - $version = preg_replace( '/[^0-9.].*/', '', $version );
698
- - update_option( 'pum_db_ver', $version );
699
- + if ( $this->is_network_admin_request() ) {
700
- + $doing_upgrade = get_site_option( 'pum_doing_network_upgrade', false );
701
- + } else {
702
- + $doing_upgrade = get_option( 'pum_doing_upgrade', false );
703
- + }
704
-
705
- - return;
706
- + if ( empty( $doing_upgrade ) ) {
707
- + return false;
708
- - }
709
- + }
710
-
711
- - $upgraded_from = get_option( 'pum_ver_upgraded_from', false );
712
- + return $doing_upgrade;
713
-
714
- - // this is the current database schema version number
715
- - $current_db_ver = pum_get_db_ver();
716
- -
717
- - // If no current db version, but prior install detected, set db version correctly.
718
- - if ( ! $current_db_ver ) {
719
- - if ( $upgraded_from ) {
720
- - if ( version_compare( $upgraded_from, '1.3.0', '<' ) ) {
721
- - $current_db_ver = 1;
722
- - } else {
723
- - $current_db_ver = 2;
724
- - }
725
- + }
726
- - } else {
727
- - $current_db_ver = PUM::DB_VER;
728
- - }
729
- - add_option( 'pum_db_ver', $current_db_ver );
730
- - }
731
-
732
- + public function get_resume_url() {
733
- + $resume_upgrade = $this->maybe_resume_upgrade();
734
- +
735
- + if ( empty( $resume_upgrade ) ) {
736
- + return '';
737
- - }
738
- + }
739
-
740
- - /**
741
- - * Gets the pum_db_ver or sets and returns the correct one.
742
- - *
743
- - * @see PUM_Upgrades::set_pum_db_ver()
744
- - *
745
- - * return $pum_db_ver
746
- - */
747
- - public function get_pum_db_ver() {
748
- + $url = $this->is_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'index.php' );
749
-
750
- - // this is the current database schema version number
751
- - $pum_db_ver = pum_get_db_ver();
752
- + return add_query_arg( $resume_upgrade, $url );
753
-
754
- - if ( ! $pum_db_ver ) {
755
- - $this->set_pum_db_ver();
756
- - $pum_db_ver = pum_get_db_ver();
757
- - }
758
- + }
759
-
760
- - return preg_replace( '/[^0-9.].*/', '', $pum_db_ver );
761
- + public function get_upgrade_link() {
762
- + return $this->is_network_admin() ?
763
- + network_admin_url( 'admin.php?page=pum-upgrades' ) :
764
- + admin_url( 'options.php?page=pum-upgrades' );
765
- - }
766
- + }
767
-
768
- + public function get_complete_link() {
769
- + return $this->is_network_admin() ?
770
- + network_admin_url( 'admin.php?page=pum-about' ) :
771
- + admin_url( 'index.php?page=pum-about' );
772
- + }
773
- +
774
- - /**
775
- - * Process upgrades in a stepped succession.
776
- - *
777
- - * Starts with the current version and loops until reaching the target version.
778
- - */
779
- + /**
780
- + * Process upgrades in a stepped succession.
781
- + *
782
- + * Starts with the current version and loops until reaching the target version.
783
- + */
784
- - public function process_upgrades() {
785
- + public function get_upgrades() {
786
-
787
- - // this is the target version that we need to reach
788
- - $target_db_ver = PUM::DB_VER;
789
- + // this is the target version that we need to reach
790
- + $target_db_ver = PUM::DB_VER;
791
-
792
- - // this is the current database schema version number
793
- - $current_db_ver = $this->get_pum_db_ver();
794
- + // this is the current database schema version number
795
- + $current_db_ver = $this->get_pum_db_ver();
796
-
797
- + $upgrades = array();
798
- +
799
- - // Run upgrade routine until target version reached.
800
- - while ( $current_db_ver < $target_db_ver ) {
801
- + // Run upgrade routine until target version reached.
802
- + while ( $current_db_ver < $target_db_ver ) {
803
-
804
- - // increment the current db_ver by one
805
- - $current_db_ver ++;
806
- + // increment the current db_ver by one
807
- + $current_db_ver ++;
808
-
809
- - $this->current_routine = $current_db_ver;
810
- -
811
- - $this->next_routine = $current_db_ver == $target_db_ver ? null : $current_db_ver + 1;
812
- -
813
- - if ( file_exists( POPMAKE_DIR . "includes/admin/upgrades/class-pum-admin-upgrade-routine-{$current_db_ver}.php" ) ) {
814
- + if ( file_exists( POPMAKE_DIR . "includes/admin/upgrades/class-pum-admin-upgrade-routine-{$current_db_ver}.php" ) ) {
815
-
816
- - require_once POPMAKE_DIR . "includes/admin/upgrades/class-pum-admin-upgrade-routine-{$current_db_ver}.php";
817
- + require_once POPMAKE_DIR . "includes/admin/upgrades/class-pum-admin-upgrade-routine-{$current_db_ver}.php";
818
-
819
- - $func = "PUM_Admin_Upgrade_Routine_{$current_db_ver}::run";
820
- - if ( is_callable( $func ) ) {
821
- - call_user_func( $func );
822
- + $class_name = "PUM_Admin_Upgrade_Routine_{$current_db_ver}";
823
- + $method = "$class_name::description";
824
- + if ( class_exists( $class_name ) && is_callable( $method ) ) {
825
- + $class_name::set_upgrade_instance( $this );
826
- + $upgrades[ $current_db_ver ] = call_user_func( $method );
827
- - }
828
- + }
829
-
830
- - }
831
- + }
832
-
833
- - }
834
- + }
835
-
836
- + return $upgrades;
837
- - }
838
- + }
839
-
840
- - public function current_routine() {
841
- - return $this->current_routine;
842
- + /**
843
- + * Triggers all upgrade functions
844
- + *
845
- + * This function is usually triggered via AJAX
846
- + *
847
- + * @return void
848
- + */
849
- + public function trigger_upgrades() {
850
- +
851
- + if ( ! current_user_can( $this->required_cap() ) ) {
852
- + wp_die( __( 'You do not have permission to do upgrades', 'popup-maker' ), __( 'Error', 'popup-maker' ), array( 'response' => 403 ) );
853
- - }
854
- + }
855
-
856
- - public function next_routine() {
857
- - return $this->next_routine;
858
- + if ( $this->is_network_ajax() ) {
859
- + $current_site = get_current_blog_id();
860
- + switch_to_blog( $this->get_current_blog_id() );
861
- - }
862
- + }
863
-
864
- + // Process DB Upgrades
865
- + $this->process_upgrades();
866
- +
867
- + if ( $this->is_network_ajax() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
868
- + echo json_encode( array(
869
- + 'complete' => true,
870
- + 'status' => sprintf( '<strong>%s</strong><br/>%s', __( 'Upgrades have been completed successfully.', 'popup-maker' ), sprintf( 'You will automatically be redirected in %s seconds', '<span id="pum-countdown">5</span>' ) ),
871
- + 'redirect' => $this->get_complete_url(),
872
- + 'countdown' => 5000,
873
- + ) ); // Let AJAX know that the upgrade is complete
874
- + exit;
875
- + }
876
- + }
877
- +
878
- - /**
879
- - * Process upgrades in a stepped succession.
880
- - *
881
- - * Starts with the current version and loops until reaching the target version.
882
- - */
883
- + /**
884
- + * Process upgrades in a stepped succession.
885
- + *
886
- + * Starts with the current version and loops until reaching the target version.
887
- + */
888
- - public function get_upgrades() {
889
- + public function process_upgrades() {
890
-
891
- - // this is the target version that we need to reach
892
- - $target_db_ver = PUM::DB_VER;
893
- + // this is the target version that we need to reach
894
- + $target_db_ver = PUM::DB_VER;
895
-
896
- - // this is the current database schema version number
897
- - $current_db_ver = $this->get_pum_db_ver();
898
- + // this is the current database schema version number
899
- + $current_db_ver = $this->get_pum_db_ver();
900
-
901
- - $upgrades = array();
902
- -
903
- - // Run upgrade routine until target version reached.
904
- - while ( $current_db_ver < $target_db_ver ) {
905
- + // Run upgrade routine until target version reached.
906
- + while ( $current_db_ver < $target_db_ver ) {
907
-
908
- - // increment the current db_ver by one
909
- - $current_db_ver ++;
910
- + // increment the current db_ver by one
911
- + $current_db_ver ++;
912
-
913
- + $this->current_routine = $current_db_ver;
914
- +
915
- + $this->next_routine = $current_db_ver == $target_db_ver ? null : $current_db_ver + 1;
916
- +
917
- - if ( file_exists( POPMAKE_DIR . "includes/admin/upgrades/class-pum-admin-upgrade-routine-{$current_db_ver}.php" ) ) {
918
- + if ( file_exists( POPMAKE_DIR . "includes/admin/upgrades/class-pum-admin-upgrade-routine-{$current_db_ver}.php" ) ) {
919
-
920
- - require_once POPMAKE_DIR . "includes/admin/upgrades/class-pum-admin-upgrade-routine-{$current_db_ver}.php";
921
- + require_once POPMAKE_DIR . "includes/admin/upgrades/class-pum-admin-upgrade-routine-{$current_db_ver}.php";
922
-
923
- - $func = "PUM_Admin_Upgrade_Routine_{$current_db_ver}::description";
924
- - if ( is_callable( $func ) ) {
925
- - $upgrades[ $current_db_ver ] = call_user_func( $func );
926
- - }
927
-
928
- + $class_name = "PUM_Admin_Upgrade_Routine_{$current_db_ver}";
929
- + $method = "$class_name::run";
930
- + if ( class_exists( $class_name ) && is_callable( $method ) ) {
931
- + $class_name::set_upgrade_instance( $this );
932
- + call_user_func( $method );
933
- - }
934
- + }
935
-
936
- - }
937
- + }
938
-
939
- - return $upgrades;
940
- - }
941
- + }
942
-
943
- - public function get_upgrade( $version = null ) {
944
- - if ( isset ( $this->get_upgrades()[ $version ] ) ) {
945
- - return $this->get_upgrades()[ $version ];
946
- - } else {
947
- - return false;
948
- - }
949
- + }
950
- - }
951
-
952
- - /**
953
- - * Returns true if there are unprocessed upgrades.
954
- - *
955
- - * @return bool
956
- - */
957
- - public function has_upgrades() {
958
- - return boolval( count( $this->get_upgrades() ) );
959
- + public function current_routine() {
960
- + return $this->current_routine;
961
- - }
962
- + }
963
-
964
- - /**
965
- - * For use when doing 'stepped' upgrade routines, to see if we need to start somewhere in the middle
966
- - *
967
- - * @return mixed When nothing to resume returns false, otherwise starts the upgrade where it left off
968
- - */
969
- - public function maybe_resume_upgrade() {
970
- -
971
- - $doing_upgrade = get_option( 'pum_doing_upgrade', false );
972
- -
973
- - if ( empty( $doing_upgrade ) ) {
974
- - return false;
975
- + public function next_routine() {
976
- + return $this->next_routine;
977
- - }
978
- + }
979
-
980
- - return $doing_upgrade;
981
- -
982
- - }
983
- -
984
- - /**
985
- - * Adds an upgrade action to the completed upgrades array
986
- - *
987
- - * @param string $upgrade_action The action to add to the competed upgrades array
988
- - *
989
- - * @return bool If the function was successfully added
990
- - */
991
- - public function set_upgrade_complete( $upgrade_action = '' ) {
992
- + /**
993
- + * Adds an upgrade action to the completed upgrades array
994
- + *
995
- + * @param string $upgrade_action The action to add to the competed upgrades array
996
- + *
997
- + * @return bool If the function was successfully added
998
- + */
999
- + public function set_upgrade_complete( $upgrade_action = '' ) {
1000
-
1001
- - if ( empty( $upgrade_action ) ) {
1002
- - return false;
1003
- - }
1004
- + if ( empty( $upgrade_action ) ) {
1005
- + return false;
1006
- + }
1007
-
1008
- + delete_option( 'pum_doing_upgrade' );
1009
- +
1010
- - $completed_upgrades = $this->get_completed_upgrades();
1011
- - $completed_upgrades[] = $upgrade_action;
1012
- + $completed_upgrades = $this->get_completed_upgrades();
1013
- + $completed_upgrades[] = $upgrade_action;
1014
-
1015
- - // Remove any blanks, and only show uniques
1016
- - $completed_upgrades = array_unique( array_values( $completed_upgrades ) );
1017
- + // Remove any blanks, and only show uniques
1018
- + $completed_upgrades = array_unique( array_values( $completed_upgrades ) );
1019
-
1020
- - return update_option( 'pum_completed_upgrades', $completed_upgrades );
1021
- - }
1022
- + return update_option( 'pum_completed_upgrades', $completed_upgrades );
1023
- + }
1024
-
1025
- - /**
1026
- + /**
1027
- + * Get's the array of completed upgrade actions
1028
- + *
1029
- + * @return array The array of completed upgrades
1030
- + */
1031
- + public function get_completed_upgrades() {
1032
- +
1033
- + $completed_upgrades = get_option( 'pum_completed_upgrades' );
1034
- +
1035
- + if ( false === $completed_upgrades ) {
1036
- + $completed_upgrades = array();
1037
- + }
1038
- +
1039
- + return $completed_upgrades;
1040
- +
1041
- + }
1042
- +
1043
- + /**
1044
- - * Check if the upgrade routine has been run for a specific action
1045
- - *
1046
- - * @param string $upgrade_action The upgrade action to check completion for
1047
- - *
1048
- + * Check if the upgrade routine has been run for a specific action
1049
- + *
1050
- + * @param string $upgrade_action The upgrade action to check completion for
1051
- + *
1052
- - * @return bool If the action has been added to the copmleted actions array
1053
- + * @return bool If the action has been added to the completed actions array
1054
- - */
1055
- - public function has_upgrade_completed( $upgrade_action = '' ) {
1056
- + */
1057
- + public function has_upgrade_completed( $upgrade_action = '' ) {
1058
-
1059
- - if ( empty( $upgrade_action ) ) {
1060
- - return false;
1061
- - }
1062
- + if ( empty( $upgrade_action ) ) {
1063
- + return false;
1064
- + }
1065
-
1066
- - $completed_upgrades = $this->get_completed_upgrades();
1067
- + $completed_upgrades = $this->get_completed_upgrades();
1068
-
1069
- - return in_array( $upgrade_action, $completed_upgrades );
1070
- + return in_array( $upgrade_action, $completed_upgrades );
1071
-
1072
- - }
1073
- + }
1074
-
1075
- - /**
1076
- - * Get's the array of completed upgrade actions
1077
- - *
1078
- - * @return array The array of completed upgrades
1079
- - */
1080
- - public function get_completed_upgrades() {
1081
- -
1082
- - $completed_upgrades = get_option( 'pum_completed_upgrades' );
1083
- -
1084
- - if ( false === $completed_upgrades ) {
1085
- - $completed_upgrades = array();
1086
- - }
1087
- -
1088
- - return $completed_upgrades;
1089
- -
1090
- - }
1091
- -
1092
- - public function step_up() {
1093
- - $step = $this->upgrade_args['step'];
1094
- - if ( $step >= $this->upgrade_args['steps'] ) {
1095
- - $this->upgrade_args['step'] = $this->upgrade_args['steps'];
1096
- + public function step_up() {
1097
- + $step = $this->upgrade_args['step'];
1098
- + if ( $step >= $this->upgrade_args['steps'] ) {
1099
- + $this->upgrade_args['step'] = $this->upgrade_args['steps'];
1100
-
1101
- - return false;
1102
- - }
1103
- - $this->upgrade_args['step'] ++;
1104
- + return false;
1105
- + }
1106
- + $this->upgrade_args['step'] ++;
1107
-
1108
- - return true;
1109
- - }
1110
- + return true;
1111
- + }
1112
-
1113
- - /**
1114
- - * Renders the upgrades screen.
1115
- - */
1116
- - public function upgrades_screen() { ?>
1117
- - <div class="wrap">
1118
- - <h2>
1119
- - <?php _e( 'Popup Maker - Upgrades', 'popup-maker' ); ?>
1120
- + /**
1121
- + * Renders the upgrades screen.
1122
- + */
1123
- + public function upgrades_screen() { ?>
1124
- + <div class="wrap">
1125
- + <h2>
1126
- + <?php _e( 'Popup Maker - Upgrades', 'popup-maker' ); ?>
1127
- - <img src="<?php echo POPMAKE_URL . '/assets/images/admin/loading.gif'; ?>" id="pum-upgrade-loader"/>
1128
- + <img src="<?php echo POPMAKE_URL . '/assets/images/admin/loading.gif'; ?>" id="pum-upgrade-loader" />
1129
- - </h2>
1130
- + </h2>
1131
-
1132
- - <style>
1133
- - #pum-upgrade-status {
1134
- - max-height: 300px;
1135
- - background: #fff;
1136
- - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .5);
1137
- - overflow-y: scroll;
1138
- - text-overflow: ellipsis;
1139
- - padding: 0 1.5em;
1140
- - }
1141
- - </style>
1142
- - <p>
1143
- - <?php _e( 'The upgrade process has started, please be patient. This could take several minutes. You will be automatically redirected when the upgrade is finished.', 'popup-maker' ); ?>
1144
- - </p>
1145
- - <div id="pum-upgrade-status"></div>
1146
- - <script type="text/javascript">
1147
- - (function ($, document, undefined) {
1148
- - var $loader = $('#pum-upgrade-loader').hide(),
1149
- - $status_box = $('#pum-upgrade-status'),
1150
- - $timer,
1151
- - timer = 500;
1152
- + <style>
1153
- + #pum-upgrade-status {
1154
- + max-height: 300px;
1155
- + background: #fff;
1156
- + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .5);
1157
- + overflow-y: scroll;
1158
- + text-overflow: ellipsis;
1159
- + padding: 0 1.5em;
1160
- + }
1161
- + </style>
1162
- + <p>
1163
- + <?php _e( 'The upgrade process has started, please be patient. This could take several minutes. You will be automatically redirected when the upgrade is finished.', 'popup-maker' ); ?>
1164
- + </p>
1165
- + <div id="pum-upgrade-status"></div>
1166
- + <script type="text/javascript">
1167
- + (function ($, document, undefined) {
1168
- + var $loader = $('#pum-upgrade-loader').hide(),
1169
- + $status_box = $('#pum-upgrade-status'),
1170
- + $timer,
1171
- + timer = 500;
1172
-
1173
- - function update_status(message) {
1174
- - $('<p>')
1175
- - .html(message)
1176
- - .appendTo($status_box);
1177
- + function update_status(message) {
1178
- + $('<p>')
1179
- + .html(message)
1180
- + .appendTo($status_box);
1181
-
1182
- - $status_box.animate({
1183
- - scrollTop: $status_box.get(0).scrollHeight
1184
- - }, {
1185
- - duration: 'slow',
1186
- - queue: false
1187
- - });
1188
- - }
1189
- + $status_box.animate({
1190
- + scrollTop: $status_box.get(0).scrollHeight
1191
- + }, {
1192
- + duration: 'slow',
1193
- + queue: false
1194
- + });
1195
- + }
1196
-
1197
- - function countdown(timer, callback) {
1198
- - var time_left = timer - 1000;
1199
- - if (time_left >= 0) {
1200
- - setTimeout(function () {
1201
- - $timer.text(time_left / 1000);
1202
- - countdown(time_left, callback);
1203
- - }, 1000);
1204
- - } else {
1205
- - callback();
1206
- - }
1207
- - }
1208
- + function countdown(timer, callback) {
1209
- + var time_left = timer - 1000;
1210
- + if (time_left >= 0) {
1211
- + setTimeout(function () {
1212
- + $timer.text(time_left / 1000);
1213
- + countdown(time_left, callback);
1214
- + }, 1000);
1215
- + } else {
1216
- + callback();
1217
- + }
1218
- + }
1219
-
1220
- - function next_step(args) {
1221
- + function next_step(args) {
1222
-
1223
- - $loader.show();
1224
- + $loader.show();
1225
-
1226
- - if (args === undefined) {
1227
- - args = {};
1228
- - }
1229
- + if (args === undefined) {
1230
- + args = {};
1231
- + }
1232
-
1233
- - $.ajax({
1234
- - url: ajaxurl,
1235
- - data: $.extend({action: 'pum_trigger_upgrades'}, args),
1236
- - type: 'GET',
1237
- - dataType: 'json'
1238
- - })
1239
- - .done(function (response) {
1240
- + $.ajax({
1241
- + url: ajaxurl,
1242
- + data: $.extend({action: 'pum_trigger_upgrades'}, args),
1243
- + type: 'GET',
1244
- + dataType: 'json'
1245
- + })
1246
- + .done(function (response) {
1247
-
1248
- - if (response.status !== undefined) {
1249
- - update_status(response.status);
1250
- - }
1251
- + if (response.status !== undefined) {
1252
- + update_status(response.status);
1253
- + }
1254
-
1255
- - if (response.complete !== undefined) {
1256
- - $loader.hide();
1257
- - } else if (response.next !== undefined && typeof response.next === 'object') {
1258
- - next_step(response.next);
1259
- - }
1260
- + if (response.complete !== undefined) {
1261
- + $loader.hide();
1262
- + } else if (response.next !== undefined && typeof response.next === 'object') {
1263
- + next_step(response.next);
1264
- + }
1265
-
1266
- - if (response.redirect !== undefined) {
1267
- - if (response.countdown === undefined) {
1268
- - setTimeout(function () {
1269
- - document.location.href = response.redirect;
1270
- - }, timer);
1271
- - } else {
1272
- - $timer = $('#pum-countdown');
1273
- - countdown(response.countdown, function () {
1274
- - document.location.href = response.redirect;
1275
- - });
1276
- - }
1277
- - }
1278
- - })
1279
- - .fail(function () {
1280
- - update_status("<?php _e( 'Upgrade failed, please try again.', 'popup-maker' ); ?>");
1281
- - });
1282
- - }
1283
- + if (response.redirect !== undefined) {
1284
- + if (response.countdown === undefined) {
1285
- + setTimeout(function () {
1286
- + document.location.href = response.redirect;
1287
- + }, timer);
1288
- + } else {
1289
- + $timer = $('#pum-countdown');
1290
- + countdown(response.countdown, function () {
1291
- + document.location.href = response.redirect;
1292
- + });
1293
- + }
1294
- + }
1295
- + })
1296
- + .fail(function () {
1297
- + update_status("<?php _e( 'Upgrade failed, please try again.', 'popup-maker' ); ?>");
1298
- + });
1299
- + }
1300
-
1301
- - $(document).ready(function () {
1302
- - // Trigger upgrades on page load
1303
- - next_step(<?php echo json_encode( $this->get_args() ); ?>);
1304
- - update_status('<?php printf( '<strong>%s</strong>', $this->get_upgrade( $this->get_arg( 'pum-upgrade' ) ) ); ?>');
1305
- - });
1306
- - }(jQuery, document));
1307
- - </script>
1308
- + $(document).ready(function () {
1309
- + // Trigger upgrades on page load
1310
- + next_step(<?php echo json_encode( $this->get_args() ); ?>);
1311
- + update_status('<?php printf( '<strong>%s</strong>', $this->get_upgrade( $this->get_arg( 'pum-upgrade' ) ) ); ?>');
1312
- + });
1313
- + }(jQuery, document));
1314
- + </script>
1315
-
1316
- - </div>
1317
- - <?php
1318
- + </div>
1319
- + <?php
1320
- + }
1321
- +
1322
- + public function get_args() {
1323
- + return $this->upgrade_args;
1324
- + }
1325
- +
1326
- + public function get_upgrade( $version = null ) {
1327
- + if ( isset ( $this->get_upgrades()[ $version ] ) ) {
1328
- + return $this->get_upgrades()[ $version ];
1329
- + } else {
1330
- + return false;
1331
- + }
1332
- + }
1333
- +
1334
- + /**
1335
- + * Get upgrade arg.
1336
- + *
1337
- + * @param string $key
1338
- + *
1339
- + * @return bool|null
1340
- + */
1341
- + public function get_arg( $key = null ) {
1342
- +
1343
- + if ( ! $key ) {
1344
- + return null;
1345
- + }
1346
- +
1347
- + if ( ! isset( $this->upgrade_args[ $key ] ) ) {
1348
- + return false;
1349
- + }
1350
- +
1351
- + return $this->upgrade_args[ $key ];
1352
- +
1353
- - }
1354
- + }
1355
-
1356
- }
1357
-
1358
- Index: wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine-3.php
1359
- IDEA additional info:
1360
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
1361
- <+>UTF-8
1362
- ===================================================================
1363
- --- wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine-3.php (date 1460354639000)
1364
- +++ wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine-3.php (revision )
1365
- @@ -49,9 +49,8 @@
1366
- @set_time_limit( 0 );
1367
- }
1368
-
1369
- - $upgrades = PUM_Admin_Upgrades::instance();
1370
- - $completed = $upgrades->get_arg( 'completed' );
1371
- - $total = $upgrades->get_arg( 'total' );
1372
- + $completed = static::$upgrades->get_arg( 'completed' );
1373
- + $total = static::$upgrades->get_arg( 'total' );
1374
-
1375
- // Set the correct total.
1376
- if ( $total <= 1 ) {
1377
- @@ -60,12 +59,12 @@
1378
- foreach ( $popups as $status ) {
1379
- $total += $status;
1380
- }
1381
- - $upgrades->set_arg( 'total', $total );
1382
- + static::$upgrades->set_arg( 'total', $total );
1383
- }
1384
-
1385
- $popups = new PUM_Popup_Query( array(
1386
- - 'number' => $upgrades->get_arg( 'number' ),
1387
- - 'page' => $upgrades->get_arg( 'step' ),
1388
- + 'number' => static::$upgrades->get_arg( 'number' ),
1389
- + 'page' => static::$upgrades->get_arg( 'step' ),
1390
- 'status' => array( 'any', 'trash', 'auto-draft' ),
1391
- 'order' => 'ASC',
1392
- ) );
1393
- @@ -171,7 +170,7 @@
1394
- }
1395
-
1396
- if ( $completed < $total ) {
1397
- - $upgrades->set_arg( 'completed', $completed );
1398
- + static::$upgrades->set_arg( 'completed', $completed );
1399
- static::next_step();
1400
- }
1401
-
1402
-
1403
- Index: wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine.php
1404
- IDEA additional info:
1405
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
1406
- <+>UTF-8
1407
- ===================================================================
1408
- --- wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine.php (date 1460354639000)
1409
- +++ wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine.php (revision )
1410
- @@ -20,6 +20,15 @@
1411
- class PUM_Admin_Upgrade_Routine {
1412
-
1413
- /**
1414
- + * @var PUM_Admin_Upgrades
1415
- + */
1416
- + public static $upgrades;
1417
- +
1418
- + public static function set_upgrade_instance( $upgrades ) {
1419
- + static::$upgrades = $upgrades;
1420
- + }
1421
- +
1422
- + /**
1423
- * Describe the upgrade routine.
1424
- *
1425
- * @return string
1426
- @@ -33,8 +42,7 @@
1427
- *
1428
- * @return void
1429
- */
1430
- - public static function run() {
1431
- - }
1432
- + public static function run() {}
1433
-
1434
- /**
1435
- * Properly redirects or returns redirect url if DOING_AJAX.
1436
- @@ -51,18 +59,17 @@
1437
- */
1438
- public static function next_step() {
1439
-
1440
- - $upgrades = PUM_Admin_Upgrades::instance();
1441
- + static::$upgrades->step_up();
1442
-
1443
- - $upgrades->step_up();
1444
- -
1445
- - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
1446
- + if ( static::$upgrades->is_network_ajax() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
1447
- echo json_encode( array(
1448
- - 'status' => sprintf( __( 'Step %d of approximately %d running', 'popup-maker' ), $upgrades->get_arg( 'step' ), $upgrades->get_arg( 'steps' ) ),
1449
- - 'next' => $upgrades->get_args(),
1450
- + 'status' => sprintf( __( 'Step %d of approximately %d running', 'popup-maker' ), static::$upgrades->get_arg( 'step' ), static::$upgrades->get_arg( 'steps' ) ),
1451
- + 'next' => static::$upgrades->get_args(),
1452
- ) );
1453
- exit;
1454
- } else {
1455
- - $redirect = add_query_arg( $upgrades->get_args(), admin_url() );
1456
- + $url = static::$upgrades->is_network_admin() ? network_admin_url() : admin_url();
1457
- + $redirect = add_query_arg( static::$upgrades->get_args(), $url );
1458
- static::redirect( $redirect );
1459
- }
1460
-
1461
- @@ -70,26 +77,22 @@
1462
-
1463
- public static function done() {
1464
-
1465
- - $upgrades = PUM_Admin_Upgrades::instance();
1466
- + static::$upgrades->set_upgrade_complete( static::$upgrades->current_routine() );
1467
-
1468
- - delete_option( 'pum_doing_upgrade' );
1469
- + static::$upgrades->set_pum_db_ver( static::$upgrades->get_arg( 'pum-upgrade' ) );
1470
-
1471
- - $upgrades->set_upgrade_complete( $upgrades->current_routine() );
1472
- + $next_routine = static::$upgrades->next_routine();
1473
-
1474
- - $upgrades->set_pum_db_ver( $upgrades->get_arg( 'pum-upgrade' ) );
1475
- + if ( static::$upgrades->has_upgrades() && $next_routine && static::$upgrades->get_upgrade( $next_routine ) ) {
1476
- + if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
1477
-
1478
- - $next_routine = $upgrades->next_routine();
1479
- + static::$upgrades->set_arg( 'step', 1 );
1480
- + static::$upgrades->set_arg( 'completed', 0 );
1481
- + static::$upgrades->set_arg( 'pum-upgrade', $next_routine );
1482
-
1483
- - if ( $upgrades->has_upgrades() && $next_routine && $upgrades->get_upgrade( $next_routine ) ) {
1484
- - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
1485
- -
1486
- - $upgrades->set_arg( 'step', 1 );
1487
- - $upgrades->set_arg( 'completed', 0 );
1488
- - $upgrades->set_arg( 'pum-upgrade', $next_routine );
1489
- -
1490
- echo json_encode( array(
1491
- - 'status' => sprintf( '<strong>%s</strong>', $upgrades->get_upgrade( $next_routine ) ),
1492
- - 'next' => $upgrades->get_args(),
1493
- + 'status' => sprintf( '<strong>%s</strong>', static::$upgrades->get_upgrade( $next_routine ) ),
1494
- + 'next' => static::$upgrades->get_args(),
1495
- ) );
1496
- exit;
1497
- } else {
1498
- Index: wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine-4.php
1499
- IDEA additional info:
1500
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
1501
- <+>UTF-8
1502
- ===================================================================
1503
- --- wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine-4.php (date 1460354639000)
1504
- +++ wp-content/plugins/popup-maker/includes/admin/upgrades/class-pum-admin-upgrade-routine-4.php (revision )
1505
- @@ -49,9 +49,8 @@
1506
- @set_time_limit( 0 );
1507
- }
1508
-
1509
- - $upgrades = PUM_Admin_Upgrades::instance();
1510
- - $completed = $upgrades->get_arg( 'completed' );
1511
- - $total = $upgrades->get_arg( 'total' );
1512
- + $completed = static::$upgrades->get_arg( 'completed' );
1513
- + $total = static::$upgrades->get_arg( 'total' );
1514
-
1515
- // Set the correct total.
1516
- if ( $total <= 1 ) {
1517
- @@ -60,12 +59,12 @@
1518
- foreach ( $popups as $status ) {
1519
- $total += $status;
1520
- }
1521
- - $upgrades->set_arg( 'total', $total );
1522
- + static::$upgrades->set_arg( 'total', $total );
1523
- }
1524
-
1525
- $popups = new PUM_Popup_Query( array(
1526
- - 'number' => $upgrades->get_arg( 'number' ),
1527
- - 'page' => $upgrades->get_arg( 'step' ),
1528
- + 'number' => static::$upgrades->get_arg( 'number' ),
1529
- + 'page' => static::$upgrades->get_arg( 'step' ),
1530
- 'status' => array( 'any', 'trash', 'auto-draft' ),
1531
- 'order' => 'ASC',
1532
- ) );
1533
- @@ -138,7 +137,7 @@
1534
- }
1535
-
1536
- if ( $completed < $total ) {
1537
- - $upgrades->set_arg( 'completed', $completed );
1538
- + static::$upgrades->set_arg( 'completed', $completed );
1539
- static::next_step();
1540
- }
1541
-
1542
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/site.js CHANGED
@@ -2346,7 +2346,7 @@ var pum_debug_mode = false,
2346
  (function ($) {
2347
  "use strict";
2348
 
2349
- var gFormSettings = {},
2350
  pumNFController = false;
2351
 
2352
  /** Ninja Forms Support */
@@ -2386,8 +2386,8 @@ var pum_debug_mode = false,
2386
  $('.gform_wrapper > form').each(function () {
2387
  var $form = $(this),
2388
  form_id = $form.attr('id').replace('gform_', ''),
2389
- $settings = $form.find('meta[name="gforms-pum"]'),
2390
- settings = $settings.length ? JSON.parse($settings.attr('content')) : false;
2391
 
2392
  if (!settings || typeof settings !== 'object') {
2393
  return;
@@ -2398,7 +2398,7 @@ var pum_debug_mode = false,
2398
  })
2399
  /** Gravity Forms Support */
2400
  .on('gform_confirmation_loaded', function (event, form_id) {
2401
- var $form = $('#gform_' + form_id),
2402
  settings = gFormSettings[form_id] || false;
2403
 
2404
  window.PUM.forms.success($form, settings);
@@ -2406,8 +2406,8 @@ var pum_debug_mode = false,
2406
  /** Contact Form 7 Support */
2407
  .on('wpcf7:mailsent', '.wpcf7', function (event) {
2408
  var $form = $(event.target),
2409
- $settings = $form.find('meta[name="wpcf7-pum"]'),
2410
- settings = $settings.length ? JSON.parse($settings.attr('content')) : false;
2411
 
2412
  window.PUM.forms.success($form, settings);
2413
  });
2346
  (function ($) {
2347
  "use strict";
2348
 
2349
+ var gFormSettings = {},
2350
  pumNFController = false;
2351
 
2352
  /** Ninja Forms Support */
2386
  $('.gform_wrapper > form').each(function () {
2387
  var $form = $(this),
2388
  form_id = $form.attr('id').replace('gform_', ''),
2389
+ $settings = $form.find('input.gforms-pum'),
2390
+ settings = $settings.length ? JSON.parse($settings.val()) : false;
2391
 
2392
  if (!settings || typeof settings !== 'object') {
2393
  return;
2398
  })
2399
  /** Gravity Forms Support */
2400
  .on('gform_confirmation_loaded', function (event, form_id) {
2401
+ var $form = $('#gforms_confirmation_message_' + form_id),
2402
  settings = gFormSettings[form_id] || false;
2403
 
2404
  window.PUM.forms.success($form, settings);
2406
  /** Contact Form 7 Support */
2407
  .on('wpcf7:mailsent', '.wpcf7', function (event) {
2408
  var $form = $(event.target),
2409
+ $settings = $form.find('input.wpcf7-pum'),
2410
+ settings = $settings.length ? JSON.parse($settings.val()) : false;
2411
 
2412
  window.PUM.forms.success($form, settings);
2413
  });
assets/js/site.min.js CHANGED
@@ -1,2 +1,2 @@
1
  !function(e){"use strict";void 0===e.fn.on&&(e.fn.on=function(e,t,o){return this.delegate(t,e,o)}),void 0===e.fn.off&&(e.fn.off=function(e,t,o){return this.undelegate(t,e,o)}),void 0===e.fn.bindFirst&&(e.fn.bindFirst=function(t,o){var n,i,p=e(this);p.unbind(t,o),p.bind(t,o),n=e._data(p[0]).events,i=n[t],i.unshift(i.pop()),n[t]=i}),void 0===e.fn.outerHtml&&(e.fn.outerHtml=function(){var t=e(this).clone(),o=e("<div/>").append(t);return o.html()}),void 0===Date.now&&(Date.now=function(){return(new Date).getTime()})}(jQuery);var PUM;!function(e,t,o){"use strict";function n(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))}function i(){var e={},t=function(t,n,i){"boolean"==typeof n&&(i=n,n=!1);var p=n?n.selector+" "+t:t;return(o===e[p]||i)&&(e[p]=n?n.find(t):jQuery(t)),e[p]};return t.elementCache=e,t}function p(e,t){function o(e,t,o){return t?e[t.slice(0,o?-1:t.length)]:e}function n(e,t){return t?t.split("[").reduce(o,e):e}return t.split(".").reduce(n,e)}PUM={get:new i,getPopup:function(t){var o;return o=n(t)?PUM.get("#pum-"+t):"current"===t?PUM.get(".pum-overlay.pum-active:eq(0)",!0):"open"===t?PUM.get(".pum-overlay.pum-active",!0):"closed"===t?PUM.get(".pum-overlay:not(.pum-active)",!0):t instanceof jQuery?t:e(t),o.hasClass("pum-overlay")?o:o.hasClass("popmake")?o.parents(".pum-overlay"):o.parents(".pum-overlay").length?o.parents(".pum-overlay"):e()},open:function(e,t){PUM.getPopup(e).popmake("open",t)},close:function(e,t){PUM.getPopup(e).popmake("close",t)},preventOpen:function(e){PUM.getPopup(e).addClass("preventOpen")},getSettings:function(e){var t=PUM.getPopup(e);return t.popmake("getSettings")},getSetting:function(e,t,n){var i=PUM.getSettings(e),a=p(i,t);return"undefined"!=typeof a?a:n!==o?n:null},checkConditions:function(e){return PUM.getPopup(e).popmake("checkConditions")},getCookie:function(t){return e.pm_cookie(t)},clearCookie:function(t,o){e.pm_remove_cookie(t),"function"==typeof o&&o()},clearCookies:function(t,n){var i,p=PUM.getPopup(t),a=p.popmake("getSettings"),s=a.cookies;if(s!==o&&s.length)for(i=0;s.length>i;i+=1)e.pm_remove_cookie(s[i].settings.name);"function"==typeof n&&n()}},e.fn.popmake=function(o){return e.fn.popmake.methods[o]?(e(t).trigger("pumMethodCall",arguments),e.fn.popmake.methods[o].apply(this,Array.prototype.slice.call(arguments,1))):"object"!=typeof o&&o?void(window.console&&console.warn("Method "+o+" does not exist on $.fn.popmake")):e.fn.popmake.methods.init.apply(this,arguments)},e.fn.popmake.methods={init:function(t){return this.each(function(){var n=PUM.getPopup(this),i=e.extend(!0,{},e.fn.popmake.defaults,n.data("popmake"),t);return i.theme_id<=0&&(i.theme_id=popmake_default_theme),i.meta.display.disable_reposition===o&&e(window).on("resize",function(){(n.hasClass("pum-active")||n.find(".popmake.active").length)&&e.fn.popmake.utilities.throttle(setTimeout(function(){n.popmake("reposition")},25),500,!1)}),n.find(".pum-container").data("popmake",i),n.data("popmake",i).trigger("pumInit"),this})},getOverlay:function(){return e(this)},getContainer:function(){return e(this).find(".pum-container")},getTitle:function(){return e(this).find(".pum-title")||null},getContent:function(){return e(this).find(".pum-content")||null},getClose:function(){return e(this).find(".pum-content + .pum-close")||null},getSettings:function(){return e(this).data("popmake")},state:function(e){var t=PUM.getPopup(this);if(o!==e)switch(e){case"isOpen":return t.hasClass("pum-open")||t.popmake("getContainer").hasClass("active");case"isClosed":return!t.hasClass("pum-open")&&!t.popmake("getContainer").hasClass("active")}},open:function(t){var n=PUM.getPopup(this),i=n.popmake("getContainer"),p=n.popmake("getClose"),a=n.popmake("getSettings"),s=e("html");return n.trigger("pumBeforeOpen"),n.hasClass("preventOpen")||i.hasClass("preventOpen")?(console.log("prevented"),n.removeClass("preventOpen").removeClass("pum-active").trigger("pumOpenPrevented"),this):(a.meta.display.stackable||n.popmake("close_all"),n.addClass("pum-active"),a.meta.close.button_delay>0&&p.fadeOut(0),s.addClass("pum-open"),a.meta.display.overlay_disabled?s.addClass("pum-open-overlay-disabled"):s.addClass("pum-open-overlay"),a.meta.display.position_fixed!==o&&a.meta.display.position_fixed?s.addClass("pum-open-fixed"):s.addClass("pum-open-scrollable"),n.popmake("setup_close").popmake("reposition").css({"z-index":a.meta.display.overlay_zindex||1999999998}).popmake("animate",a.meta.display.animation_type,function(){a.meta.close.button_delay>0&&setTimeout(function(){p.fadeIn()},a.meta.close.button_delay),n.trigger("pumAfterOpen"),e.fn.popmake.last_open_popup=n,t!==o&&t()}),this)},setup_close:function(){var t=PUM.getPopup(this),n=t.popmake("getClose").add(e(".popmake-close",t).not(t.popmake("getClose"))),i=t.popmake("getSettings");return n.off("click.pum").on("click.pum",function(n){var i=e(this),p=i.hasClass("pum-do-default")||i.data("do-default")!==o&&i.data("do-default");p||n.preventDefault(),e.fn.popmake.last_close_trigger="Close Button",t.popmake("close")}),(i.meta.close.esc_press||i.meta.close.f4_press)&&e(window).off("keyup.popmake").on("keyup.popmake",function(o){27===o.keyCode&&i.meta.close.esc_press&&(e.fn.popmake.last_close_trigger="ESC Key",t.popmake("close")),115===o.keyCode&&i.meta.close.f4_press&&(e.fn.popmake.last_close_trigger="F4 Key",t.popmake("close"))}),i.meta.close.overlay_click&&t.off("click.popmake").on("click.popmake",function(o){o.target===t[0]&&(e.fn.popmake.last_close_trigger="Overlay Click",t.popmake("close"))}),t.trigger("pumSetupClose"),this},close:function(t){return this.each(function(){var n=PUM.getPopup(this),i=n.popmake("getContainer"),p=n.popmake("getClose").add(e(".popmake-close",n).not(n.popmake("getClose")));return n.trigger("pumBeforeClose"),n.hasClass("preventClose")||i.hasClass("preventClose")?(n.removeClass("preventClose").trigger("pumClosePrevented"),this):(i.fadeOut("fast",function(){n.is(":visible")&&n.fadeOut("fast"),e(window).off("keyup.popmake"),n.off("click.popmake"),p.off("click.popmake"),1===e(".pum-active").length&&e("html").removeClass("pum-open").removeClass("pum-open-scrollable").removeClass("pum-open-overlay").removeClass("pum-open-overlay-disabled").removeClass("pum-open-fixed"),n.removeClass("pum-active").trigger("pumAfterClose"),i.find("iframe").filter('[src*="youtube"],[src*="vimeo"]').each(function(){var t=e(this),o=t.attr("src"),n=o.replace("autoplay=1","1=1");n!==o&&(o=n),t.prop("src",o)}),i.find("video").each(function(){this.pause()}),t!==o&&t()}),this)})},close_all:function(){return e(".pum-active").popmake("close"),this},reposition:function(t){var o=PUM.getPopup(this).trigger("pumBeforeReposition"),n=o.popmake("getContainer"),i=o.popmake("getSettings"),p=i.meta.display,a=p.location,s={my:"",at:"",of:window,collision:"none",using:"function"==typeof t?t:e.fn.popmake.callbacks.reposition_using},r={overlay:null,container:null},c=null;try{c=e(e.fn.popmake.last_open_trigger)}catch(l){c=e()}return p.position_from_trigger&&c.length?(s.of=c,a.indexOf("left")>=0&&(s.my+=" right",s.at+=" left"+(0!==p.position_left?"-"+p.position_left:"")),a.indexOf("right")>=0&&(s.my+=" left",s.at+=" right"+(0!==p.position_right?"+"+p.position_right:"")),a.indexOf("center")>=0&&(s.my="center"===a?"center":s.my+" center",s.at="center"===a?"center":s.at+" center"),a.indexOf("top")>=0&&(s.my+=" bottom",s.at+=" top"+(0!==p.position_top?"-"+p.position_top:"")),a.indexOf("bottom")>=0&&(s.my+=" top",s.at+=" bottom"+(0!==p.position_bottom?"+"+p.position_bottom:""))):(a.indexOf("left")>=0&&(s.my+=" left"+(0!==p.position_left?"+"+p.position_left:""),s.at+=" left"),a.indexOf("right")>=0&&(s.my+=" right"+(0!==p.position_right?"-"+p.position_right:""),s.at+=" right"),a.indexOf("center")>=0&&(s.my="center"===a?"center":s.my+" center",s.at="center"===a?"center":s.at+" center"),a.indexOf("top")>=0&&(s.my+=" top"+(0!==p.position_top?"+"+(e("body").hasClass("admin-bar")?parseInt(p.position_top,10)+32:p.position_top):""),s.at+=" top"),a.indexOf("bottom")>=0&&(s.my+=" bottom"+(0!==p.position_bottom?"-"+p.position_bottom:""),s.at+=" bottom")),s.my=e.trim(s.my),s.at=e.trim(s.at),o.is(":hidden")&&(r.overlay=o.css("opacity"),o.css({opacity:0}).show(0)),n.is(":hidden")&&(r.container=n.css("opacity"),n.css({opacity:0}).show(0)),p.position_fixed&&n.addClass("fixed"),"custom"===i.meta.display.size?n.css({width:i.meta.display.custom_width+i.meta.display.custom_width_unit,height:i.meta.display.custom_height_auto?"auto":i.meta.display.custom_height+i.meta.display.custom_height_unit}):"auto"!==i.meta.display.size&&n.addClass("responsive").css({minWidth:""!==i.meta.display.responsive_min_width?i.meta.display.responsive_min_width+i.meta.display.responsive_min_width_unit:"auto",maxWidth:""!==i.meta.display.responsive_max_width?i.meta.display.responsive_max_width+i.meta.display.responsive_max_width_unit:"auto"}),o.trigger("pumAfterReposition"),n.addClass("custom-position").position(s).trigger("popmakeAfterReposition"),r.overlay&&o.css({opacity:r.overlay}).hide(0),r.container&&n.css({opacity:r.container}).hide(0),this},retheme:function(t){e(this).trigger("popmakeBeforeRetheme");var n,i,p=PUM.getPopup(this),a=p.popmake("getContainer"),s=p.popmake("getTitle"),r=p.popmake("getContent"),c=p.popmake("getClose"),l=p.popmake("getSettings");switch(t===o&&(t=e.fn.popmake.themes[l.theme_id],t===o&&(t=e.fn.popmake.themes[1])),n="yes"===t.container.boxshadow_inset?"inset ":"",i="yes"===t.close.boxshadow_inset?"inset ":"",p.removeAttr("style").css({backgroundColor:e.fn.popmake.utilities.convert_hex(t.overlay.background_color,t.overlay.background_opacity),zIndex:l.meta.display.overlay_zindex||998}),a.css({padding:t.container.padding+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.container.background_color,t.container.background_opacity),borderStyle:t.container.border_style,borderColor:t.container.border_color,borderWidth:t.container.border_width+"px",borderRadius:t.container.border_radius+"px",boxShadow:n+t.container.boxshadow_horizontal+"px "+t.container.boxshadow_vertical+"px "+t.container.boxshadow_blur+"px "+t.container.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.container.boxshadow_color,t.container.boxshadow_opacity),zIndex:l.meta.display.zindex||999}),s.css({color:t.title.font_color,lineHeight:t.title.line_height+"px",fontSize:t.title.font_size+"px",fontFamily:t.title.font_family,fontWeight:t.title.font_weight,fontStyle:t.title.font_style,textAlign:t.title.text_align,textShadow:t.title.textshadow_horizontal+"px "+t.title.textshadow_vertical+"px "+t.title.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.title.textshadow_color,t.title.textshadow_opacity)}),r.css({color:t.content.font_color,fontFamily:t.content.font_family,fontWeight:t.content.font_weight,fontStyle:t.content.font_style}),e("p, label",r).css({color:t.content.font_color,fontFamily:t.content.font_family}),c.html(t.close.text).css({padding:t.close.padding+"px",height:t.close.height+"px",width:t.close.width+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.close.background_color,t.close.background_opacity),color:t.close.font_color,lineHeight:t.close.line_height+"px",fontSize:t.close.font_size+"px",fontWeight:t.close.font_weight,fontStyle:t.close.font_style,fontFamily:t.close.font_family,borderStyle:t.close.border_style,borderColor:t.close.border_color,borderWidth:t.close.border_width+"px",borderRadius:t.close.border_radius+"px",boxShadow:i+t.close.boxshadow_horizontal+"px "+t.close.boxshadow_vertical+"px "+t.close.boxshadow_blur+"px "+t.close.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.close.boxshadow_color,t.close.boxshadow_opacity),textShadow:t.close.textshadow_horizontal+"px "+t.close.textshadow_vertical+"px "+t.close.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.close.textshadow_color,t.close.textshadow_opacity),left:"auto",right:"auto",bottom:"auto",top:"auto"}),t.close.location){case"topleft":c.css({top:t.close.position_top+"px",left:t.close.position_left+"px"});break;case"topright":c.css({top:t.close.position_top+"px",right:t.close.position_right+"px"});break;case"bottomleft":c.css({bottom:t.close.position_bottom+"px",left:t.close.position_left+"px"});break;case"bottomright":c.css({bottom:t.close.position_bottom+"px",right:t.close.position_right+"px"})}return p.trigger("popmakeAfterRetheme",[t]),this},animation_origin:function(t){var o=PUM.getPopup(this),n=o.popmake("getContainer"),i={my:"",at:""};switch(t){case"top":i={my:"left+"+n.offset().left+" bottom-100",at:"left top"};break;case"bottom":i={my:"left+"+n.offset().left+" top+100",at:"left bottom"};break;case"left":i={my:"right top+"+n.offset().top,at:"left top"};break;case"right":i={my:"left top+"+n.offset().top,at:"right top"};break;default:t.indexOf("left")>=0&&(i={my:i.my+" right",at:i.at+" left"}),t.indexOf("right")>=0&&(i={my:i.my+" left",at:i.at+" right"}),t.indexOf("center")>=0&&(i={my:i.my+" center",at:i.at+" center"}),t.indexOf("top")>=0&&(i={my:i.my+" bottom-100",at:i.at+" top"}),t.indexOf("bottom")>=0&&(i={my:i.my+" top+100",at:i.at+" bottom"}),i.my=e.trim(i.my),i.at=e.trim(i.at)}return i.of=window,i.collision="none",i}}}(jQuery,document);var PUM_Accessibility;!function(e,t,o){"use strict";var n,i,p,a="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]";PUM_Accessibility={forceFocus:function(t){p&&!e.contains(p,t.target)&&(t.stopPropagation(),PUM_Accessibility.setFocusToFirstItem())},trapTabKey:function(t){if(9===t.keyCode){var o=p.find(".pum-container *").filter(a).filter(":visible"),n=e(":focus"),i=o.length,s=o.index(n);t.shiftKey?0===s&&(o.get(i-1).focus(),t.preventDefault()):s===i-1&&(o.get(0).focus(),t.preventDefault())}},setFocusToFirstItem:function(){p.find(".pum-container *").filter(a).filter(":visible").filter(":not(.pum-close)").first().focus()}},e(t).on("pumInit",".pum",function(){PUM.getPopup(this).find("[tabindex]").each(function(){var t=e(this);t.data("tabindex",t.attr("tabindex")).prop("tabindex","0")})}).on("pumBeforeOpen",".pum",function(){var o=PUM.getPopup(this),a=e(":focus");o.has(a).length||(i=a),p=o.on("keydown.pum_accessibility",PUM_Accessibility.trapTabKey).attr("aria-hidden","false"),n=e("body > *").filter(":visible").not(p),n.attr("aria-hidden","true"),e(t).on("focus.pum_accessibility",PUM_Accessibility.forceFocus),PUM_Accessibility.setFocusToFirstItem()}).on("pumAfterOpen",".pum",function(){}).on("pumBeforeClose",".pum",function(){}).on("pumAfterClose",".pum",function(){var a=PUM.getPopup(this);a.off("keydown.pum_accessibility").attr("aria-hidden","true"),n&&(n.attr("aria-hidden","false"),n=null),i!==o&&i.length&&i.focus(),p=null,e(t).off("focus.pum_accessibility")}).on("pumSetupClose",".pum",function(){}).on("pumOpenPrevented",".pum",function(){}).on("pumClosePrevented",".pum",function(){}).on("pumBeforeReposition",".pum",function(){})}(jQuery,document);var PUM_Analytics;!function(e,t,o){"use strict";e.fn.popmake.last_open_trigger=null,e.fn.popmake.last_close_trigger=null,e.fn.popmake.conversion_trigger=null;var n=!("undefined"==typeof pum_vars.restapi||!pum_vars.restapi);PUM_Analytics={beacon:function(t){var o=new Image,i=n?pum_vars.restapi:pum_vars.ajaxurl;t=e.extend(!0,{route:"/analytics/open",type:"open",data:{pid:null,_cache:+new Date},callback:function(){}},t),n?i+=t.route:(t.data.action="pum_analytics",t.data.type=t.type),i&&(e(o).on("error success load done",t.callback),o.src=i+"?"+e.param(t.data))}},pum_vars.disable_open_tracking!==o&&pum_vars.disable_open_tracking||e(t).on("pumAfterOpen.core_analytics","body > .pum",function(){var t=PUM.getPopup(this),o={pid:parseInt(t.popmake("getSettings").id,10)||null};o.pid>0&&!e("body").hasClass("single-popup")&&PUM_Analytics.beacon({data:o})})}(jQuery,document),function(e,t,o){"use strict";e.fn.popmake.methods.animate_overlay=function(t,o,n){var i=PUM.getPopup(this).popmake("getSettings");return i.meta.display.overlay_disabled?e.fn.popmake.overlay_animations.none.apply(this,[o,n]):e.fn.popmake.overlay_animations[t]?e.fn.popmake.overlay_animations[t].apply(this,[o,n]):(window.console&&console.warn("Animation style "+t+" does not exist."),this)},e.fn.popmake.methods.animate=function(t){return e.fn.popmake.animations[t]?e.fn.popmake.animations[t].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Animation style "+t+" does not exist."),this)},e.fn.popmake.animations={none:function(e){var t=PUM.getPopup(this);return t.popmake("getContainer").show(0),t.popmake("animate_overlay","none",0,function(){e!==o&&e()}),this},slide:function(e){var t=PUM.getPopup(this).show(0).css({opacity:0}),n=t.popmake("getContainer").show(0).css({opacity:0}),i=t.popmake("getSettings"),p=i.meta.display.animation_speed/2,a=t.popmake("animation_origin",i.meta.display.animation_origin);return n.position(a).css({opacity:1}),t.css({opacity:1}).popmake("animate_overlay","fade",p,function(){n.popmake("reposition",function(t){n.animate(t,p,"swing",function(){e!==o&&e()})})}),this},fade:function(e){var t=PUM.getPopup(this),n=t.popmake("getContainer"),i=t.popmake("getSettings"),p=i.meta.display.animation_speed/2;return n.show(0).css({opacity:0}),t.popmake("animate_overlay","fade",p,function(){n.animate({opacity:1},p,"swing",function(){e!==o&&e()})}),this},fadeAndSlide:function(e){var t=PUM.getPopup(this).show(0).css({opacity:0}),n=t.popmake("getContainer").show(0).css({opacity:0}),i=t.popmake("getSettings"),p=i.meta.display.animation_speed/2,a=t.popmake("animation_origin",i.meta.display.animation_origin);return n.position(a),t.hide().css({opacity:1}).popmake("animate_overlay","fade",p,function(){n.popmake("reposition",function(t){t.opacity=1,n.animate(t,p,"swing",function(){e!==o&&e()})})}),this},grow:function(t){return e.fn.popmake.animations.fade.apply(this,arguments)},growAndSlide:function(t){return e.fn.popmake.animations.fadeAndSlide.apply(this,arguments)}},e.fn.popmake.overlay_animations={none:function(e,t){PUM.getPopup(this).show(e,t)},fade:function(e,t){PUM.getPopup(this).fadeIn(e,t)},slide:function(e,t){PUM.getPopup(this).slideDown(e,t)}}}(jQuery,document),function(e,t,o){"use strict";e(t).on("pumInit",".pum",function(){e(this).popmake("getContainer").trigger("popmakeInit")}).on("pumBeforeOpen",".pum",function(){e(this).popmake("getContainer").addClass("active").trigger("popmakeBeforeOpen")}).on("pumAfterOpen",".pum",function(){e(this).popmake("getContainer").trigger("popmakeAfterOpen")}).on("pumBeforeClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeClose")}).on("pumAfterClose",".pum",function(){e(this).popmake("getContainer").removeClass("active").trigger("popmakeAfterClose")}).on("pumSetupClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeSetupClose")}).on("pumOpenPrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventOpen").removeClass("active")}).on("pumClosePrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventClose")}).on("pumBeforeReposition",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeReposition")})}(jQuery,document),function(e,t,o){"use strict";e.fn.popmake.callbacks={reposition_using:function(t){e(this).css(t)}}}(jQuery,document),function(e,t,o){"use strict";var n;e.extend(e.fn.popmake.methods,{checkConditions:function(){var t,i,p,a,s,r=PUM.getPopup(this),c=r.popmake("getSettings"),l=!0;if(c.mobile_disabled!==o&&c.mobile_disabled&&("object"!=typeof n&&(n=new MobileDetect(window.navigator.userAgent)),n.phone()))return!1;if(c.tablet_disabled!==o&&c.tablet_disabled&&("object"!=typeof n&&(n=new MobileDetect(window.navigator.userAgent)),n.tablet()))return!1;if(c.conditions!==o&&c.conditions.length)for(i=0;c.conditions.length>i;i++){for(a=c.conditions[i],t=!1,p=0;a.length>p&&(s=e.extend({},{not_operand:!1},a[p]),!s.not_operand&&r.popmake("checkCondition",s)?t=!0:s.not_operand&&!r.popmake("checkCondition",s)&&(t=!0),e(this).trigger("pumCheckingCondition",[t,s]),!t);p++);t||(l=!1)}return l},checkCondition:function(t){var o=t.target||null;return o?e.fn.popmake.conditions[o]?e.fn.popmake.conditions[o].apply(this,[t]):window.console?(console.warn("Condition "+o+" does not exist."),!0):void 0:(console.warn("Condition type not set."),!1)}}),e.fn.popmake.conditions={device_is_mobile:function(e){return n.mobile()}}}(jQuery,document);var pm_cookie,pm_cookie_json,pm_remove_cookie;!function(e){"use strict";function t(t){function o(n,i,p){var a,s=new Date;if("undefined"!=typeof document){if(arguments.length>1){switch(p=e.extend({path:"/"},o.defaults,p),typeof p.expires){case"number":s.setMilliseconds(s.getMilliseconds()+864e5*p.expires),p.expires=s;break;case"string":s.setTime(1e3*e.fn.popmake.utilities.strtotime("+"+p.expires)),p.expires=s}try{a=JSON.stringify(i),/^[\{\[]/.test(a)&&(i=a)}catch(r){}return i=t.write?t.write(i,n):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)),n=n.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),n=n.replace(/[\(\)]/g,escape),document.cookie=[n,"=",i,p.expires?"; expires="+p.expires.toUTCString():"",p.path?"; path="+p.path:"",p.domain?"; domain="+p.domain:"",p.secure?"; secure":""].join("")}n||(a={});for(var c=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,u=0;u<c.length;u++){var m=c[u].split("="),d=m.slice(1).join("=");'"'===d.charAt(0)&&(d=d.slice(1,-1));try{var f=m[0].replace(l,decodeURIComponent);if(d=t.read?t.read(d,f):t(d,f)||d.replace(l,decodeURIComponent),this.json)try{d=JSON.parse(d)}catch(r){}if(n===f){a=d;break}n||(a[f]=d)}catch(r){}}return a}}return void 0===t&&(t=function(){}),o.set=o,o.get=function(e){return o.call(o,e)},o.getJSON=function(){return o.apply({json:!0},[].slice.call(arguments))},o.defaults={},o.remove=function(t,n){o(t,"",e.extend({},n,{expires:-1,path:""})),o(t,"",e.extend({},n,{expires:-1}))},o.process=function(e,t,n,i){return arguments.length>3&&"object"!=typeof arguments[2]&&void 0!==t?o.apply(o,[e,t,{expires:n,path:i}]):o.apply(o,[].slice.call(arguments,[0,2]))},o.withConverter=e.fn.popmake.cookie,o}e.extend(e.fn.popmake,{cookie:t()}),pm_cookie=e.pm_cookie=e.fn.popmake.cookie.process,pm_cookie_json=e.pm_cookie_json=e.fn.popmake.cookie.getJSON,pm_remove_cookie=e.pm_remove_cookie=e.fn.popmake.cookie.remove}(jQuery),function(e,t,o){"use strict";e.extend(e.fn.popmake.methods,{addCookie:function(t){return pum.hooks.doAction("popmake.addCookie",arguments),e.fn.popmake.cookies[t]?e.fn.popmake.cookies[t].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Cookie type "+t+" does not exist."),this)},setCookie:function(t){e.pm_cookie(t.name,!0,t.session?null:t.time,t.path?"/":null),pum.hooks.doAction("popmake.setCookie",t)},checkCookies:function(t){var n,i=!1;if(t.cookie===o||t.cookie.name===o||null===t.cookie.name)return!1;switch(typeof t.cookie.name){case"object":case"array":for(n=0;t.cookie.name.length>n;n+=1)e.pm_cookie(t.cookie.name[n])!==o&&(i=!0);break;case"string":e.pm_cookie(t.cookie.name)!==o&&(i=!0)}return pum.hooks.doAction("popmake.checkCookies",t,i),i}}),e.fn.popmake.cookies=e.fn.popmake.cookies||{},e.extend(e.fn.popmake.cookies,{on_popup_open:function(e){var t=PUM.getPopup(this);t.on("pumAfterOpen",function(){t.popmake("setCookie",e)})},on_popup_close:function(e){var t=PUM.getPopup(this);t.on("pumBeforeClose",function(){t.popmake("setCookie",e)})},manual:function(e){var t=PUM.getPopup(this);t.on("pumSetCookie",function(){t.popmake("setCookie",e)})},form_success:function(e){var t=PUM.getPopup(this);t.on("pumFormSuccess",function(){t.popmake("setCookie",e)})},ninja_form_success:function(t){return e.fn.popmake.cookies.form_success.apply(this,arguments)},cf7_form_success:function(t){return e.fn.popmake.cookies.form_success.apply(this,arguments)},gforms_form_success:function(t){return e.fn.popmake.cookies.form_success.apply(this,arguments)}}),e(t).on("pumInit",".pum",function(){var e,t=PUM.getPopup(this),n=t.popmake("getSettings"),i=n.cookies,p=null;if(i!==o&&i.length)for(e=0;i.length>e;e+=1)p=i[e],t.popmake("addCookie",p.event,p.settings)})}(jQuery,document);var pum_debug_mode=!1,pum_debug;!function(e,t){if(t=window.pum_vars||{debug_mode:!1},pum_debug_mode=void 0!==t.debug_mode&&t.debug_mode,pum_debug_mode||window.location.href.indexOf("pum_debug")===-1||(pum_debug_mode=!0),pum_debug_mode){var o=!1,n=!1,i=window.pum_debug_vars||{};pum_debug={odump:function(t){return e.extend({},t)},logo:function(){console.log(" -------------------------------------------------------------\n| ____ __ __ _ |\n| | _ \\ ___ _ __ _ _ _ __ | \\/ | __ _| | _____ _ __ |\n| | |_) / _ \\| '_ \\| | | | '_ \\ | |\\/| |/ _` | |/ / _ \\ '__| |\n| | __/ (_) | |_) | |_| | |_) | | | | | (_| | < __/ | |\n| |_| \\___/| .__/ \\__,_| .__/ |_| |_|\\__,_|_|\\_\\___|_| |\n| |_| |_| |\n -------------------------------------------------------------")},initialize:function(){o=!0,pum_debug.logo(),console.debug(i.debug_mode_enabled),console.log(i.debug_started_at,new Date),console.info(i.debug_more_info),pum_debug.divider(i.global_info),console.groupCollapsed(i.localized_vars),console.log("pum_vars:",pum_debug.odump(t)),e(document).trigger("pum_debug_initialize_localized_vars"),console.groupEnd(),e(document).trigger("pum_debug_initialize")},popup_event_header:function(e){var t=e.popmake("getSettings");n!==t.id&&(n=t.id,pum_debug.divider(i.single_popup_label+t.id+" - "+t.slug))},divider:function(e){var t=62,o=62,n=0,i=" "+new Array(t+1).join("-")+" ";"string"==typeof e?(o=t-e.length,n={left:Math.floor(o/2),right:Math.floor(o/2)},n.left+n.right===o-1&&n.right++,n.left=new Array(n.left+1).join(" "),n.right=new Array(n.right+1).join(" "),console.log(""+i+"\n|"+n.left+e+n.right+"|\n"+i)):console.log(i)},click_trigger:function(e,t){var o,n=e.popmake("getSettings"),p=[".popmake-"+n.id,".popmake-"+decodeURIComponent(n.slug),'a[href$="#popmake-'+n.id+'"]'];t.extra_selectors&&""!==t.extra_selectors&&p.push(t.extra_selectors),p=pum.hooks.applyFilters("pum.trigger.click_open.selectors",p,t,e),o=p.join(", "),console.log(i.label_selector,o)},trigger:function(t,o){switch(console.groupCollapsed(i.triggers[o.type].name),o.type){case"auto_open":console.log(i.label_delay,o.settings.delay),console.log(i.label_cookie,o.settings.cookie.name);break;case"click_open":pum_debug.click_trigger(t,o.settings),console.log(i.label_cookie,o.settings.cookie.name)}e(document).trigger("pum_debug_render_trigger",t,o),console.groupEnd()},cookie:function(t,o){if("object"==typeof i.cookies[o.event]){switch(console.groupCollapsed(i.cookies[o.event].name),o.event){case"on_popup_open":case"on_popup_close":case"manual":case"ninja_form_success":console.log(i.label_settings,pum_debug.odump(o.settings))}e(document).trigger("pum_debug_render_trigger",t,o),console.groupEnd()}}},e(document).on("pumInit",".pum",function(){var t=PUM.getPopup(e(this)),n=t.popmake("getSettings"),p=0;if(o||(pum_debug.initialize(),pum_debug.divider(i.popups_initializing)),console.groupCollapsed(i.single_popup_label+n.id+" - "+n.slug),console.log(i.theme_id,n.theme_id),void 0!==n.triggers&&n.triggers.length){for(console.groupCollapsed(i.label_triggers),p=0;n.triggers.length>p;p++)pum_debug.trigger(t,n.triggers[p]);console.groupEnd()}if(void 0!==n.cookies&&n.cookies.length){for(console.groupCollapsed(i.label_cookies),p=0;n.cookies.length>p;p+=1)pum_debug.cookie(t,n.cookies[p]);console.groupEnd()}void 0!==n.conditions&&n.conditions.length&&(console.groupCollapsed(i.label_conditions),console.log(n.conditions),console.groupEnd()),console.groupCollapsed(i.label_popup_settings),console.log(i.label_mobile_disabled,null!==n.mobile_disabled),console.log(i.label_tablet_disabled,null!==n.tablet_disabled),console.log(i.label_display_settings,pum_debug.odump(n.meta.display)),console.log(i.label_close_settings,pum_debug.odump(n.meta.close)),t.trigger("pum_debug_popup_settings");var a=pum.hooks.applyFilters("pum_debug.popup_settings.cleaned_meta",pum_debug.odump(n.meta),t);delete a.display,delete a.close,delete a.click_open,a.length&&console.log("Meta: ",a),console.groupEnd(),console.groupEnd()}).on("pumBeforeOpen",".pum",function(){var t=PUM.getPopup(e(this)),o=(t.popmake("getSettings"),e.fn.popmake.last_open_trigger);pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_before_open);try{o=e(e.fn.popmake.last_open_trigger),o=o.length?o:e.fn.popmake.last_open_trigger.toString()}catch(n){o=""}finally{console.log(i.label_triggers,[o])}console.groupEnd()}).on("pumOpenPrevented",".pum",function(){var t=PUM.getPopup(e(this));pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_open_prevented),console.groupEnd()}).on("pumAfterOpen",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_after_open),console.groupEnd()}).on("pumSetupClose",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_setup_close),console.groupEnd()}).on("pumClosePrevented",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_close_prevented),console.groupEnd()}).on("pumBeforeClose",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_before_close),console.groupEnd()}).on("pumAfterClose",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_after_close),console.groupEnd()}).on("pumBeforeReposition",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_before_reposition),console.groupEnd()}).on("pumAfterReposition",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_after_reposition),console.groupEnd()}).on("pumCheckingCondition",".pum",function(t,o,n){var p=PUM.getPopup(e(this));p.popmake("getSettings");pum_debug.popup_event_header(p),console.groupCollapsed(i.label_event_checking_condition),console.log((n.not_operand?"(!) ":"")+n.target+": "+o,n),console.groupEnd()})}}(jQuery),function(e,t,o){"use strict";e.fn.popmake.defaults={meta:{display:{stackable:0,overlay_disabled:0,size:"medium",responsive_max_width:"",responsive_max_width_unit:"%",responsive_min_width:"",responsive_min_width_unit:"%",custom_width:"",custom_width_unit:"%",custom_height:"",custom_height_unit:"em",custom_height_auto:0,location:"center top",position_top:100,position_left:0,position_bottom:0,position_right:0,position_fixed:0,animation_type:"fade",animation_speed:350,animation_origin:"center top"},close:{overlay_click:0,esc_press:0,f4_press:0}},container:{active_class:"active",attr:{"class":"popmake"}},title:{attr:{"class":"popmake-title"}},content:{attr:{"class":"popmake-content"}},close:{close_speed:0,attr:{"class":"popmake-close"}},overlay:{attr:{id:"popmake-overlay","class":"popmake-overlay"}}}}(jQuery,document),function(e){"use strict";var t={openpopup:!1,openpopup_id:0,closepopup:!1,closedelay:0};window.PUM=window.PUM||{},window.PUM.forms=window.PUM.forms||{},window.PUM.forms.success=function(o,n){if(n=e.extend({},t,n)){var i=o.parents(".pum"),p=function(){n.openpopup&&PUM.getPopup(n.openpopup_id).length&&PUM.open(n.openpopup_id)};i.length&&i.trigger("pumFormSuccess"),i.length&&n.closepopup?setTimeout(function(){i.popmake("close",p)},parseInt(n.closedelay)):p()}}}(jQuery),function(e,t){"use strict";var o=function(){function e(e,t,o,n){return"string"==typeof e&&"function"==typeof t&&(o=parseInt(o||10,10),s("actions",e,t,o,n)),
2
- u}function t(){var e=l.call(arguments),t=e.shift();return"string"==typeof t&&c("actions",t,e),u}function o(e,t){return"string"==typeof e&&a("actions",e,t),u}function n(e,t,o,n){return"string"==typeof e&&"function"==typeof t&&(o=parseInt(o||10,10),s("filters",e,t,o,n)),u}function i(){var e=l.call(arguments),t=e.shift();return"string"==typeof t?c("filters",t,e):u}function p(e,t){return"string"==typeof e&&a("filters",e,t),u}function a(e,t,o,n){var i,p,a;if(m[e][t])if(o)if(i=m[e][t],n)for(a=i.length;a--;)p=i[a],p.callback===o&&p.context===n&&i.splice(a,1);else for(a=i.length;a--;)i[a].callback===o&&i.splice(a,1);else m[e][t]=[]}function s(e,t,o,n,i){var p={callback:o,priority:n,context:i},a=m[e][t];a?(a.push(p),a=r(a)):a=[p],m[e][t]=a}function r(e){for(var t,o,n,i=1,p=e.length;i<p;i++){for(t=e[i],o=i;(n=e[o-1])&&n.priority>t.priority;)e[o]=e[o-1],--o;e[o]=t}return e}function c(e,t,o){var n,i,p=m[e][t];if(!p)return"filters"===e&&o[0];if(i=p.length,"filters"===e)for(n=0;n<i;n++)o[0]=p[n].callback.apply(p[n].context,o);else for(n=0;n<i;n++)p[n].callback.apply(p[n].context,o);return"filters"!==e||o[0]}var l=Array.prototype.slice,u={removeFilter:p,applyFilters:i,addFilter:n,removeAction:o,doAction:t,addAction:e},m={actions:{},filters:{}};return u};e.pum=e.pum||{},e.pum.hooks=e.pum.hooks||new o}(window),function(e){"use strict";var t={},o=!1;"undefined"==typeof Marionette&&"undefined"==typeof nfRadio||(o=Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("forms"),"submit:response",this.popupMaker)},popupMaker:function(t,o,n,i){var p=e("#nf-form-"+i+"-cont"),a={};t.errors.length||("undefined"!=typeof t.data.actions&&(a.openpopup="undefined"!=typeof t.data.actions.openpopup,a.openpopup_id=a.openpopup?parseInt(t.data.actions.openpopup):0,a.closepopup="undefined"!=typeof t.data.actions.closepopup,a.closedelay=a.closepopup?parseInt(t.data.actions.closepopup):0),window.PUM.forms.success(p,a))}})),e(document).ready(function(){o!==!1&&new o,e(".gform_wrapper > form").each(function(){var o=e(this),n=o.attr("id").replace("gform_",""),i=o.find('meta[name="gforms-pum"]'),p=!!i.length&&JSON.parse(i.attr("content"));p&&"object"==typeof p&&(t[n]=p)})}).on("gform_confirmation_loaded",function(o,n){var i=e("#gform_"+n),p=t[n]||!1;window.PUM.forms.success(i,p)}).on("wpcf7:mailsent",".wpcf7",function(t){var o=e(t.target),n=o.find('meta[name="wpcf7-pum"]'),i=!!n.length&&JSON.parse(n.attr("content"));window.PUM.forms.success(o,i)})}(jQuery),function(e,t,o){"use strict";e.extend(e.fn.popmake.methods,{addTrigger:function(t){return e.fn.popmake.triggers[t]?e.fn.popmake.triggers[t].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Trigger type "+t+" does not exist."),this)}}),e.fn.popmake.triggers={auto_open:function(t){var o=PUM.getPopup(this);setTimeout(function(){o.popmake("state","isOpen")||!o.popmake("checkCookies",t)&&o.popmake("checkConditions")&&(e.fn.popmake.last_open_trigger="Auto Open - Delay: "+t.delay,o.popmake("open"))},t.delay)},click_open:function(o){var n,i=PUM.getPopup(this),p=i.popmake("getSettings"),a=[".popmake-"+p.id,".popmake-"+decodeURIComponent(p.slug),'a[href$="#popmake-'+p.id+'"]'];o.extra_selectors&&""!==o.extra_selectors&&a.push(o.extra_selectors),a=pum.hooks.applyFilters("pum.trigger.click_open.selectors",a,o,i),n=a.join(", "),e(n).addClass("pum-trigger").css({cursor:"pointer"}),e(t).on("click.pumTrigger",n,function(t){var n=e(this),p=o.do_default||!1;i.has(n).length>0||i.popmake("state","isOpen")||!i.popmake("checkCookies",o)&&i.popmake("checkConditions")&&(n.data("do-default")?p=n.data("do-default"):(n.hasClass("do-default")||n.hasClass("popmake-do-default")||n.hasClass("pum-do-default"))&&(p=!0),t.ctrlKey||pum.hooks.applyFilters("pum.trigger.click_open.do_default",p,i,n)||(t.preventDefault(),t.stopPropagation()),e.fn.popmake.last_open_trigger=n,i.popmake("open"))})},admin_debug:function(){PUM.getPopup(this).popmake("open")}},e(t).on("pumInit",".pum",function(){var e,t=PUM.getPopup(this),n=t.popmake("getSettings"),i=n.triggers,p=null;if(i!==o&&i.length)for(e=0;i.length>e;e+=1)p=i[e],t.popmake("addTrigger",p.type,p.settings)})}(jQuery,document),function(e,t,o){"use strict";function n(t,o){return e.inArray(o,t)!==-1}function i(e,t,o){var n=t[0];t.length>1?(e[n]||(e[n]=t[1]?{}:[]),i(e[n],t.slice(1),o)):(n||(n=e.length),e[n]=o)}var p="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),a="select,textarea".split(","),s=/\[([^\]]*)\]/g;e.fn.popmake.utilities={convert_hex:function(e,t){e=e.replace("#","");var o=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16);return"rgba("+o+","+n+","+i+","+t/100+")"},debounce:function(e,t){var o;return function(){var n=this,i=arguments;window.clearTimeout(o),o=window.setTimeout(function(){e.apply(n,i)},t)}},throttle:function(e,t){var o=!1,n=function(){o=!1};return function(){o||(e.apply(this,arguments),window.setTimeout(n,t),o=!0)}},getXPath:function(t){var o,n,i,p,a,s=[];return e.each(e(t).parents(),function(t,r){return o=e(r),n=o.attr("id")||"",i=o.attr("class")||"",p=o.get(0).tagName.toLowerCase(),a=o.parent().children(p).index(o),"body"!==p&&(i.length>0&&(i=i.split(" "),i=i[0]),void s.push(p+(n.length>0?"#"+n:i.length>0?"."+i.split(" ").join("."):":eq("+a+")")))}),s.reverse().join(" > ")},strtotime:function(e,t){function n(e,t,n){var i,p=l[t];p!==o&&(i=p-c.getDay(),0===i?i=7*n:i>0&&"last"===e?i-=7:i<0&&"next"===e&&(i+=7),c.setDate(c.getDate()+i))}function i(e){var t=e.split(" "),o=t[0],i=t[1].substring(0,3),p=/\d+/.test(o),a="ago"===t[2],s=("last"===o?-1:1)*(a?-1:1);if(p&&(s*=parseInt(o,10)),u.hasOwnProperty(i)&&!t[1].match(/^mon(day|\.)?$/i))return c["set"+u[i]](c["get"+u[i]]()+s);if("wee"===i)return c.setDate(c.getDate()+7*s);if("next"===o||"last"===o)n(o,i,s);else if(!p)return!1;return!0}var p,a,s,r,c,l,u,m,d,f,g,_=!1;if(!e)return _;if(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase(),a=e.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/),a&&a[2]===a[4])if(a[1]>1901)switch(a[2]){case"-":return a[3]>12||a[5]>31?_:new Date(a[1],parseInt(a[3],10)-1,a[5],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3;case".":return _;case"/":return a[3]>12||a[5]>31?_:new Date(a[1],parseInt(a[3],10)-1,a[5],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3}else if(a[5]>1901)switch(a[2]){case"-":return a[3]>12||a[1]>31?_:new Date(a[5],parseInt(a[3],10)-1,a[1],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3;case".":return a[3]>12||a[1]>31?_:new Date(a[5],parseInt(a[3],10)-1,a[1],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3;case"/":return a[1]>12||a[3]>31?_:new Date(a[5],parseInt(a[1],10)-1,a[3],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3}else switch(a[2]){case"-":return a[3]>12||a[5]>31||a[1]<70&&a[1]>38?_:(r=a[1]>=0&&a[1]<=38?+a[1]+2e3:a[1],new Date(r,parseInt(a[3],10)-1,a[5],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3);case".":return a[5]>=70?a[3]>12||a[1]>31?_:new Date(a[5],parseInt(a[3],10)-1,a[1],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3:a[5]<60&&!a[6]?a[1]>23||a[3]>59?_:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),a[1]||0,a[3]||0,a[5]||0,a[9]||0)/1e3):_;case"/":return a[1]>12||a[3]>31||a[5]<70&&a[5]>38?_:(r=a[5]>=0&&a[5]<=38?+a[5]+2e3:a[5],new Date(r,parseInt(a[1],10)-1,a[3],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3);case":":return a[1]>23||a[3]>59||a[5]>59?_:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),a[1]||0,a[3]||0,a[5]||0)/1e3)}if("now"===e)return null===t||isNaN(t)?(new Date).getTime()/1e3||0:t||0;if(p=Date.parse(e),!isNaN(p))return p/1e3||0;if(c=t?new Date(1e3*t):new Date,l={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},u={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},d="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)",f="([+-]?\\d+\\s"+d+"|(last|next)\\s"+d+")(\\sago)?",a=e.match(new RegExp(f,"gi")),!a)return _;for(g=0,m=a.length;g<m;g+=1)if(!i(a[g]))return _;return c.getTime()/1e3},serializeObject:function(t){e.extend({},t);var o={},r=e.extend(!0,{include:[],exclude:[],includeByClass:""},t);return this.find(":input").each(function(){var t;!this.name||this.disabled||n(r.exclude,this.name)||r.include.length&&!n(r.include,this.name)||this.className.indexOf(r.includeByClass)===-1||(t=this.name.replace(s,"[$1").split("["),t[0]&&(this.checked||n(p,this.type)||n(a,this.nodeName.toLowerCase()))&&("checkbox"===this.type&&t.push(""),i(o,t,e(this).val())))}),o}},e.fn.pumSerializeObject=e.fn.popmake.utilities.serializeObject,e.fn.popmake.utilies=e.fn.popmake.utilities}(jQuery,document),function(e,t,o){"use strict";e.fn.popmake.version=1.4,e.fn.popmake.last_open_popup=null,e(t).ready(function(){e(".popmake").popmake()})}(jQuery);
1
  !function(e){"use strict";void 0===e.fn.on&&(e.fn.on=function(e,t,o){return this.delegate(t,e,o)}),void 0===e.fn.off&&(e.fn.off=function(e,t,o){return this.undelegate(t,e,o)}),void 0===e.fn.bindFirst&&(e.fn.bindFirst=function(t,o){var n,i,p=e(this);p.unbind(t,o),p.bind(t,o),n=e._data(p[0]).events,i=n[t],i.unshift(i.pop()),n[t]=i}),void 0===e.fn.outerHtml&&(e.fn.outerHtml=function(){var t=e(this).clone(),o=e("<div/>").append(t);return o.html()}),void 0===Date.now&&(Date.now=function(){return(new Date).getTime()})}(jQuery);var PUM;!function(e,t,o){"use strict";function n(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))}function i(){var e={},t=function(t,n,i){"boolean"==typeof n&&(i=n,n=!1);var p=n?n.selector+" "+t:t;return(o===e[p]||i)&&(e[p]=n?n.find(t):jQuery(t)),e[p]};return t.elementCache=e,t}function p(e,t){function o(e,t,o){return t?e[t.slice(0,o?-1:t.length)]:e}function n(e,t){return t?t.split("[").reduce(o,e):e}return t.split(".").reduce(n,e)}PUM={get:new i,getPopup:function(t){var o;return o=n(t)?PUM.get("#pum-"+t):"current"===t?PUM.get(".pum-overlay.pum-active:eq(0)",!0):"open"===t?PUM.get(".pum-overlay.pum-active",!0):"closed"===t?PUM.get(".pum-overlay:not(.pum-active)",!0):t instanceof jQuery?t:e(t),o.hasClass("pum-overlay")?o:o.hasClass("popmake")?o.parents(".pum-overlay"):o.parents(".pum-overlay").length?o.parents(".pum-overlay"):e()},open:function(e,t){PUM.getPopup(e).popmake("open",t)},close:function(e,t){PUM.getPopup(e).popmake("close",t)},preventOpen:function(e){PUM.getPopup(e).addClass("preventOpen")},getSettings:function(e){var t=PUM.getPopup(e);return t.popmake("getSettings")},getSetting:function(e,t,n){var i=PUM.getSettings(e),a=p(i,t);return"undefined"!=typeof a?a:n!==o?n:null},checkConditions:function(e){return PUM.getPopup(e).popmake("checkConditions")},getCookie:function(t){return e.pm_cookie(t)},clearCookie:function(t,o){e.pm_remove_cookie(t),"function"==typeof o&&o()},clearCookies:function(t,n){var i,p=PUM.getPopup(t),a=p.popmake("getSettings"),s=a.cookies;if(s!==o&&s.length)for(i=0;s.length>i;i+=1)e.pm_remove_cookie(s[i].settings.name);"function"==typeof n&&n()}},e.fn.popmake=function(o){return e.fn.popmake.methods[o]?(e(t).trigger("pumMethodCall",arguments),e.fn.popmake.methods[o].apply(this,Array.prototype.slice.call(arguments,1))):"object"!=typeof o&&o?void(window.console&&console.warn("Method "+o+" does not exist on $.fn.popmake")):e.fn.popmake.methods.init.apply(this,arguments)},e.fn.popmake.methods={init:function(t){return this.each(function(){var n=PUM.getPopup(this),i=e.extend(!0,{},e.fn.popmake.defaults,n.data("popmake"),t);return i.theme_id<=0&&(i.theme_id=popmake_default_theme),i.meta.display.disable_reposition===o&&e(window).on("resize",function(){(n.hasClass("pum-active")||n.find(".popmake.active").length)&&e.fn.popmake.utilities.throttle(setTimeout(function(){n.popmake("reposition")},25),500,!1)}),n.find(".pum-container").data("popmake",i),n.data("popmake",i).trigger("pumInit"),this})},getOverlay:function(){return e(this)},getContainer:function(){return e(this).find(".pum-container")},getTitle:function(){return e(this).find(".pum-title")||null},getContent:function(){return e(this).find(".pum-content")||null},getClose:function(){return e(this).find(".pum-content + .pum-close")||null},getSettings:function(){return e(this).data("popmake")},state:function(e){var t=PUM.getPopup(this);if(o!==e)switch(e){case"isOpen":return t.hasClass("pum-open")||t.popmake("getContainer").hasClass("active");case"isClosed":return!t.hasClass("pum-open")&&!t.popmake("getContainer").hasClass("active")}},open:function(t){var n=PUM.getPopup(this),i=n.popmake("getContainer"),p=n.popmake("getClose"),a=n.popmake("getSettings"),s=e("html");return n.trigger("pumBeforeOpen"),n.hasClass("preventOpen")||i.hasClass("preventOpen")?(console.log("prevented"),n.removeClass("preventOpen").removeClass("pum-active").trigger("pumOpenPrevented"),this):(a.meta.display.stackable||n.popmake("close_all"),n.addClass("pum-active"),a.meta.close.button_delay>0&&p.fadeOut(0),s.addClass("pum-open"),a.meta.display.overlay_disabled?s.addClass("pum-open-overlay-disabled"):s.addClass("pum-open-overlay"),a.meta.display.position_fixed!==o&&a.meta.display.position_fixed?s.addClass("pum-open-fixed"):s.addClass("pum-open-scrollable"),n.popmake("setup_close").popmake("reposition").css({"z-index":a.meta.display.overlay_zindex||1999999998}).popmake("animate",a.meta.display.animation_type,function(){a.meta.close.button_delay>0&&setTimeout(function(){p.fadeIn()},a.meta.close.button_delay),n.trigger("pumAfterOpen"),e.fn.popmake.last_open_popup=n,t!==o&&t()}),this)},setup_close:function(){var t=PUM.getPopup(this),n=t.popmake("getClose").add(e(".popmake-close",t).not(t.popmake("getClose"))),i=t.popmake("getSettings");return n.off("click.pum").on("click.pum",function(n){var i=e(this),p=i.hasClass("pum-do-default")||i.data("do-default")!==o&&i.data("do-default");p||n.preventDefault(),e.fn.popmake.last_close_trigger="Close Button",t.popmake("close")}),(i.meta.close.esc_press||i.meta.close.f4_press)&&e(window).off("keyup.popmake").on("keyup.popmake",function(o){27===o.keyCode&&i.meta.close.esc_press&&(e.fn.popmake.last_close_trigger="ESC Key",t.popmake("close")),115===o.keyCode&&i.meta.close.f4_press&&(e.fn.popmake.last_close_trigger="F4 Key",t.popmake("close"))}),i.meta.close.overlay_click&&t.off("click.popmake").on("click.popmake",function(o){o.target===t[0]&&(e.fn.popmake.last_close_trigger="Overlay Click",t.popmake("close"))}),t.trigger("pumSetupClose"),this},close:function(t){return this.each(function(){var n=PUM.getPopup(this),i=n.popmake("getContainer"),p=n.popmake("getClose").add(e(".popmake-close",n).not(n.popmake("getClose")));return n.trigger("pumBeforeClose"),n.hasClass("preventClose")||i.hasClass("preventClose")?(n.removeClass("preventClose").trigger("pumClosePrevented"),this):(i.fadeOut("fast",function(){n.is(":visible")&&n.fadeOut("fast"),e(window).off("keyup.popmake"),n.off("click.popmake"),p.off("click.popmake"),1===e(".pum-active").length&&e("html").removeClass("pum-open").removeClass("pum-open-scrollable").removeClass("pum-open-overlay").removeClass("pum-open-overlay-disabled").removeClass("pum-open-fixed"),n.removeClass("pum-active").trigger("pumAfterClose"),i.find("iframe").filter('[src*="youtube"],[src*="vimeo"]').each(function(){var t=e(this),o=t.attr("src"),n=o.replace("autoplay=1","1=1");n!==o&&(o=n),t.prop("src",o)}),i.find("video").each(function(){this.pause()}),t!==o&&t()}),this)})},close_all:function(){return e(".pum-active").popmake("close"),this},reposition:function(t){var o=PUM.getPopup(this).trigger("pumBeforeReposition"),n=o.popmake("getContainer"),i=o.popmake("getSettings"),p=i.meta.display,a=p.location,s={my:"",at:"",of:window,collision:"none",using:"function"==typeof t?t:e.fn.popmake.callbacks.reposition_using},r={overlay:null,container:null},c=null;try{c=e(e.fn.popmake.last_open_trigger)}catch(l){c=e()}return p.position_from_trigger&&c.length?(s.of=c,a.indexOf("left")>=0&&(s.my+=" right",s.at+=" left"+(0!==p.position_left?"-"+p.position_left:"")),a.indexOf("right")>=0&&(s.my+=" left",s.at+=" right"+(0!==p.position_right?"+"+p.position_right:"")),a.indexOf("center")>=0&&(s.my="center"===a?"center":s.my+" center",s.at="center"===a?"center":s.at+" center"),a.indexOf("top")>=0&&(s.my+=" bottom",s.at+=" top"+(0!==p.position_top?"-"+p.position_top:"")),a.indexOf("bottom")>=0&&(s.my+=" top",s.at+=" bottom"+(0!==p.position_bottom?"+"+p.position_bottom:""))):(a.indexOf("left")>=0&&(s.my+=" left"+(0!==p.position_left?"+"+p.position_left:""),s.at+=" left"),a.indexOf("right")>=0&&(s.my+=" right"+(0!==p.position_right?"-"+p.position_right:""),s.at+=" right"),a.indexOf("center")>=0&&(s.my="center"===a?"center":s.my+" center",s.at="center"===a?"center":s.at+" center"),a.indexOf("top")>=0&&(s.my+=" top"+(0!==p.position_top?"+"+(e("body").hasClass("admin-bar")?parseInt(p.position_top,10)+32:p.position_top):""),s.at+=" top"),a.indexOf("bottom")>=0&&(s.my+=" bottom"+(0!==p.position_bottom?"-"+p.position_bottom:""),s.at+=" bottom")),s.my=e.trim(s.my),s.at=e.trim(s.at),o.is(":hidden")&&(r.overlay=o.css("opacity"),o.css({opacity:0}).show(0)),n.is(":hidden")&&(r.container=n.css("opacity"),n.css({opacity:0}).show(0)),p.position_fixed&&n.addClass("fixed"),"custom"===i.meta.display.size?n.css({width:i.meta.display.custom_width+i.meta.display.custom_width_unit,height:i.meta.display.custom_height_auto?"auto":i.meta.display.custom_height+i.meta.display.custom_height_unit}):"auto"!==i.meta.display.size&&n.addClass("responsive").css({minWidth:""!==i.meta.display.responsive_min_width?i.meta.display.responsive_min_width+i.meta.display.responsive_min_width_unit:"auto",maxWidth:""!==i.meta.display.responsive_max_width?i.meta.display.responsive_max_width+i.meta.display.responsive_max_width_unit:"auto"}),o.trigger("pumAfterReposition"),n.addClass("custom-position").position(s).trigger("popmakeAfterReposition"),r.overlay&&o.css({opacity:r.overlay}).hide(0),r.container&&n.css({opacity:r.container}).hide(0),this},retheme:function(t){e(this).trigger("popmakeBeforeRetheme");var n,i,p=PUM.getPopup(this),a=p.popmake("getContainer"),s=p.popmake("getTitle"),r=p.popmake("getContent"),c=p.popmake("getClose"),l=p.popmake("getSettings");switch(t===o&&(t=e.fn.popmake.themes[l.theme_id],t===o&&(t=e.fn.popmake.themes[1])),n="yes"===t.container.boxshadow_inset?"inset ":"",i="yes"===t.close.boxshadow_inset?"inset ":"",p.removeAttr("style").css({backgroundColor:e.fn.popmake.utilities.convert_hex(t.overlay.background_color,t.overlay.background_opacity),zIndex:l.meta.display.overlay_zindex||998}),a.css({padding:t.container.padding+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.container.background_color,t.container.background_opacity),borderStyle:t.container.border_style,borderColor:t.container.border_color,borderWidth:t.container.border_width+"px",borderRadius:t.container.border_radius+"px",boxShadow:n+t.container.boxshadow_horizontal+"px "+t.container.boxshadow_vertical+"px "+t.container.boxshadow_blur+"px "+t.container.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.container.boxshadow_color,t.container.boxshadow_opacity),zIndex:l.meta.display.zindex||999}),s.css({color:t.title.font_color,lineHeight:t.title.line_height+"px",fontSize:t.title.font_size+"px",fontFamily:t.title.font_family,fontWeight:t.title.font_weight,fontStyle:t.title.font_style,textAlign:t.title.text_align,textShadow:t.title.textshadow_horizontal+"px "+t.title.textshadow_vertical+"px "+t.title.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.title.textshadow_color,t.title.textshadow_opacity)}),r.css({color:t.content.font_color,fontFamily:t.content.font_family,fontWeight:t.content.font_weight,fontStyle:t.content.font_style}),e("p, label",r).css({color:t.content.font_color,fontFamily:t.content.font_family}),c.html(t.close.text).css({padding:t.close.padding+"px",height:t.close.height+"px",width:t.close.width+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.close.background_color,t.close.background_opacity),color:t.close.font_color,lineHeight:t.close.line_height+"px",fontSize:t.close.font_size+"px",fontWeight:t.close.font_weight,fontStyle:t.close.font_style,fontFamily:t.close.font_family,borderStyle:t.close.border_style,borderColor:t.close.border_color,borderWidth:t.close.border_width+"px",borderRadius:t.close.border_radius+"px",boxShadow:i+t.close.boxshadow_horizontal+"px "+t.close.boxshadow_vertical+"px "+t.close.boxshadow_blur+"px "+t.close.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.close.boxshadow_color,t.close.boxshadow_opacity),textShadow:t.close.textshadow_horizontal+"px "+t.close.textshadow_vertical+"px "+t.close.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.close.textshadow_color,t.close.textshadow_opacity),left:"auto",right:"auto",bottom:"auto",top:"auto"}),t.close.location){case"topleft":c.css({top:t.close.position_top+"px",left:t.close.position_left+"px"});break;case"topright":c.css({top:t.close.position_top+"px",right:t.close.position_right+"px"});break;case"bottomleft":c.css({bottom:t.close.position_bottom+"px",left:t.close.position_left+"px"});break;case"bottomright":c.css({bottom:t.close.position_bottom+"px",right:t.close.position_right+"px"})}return p.trigger("popmakeAfterRetheme",[t]),this},animation_origin:function(t){var o=PUM.getPopup(this),n=o.popmake("getContainer"),i={my:"",at:""};switch(t){case"top":i={my:"left+"+n.offset().left+" bottom-100",at:"left top"};break;case"bottom":i={my:"left+"+n.offset().left+" top+100",at:"left bottom"};break;case"left":i={my:"right top+"+n.offset().top,at:"left top"};break;case"right":i={my:"left top+"+n.offset().top,at:"right top"};break;default:t.indexOf("left")>=0&&(i={my:i.my+" right",at:i.at+" left"}),t.indexOf("right")>=0&&(i={my:i.my+" left",at:i.at+" right"}),t.indexOf("center")>=0&&(i={my:i.my+" center",at:i.at+" center"}),t.indexOf("top")>=0&&(i={my:i.my+" bottom-100",at:i.at+" top"}),t.indexOf("bottom")>=0&&(i={my:i.my+" top+100",at:i.at+" bottom"}),i.my=e.trim(i.my),i.at=e.trim(i.at)}return i.of=window,i.collision="none",i}}}(jQuery,document);var PUM_Accessibility;!function(e,t,o){"use strict";var n,i,p,a="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]";PUM_Accessibility={forceFocus:function(t){p&&!e.contains(p,t.target)&&(t.stopPropagation(),PUM_Accessibility.setFocusToFirstItem())},trapTabKey:function(t){if(9===t.keyCode){var o=p.find(".pum-container *").filter(a).filter(":visible"),n=e(":focus"),i=o.length,s=o.index(n);t.shiftKey?0===s&&(o.get(i-1).focus(),t.preventDefault()):s===i-1&&(o.get(0).focus(),t.preventDefault())}},setFocusToFirstItem:function(){p.find(".pum-container *").filter(a).filter(":visible").filter(":not(.pum-close)").first().focus()}},e(t).on("pumInit",".pum",function(){PUM.getPopup(this).find("[tabindex]").each(function(){var t=e(this);t.data("tabindex",t.attr("tabindex")).prop("tabindex","0")})}).on("pumBeforeOpen",".pum",function(){var o=PUM.getPopup(this),a=e(":focus");o.has(a).length||(i=a),p=o.on("keydown.pum_accessibility",PUM_Accessibility.trapTabKey).attr("aria-hidden","false"),n=e("body > *").filter(":visible").not(p),n.attr("aria-hidden","true"),e(t).on("focus.pum_accessibility",PUM_Accessibility.forceFocus),PUM_Accessibility.setFocusToFirstItem()}).on("pumAfterOpen",".pum",function(){}).on("pumBeforeClose",".pum",function(){}).on("pumAfterClose",".pum",function(){var a=PUM.getPopup(this);a.off("keydown.pum_accessibility").attr("aria-hidden","true"),n&&(n.attr("aria-hidden","false"),n=null),i!==o&&i.length&&i.focus(),p=null,e(t).off("focus.pum_accessibility")}).on("pumSetupClose",".pum",function(){}).on("pumOpenPrevented",".pum",function(){}).on("pumClosePrevented",".pum",function(){}).on("pumBeforeReposition",".pum",function(){})}(jQuery,document);var PUM_Analytics;!function(e,t,o){"use strict";e.fn.popmake.last_open_trigger=null,e.fn.popmake.last_close_trigger=null,e.fn.popmake.conversion_trigger=null;var n=!("undefined"==typeof pum_vars.restapi||!pum_vars.restapi);PUM_Analytics={beacon:function(t){var o=new Image,i=n?pum_vars.restapi:pum_vars.ajaxurl;t=e.extend(!0,{route:"/analytics/open",type:"open",data:{pid:null,_cache:+new Date},callback:function(){}},t),n?i+=t.route:(t.data.action="pum_analytics",t.data.type=t.type),i&&(e(o).on("error success load done",t.callback),o.src=i+"?"+e.param(t.data))}},pum_vars.disable_open_tracking!==o&&pum_vars.disable_open_tracking||e(t).on("pumAfterOpen.core_analytics","body > .pum",function(){var t=PUM.getPopup(this),o={pid:parseInt(t.popmake("getSettings").id,10)||null};o.pid>0&&!e("body").hasClass("single-popup")&&PUM_Analytics.beacon({data:o})})}(jQuery,document),function(e,t,o){"use strict";e.fn.popmake.methods.animate_overlay=function(t,o,n){var i=PUM.getPopup(this).popmake("getSettings");return i.meta.display.overlay_disabled?e.fn.popmake.overlay_animations.none.apply(this,[o,n]):e.fn.popmake.overlay_animations[t]?e.fn.popmake.overlay_animations[t].apply(this,[o,n]):(window.console&&console.warn("Animation style "+t+" does not exist."),this)},e.fn.popmake.methods.animate=function(t){return e.fn.popmake.animations[t]?e.fn.popmake.animations[t].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Animation style "+t+" does not exist."),this)},e.fn.popmake.animations={none:function(e){var t=PUM.getPopup(this);return t.popmake("getContainer").show(0),t.popmake("animate_overlay","none",0,function(){e!==o&&e()}),this},slide:function(e){var t=PUM.getPopup(this).show(0).css({opacity:0}),n=t.popmake("getContainer").show(0).css({opacity:0}),i=t.popmake("getSettings"),p=i.meta.display.animation_speed/2,a=t.popmake("animation_origin",i.meta.display.animation_origin);return n.position(a).css({opacity:1}),t.css({opacity:1}).popmake("animate_overlay","fade",p,function(){n.popmake("reposition",function(t){n.animate(t,p,"swing",function(){e!==o&&e()})})}),this},fade:function(e){var t=PUM.getPopup(this),n=t.popmake("getContainer"),i=t.popmake("getSettings"),p=i.meta.display.animation_speed/2;return n.show(0).css({opacity:0}),t.popmake("animate_overlay","fade",p,function(){n.animate({opacity:1},p,"swing",function(){e!==o&&e()})}),this},fadeAndSlide:function(e){var t=PUM.getPopup(this).show(0).css({opacity:0}),n=t.popmake("getContainer").show(0).css({opacity:0}),i=t.popmake("getSettings"),p=i.meta.display.animation_speed/2,a=t.popmake("animation_origin",i.meta.display.animation_origin);return n.position(a),t.hide().css({opacity:1}).popmake("animate_overlay","fade",p,function(){n.popmake("reposition",function(t){t.opacity=1,n.animate(t,p,"swing",function(){e!==o&&e()})})}),this},grow:function(t){return e.fn.popmake.animations.fade.apply(this,arguments)},growAndSlide:function(t){return e.fn.popmake.animations.fadeAndSlide.apply(this,arguments)}},e.fn.popmake.overlay_animations={none:function(e,t){PUM.getPopup(this).show(e,t)},fade:function(e,t){PUM.getPopup(this).fadeIn(e,t)},slide:function(e,t){PUM.getPopup(this).slideDown(e,t)}}}(jQuery,document),function(e,t,o){"use strict";e(t).on("pumInit",".pum",function(){e(this).popmake("getContainer").trigger("popmakeInit")}).on("pumBeforeOpen",".pum",function(){e(this).popmake("getContainer").addClass("active").trigger("popmakeBeforeOpen")}).on("pumAfterOpen",".pum",function(){e(this).popmake("getContainer").trigger("popmakeAfterOpen")}).on("pumBeforeClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeClose")}).on("pumAfterClose",".pum",function(){e(this).popmake("getContainer").removeClass("active").trigger("popmakeAfterClose")}).on("pumSetupClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeSetupClose")}).on("pumOpenPrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventOpen").removeClass("active")}).on("pumClosePrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventClose")}).on("pumBeforeReposition",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeReposition")})}(jQuery,document),function(e,t,o){"use strict";e.fn.popmake.callbacks={reposition_using:function(t){e(this).css(t)}}}(jQuery,document),function(e,t,o){"use strict";var n;e.extend(e.fn.popmake.methods,{checkConditions:function(){var t,i,p,a,s,r=PUM.getPopup(this),c=r.popmake("getSettings"),l=!0;if(c.mobile_disabled!==o&&c.mobile_disabled&&("object"!=typeof n&&(n=new MobileDetect(window.navigator.userAgent)),n.phone()))return!1;if(c.tablet_disabled!==o&&c.tablet_disabled&&("object"!=typeof n&&(n=new MobileDetect(window.navigator.userAgent)),n.tablet()))return!1;if(c.conditions!==o&&c.conditions.length)for(i=0;c.conditions.length>i;i++){for(a=c.conditions[i],t=!1,p=0;a.length>p&&(s=e.extend({},{not_operand:!1},a[p]),!s.not_operand&&r.popmake("checkCondition",s)?t=!0:s.not_operand&&!r.popmake("checkCondition",s)&&(t=!0),e(this).trigger("pumCheckingCondition",[t,s]),!t);p++);t||(l=!1)}return l},checkCondition:function(t){var o=t.target||null;return o?e.fn.popmake.conditions[o]?e.fn.popmake.conditions[o].apply(this,[t]):window.console?(console.warn("Condition "+o+" does not exist."),!0):void 0:(console.warn("Condition type not set."),!1)}}),e.fn.popmake.conditions={device_is_mobile:function(e){return n.mobile()}}}(jQuery,document);var pm_cookie,pm_cookie_json,pm_remove_cookie;!function(e){"use strict";function t(t){function o(n,i,p){var a,s=new Date;if("undefined"!=typeof document){if(arguments.length>1){switch(p=e.extend({path:"/"},o.defaults,p),typeof p.expires){case"number":s.setMilliseconds(s.getMilliseconds()+864e5*p.expires),p.expires=s;break;case"string":s.setTime(1e3*e.fn.popmake.utilities.strtotime("+"+p.expires)),p.expires=s}try{a=JSON.stringify(i),/^[\{\[]/.test(a)&&(i=a)}catch(r){}return i=t.write?t.write(i,n):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)),n=n.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),n=n.replace(/[\(\)]/g,escape),document.cookie=[n,"=",i,p.expires?"; expires="+p.expires.toUTCString():"",p.path?"; path="+p.path:"",p.domain?"; domain="+p.domain:"",p.secure?"; secure":""].join("")}n||(a={});for(var c=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,u=0;u<c.length;u++){var m=c[u].split("="),d=m.slice(1).join("=");'"'===d.charAt(0)&&(d=d.slice(1,-1));try{var f=m[0].replace(l,decodeURIComponent);if(d=t.read?t.read(d,f):t(d,f)||d.replace(l,decodeURIComponent),this.json)try{d=JSON.parse(d)}catch(r){}if(n===f){a=d;break}n||(a[f]=d)}catch(r){}}return a}}return void 0===t&&(t=function(){}),o.set=o,o.get=function(e){return o.call(o,e)},o.getJSON=function(){return o.apply({json:!0},[].slice.call(arguments))},o.defaults={},o.remove=function(t,n){o(t,"",e.extend({},n,{expires:-1,path:""})),o(t,"",e.extend({},n,{expires:-1}))},o.process=function(e,t,n,i){return arguments.length>3&&"object"!=typeof arguments[2]&&void 0!==t?o.apply(o,[e,t,{expires:n,path:i}]):o.apply(o,[].slice.call(arguments,[0,2]))},o.withConverter=e.fn.popmake.cookie,o}e.extend(e.fn.popmake,{cookie:t()}),pm_cookie=e.pm_cookie=e.fn.popmake.cookie.process,pm_cookie_json=e.pm_cookie_json=e.fn.popmake.cookie.getJSON,pm_remove_cookie=e.pm_remove_cookie=e.fn.popmake.cookie.remove}(jQuery),function(e,t,o){"use strict";e.extend(e.fn.popmake.methods,{addCookie:function(t){return pum.hooks.doAction("popmake.addCookie",arguments),e.fn.popmake.cookies[t]?e.fn.popmake.cookies[t].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Cookie type "+t+" does not exist."),this)},setCookie:function(t){e.pm_cookie(t.name,!0,t.session?null:t.time,t.path?"/":null),pum.hooks.doAction("popmake.setCookie",t)},checkCookies:function(t){var n,i=!1;if(t.cookie===o||t.cookie.name===o||null===t.cookie.name)return!1;switch(typeof t.cookie.name){case"object":case"array":for(n=0;t.cookie.name.length>n;n+=1)e.pm_cookie(t.cookie.name[n])!==o&&(i=!0);break;case"string":e.pm_cookie(t.cookie.name)!==o&&(i=!0)}return pum.hooks.doAction("popmake.checkCookies",t,i),i}}),e.fn.popmake.cookies=e.fn.popmake.cookies||{},e.extend(e.fn.popmake.cookies,{on_popup_open:function(e){var t=PUM.getPopup(this);t.on("pumAfterOpen",function(){t.popmake("setCookie",e)})},on_popup_close:function(e){var t=PUM.getPopup(this);t.on("pumBeforeClose",function(){t.popmake("setCookie",e)})},manual:function(e){var t=PUM.getPopup(this);t.on("pumSetCookie",function(){t.popmake("setCookie",e)})},form_success:function(e){var t=PUM.getPopup(this);t.on("pumFormSuccess",function(){t.popmake("setCookie",e)})},ninja_form_success:function(t){return e.fn.popmake.cookies.form_success.apply(this,arguments)},cf7_form_success:function(t){return e.fn.popmake.cookies.form_success.apply(this,arguments)},gforms_form_success:function(t){return e.fn.popmake.cookies.form_success.apply(this,arguments)}}),e(t).on("pumInit",".pum",function(){var e,t=PUM.getPopup(this),n=t.popmake("getSettings"),i=n.cookies,p=null;if(i!==o&&i.length)for(e=0;i.length>e;e+=1)p=i[e],t.popmake("addCookie",p.event,p.settings)})}(jQuery,document);var pum_debug_mode=!1,pum_debug;!function(e,t){if(t=window.pum_vars||{debug_mode:!1},pum_debug_mode=void 0!==t.debug_mode&&t.debug_mode,pum_debug_mode||window.location.href.indexOf("pum_debug")===-1||(pum_debug_mode=!0),pum_debug_mode){var o=!1,n=!1,i=window.pum_debug_vars||{};pum_debug={odump:function(t){return e.extend({},t)},logo:function(){console.log(" -------------------------------------------------------------\n| ____ __ __ _ |\n| | _ \\ ___ _ __ _ _ _ __ | \\/ | __ _| | _____ _ __ |\n| | |_) / _ \\| '_ \\| | | | '_ \\ | |\\/| |/ _` | |/ / _ \\ '__| |\n| | __/ (_) | |_) | |_| | |_) | | | | | (_| | < __/ | |\n| |_| \\___/| .__/ \\__,_| .__/ |_| |_|\\__,_|_|\\_\\___|_| |\n| |_| |_| |\n -------------------------------------------------------------")},initialize:function(){o=!0,pum_debug.logo(),console.debug(i.debug_mode_enabled),console.log(i.debug_started_at,new Date),console.info(i.debug_more_info),pum_debug.divider(i.global_info),console.groupCollapsed(i.localized_vars),console.log("pum_vars:",pum_debug.odump(t)),e(document).trigger("pum_debug_initialize_localized_vars"),console.groupEnd(),e(document).trigger("pum_debug_initialize")},popup_event_header:function(e){var t=e.popmake("getSettings");n!==t.id&&(n=t.id,pum_debug.divider(i.single_popup_label+t.id+" - "+t.slug))},divider:function(e){var t=62,o=62,n=0,i=" "+new Array(t+1).join("-")+" ";"string"==typeof e?(o=t-e.length,n={left:Math.floor(o/2),right:Math.floor(o/2)},n.left+n.right===o-1&&n.right++,n.left=new Array(n.left+1).join(" "),n.right=new Array(n.right+1).join(" "),console.log(""+i+"\n|"+n.left+e+n.right+"|\n"+i)):console.log(i)},click_trigger:function(e,t){var o,n=e.popmake("getSettings"),p=[".popmake-"+n.id,".popmake-"+decodeURIComponent(n.slug),'a[href$="#popmake-'+n.id+'"]'];t.extra_selectors&&""!==t.extra_selectors&&p.push(t.extra_selectors),p=pum.hooks.applyFilters("pum.trigger.click_open.selectors",p,t,e),o=p.join(", "),console.log(i.label_selector,o)},trigger:function(t,o){switch(console.groupCollapsed(i.triggers[o.type].name),o.type){case"auto_open":console.log(i.label_delay,o.settings.delay),console.log(i.label_cookie,o.settings.cookie.name);break;case"click_open":pum_debug.click_trigger(t,o.settings),console.log(i.label_cookie,o.settings.cookie.name)}e(document).trigger("pum_debug_render_trigger",t,o),console.groupEnd()},cookie:function(t,o){if("object"==typeof i.cookies[o.event]){switch(console.groupCollapsed(i.cookies[o.event].name),o.event){case"on_popup_open":case"on_popup_close":case"manual":case"ninja_form_success":console.log(i.label_settings,pum_debug.odump(o.settings))}e(document).trigger("pum_debug_render_trigger",t,o),console.groupEnd()}}},e(document).on("pumInit",".pum",function(){var t=PUM.getPopup(e(this)),n=t.popmake("getSettings"),p=0;if(o||(pum_debug.initialize(),pum_debug.divider(i.popups_initializing)),console.groupCollapsed(i.single_popup_label+n.id+" - "+n.slug),console.log(i.theme_id,n.theme_id),void 0!==n.triggers&&n.triggers.length){for(console.groupCollapsed(i.label_triggers),p=0;n.triggers.length>p;p++)pum_debug.trigger(t,n.triggers[p]);console.groupEnd()}if(void 0!==n.cookies&&n.cookies.length){for(console.groupCollapsed(i.label_cookies),p=0;n.cookies.length>p;p+=1)pum_debug.cookie(t,n.cookies[p]);console.groupEnd()}void 0!==n.conditions&&n.conditions.length&&(console.groupCollapsed(i.label_conditions),console.log(n.conditions),console.groupEnd()),console.groupCollapsed(i.label_popup_settings),console.log(i.label_mobile_disabled,null!==n.mobile_disabled),console.log(i.label_tablet_disabled,null!==n.tablet_disabled),console.log(i.label_display_settings,pum_debug.odump(n.meta.display)),console.log(i.label_close_settings,pum_debug.odump(n.meta.close)),t.trigger("pum_debug_popup_settings");var a=pum.hooks.applyFilters("pum_debug.popup_settings.cleaned_meta",pum_debug.odump(n.meta),t);delete a.display,delete a.close,delete a.click_open,a.length&&console.log("Meta: ",a),console.groupEnd(),console.groupEnd()}).on("pumBeforeOpen",".pum",function(){var t=PUM.getPopup(e(this)),o=(t.popmake("getSettings"),e.fn.popmake.last_open_trigger);pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_before_open);try{o=e(e.fn.popmake.last_open_trigger),o=o.length?o:e.fn.popmake.last_open_trigger.toString()}catch(n){o=""}finally{console.log(i.label_triggers,[o])}console.groupEnd()}).on("pumOpenPrevented",".pum",function(){var t=PUM.getPopup(e(this));pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_open_prevented),console.groupEnd()}).on("pumAfterOpen",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_after_open),console.groupEnd()}).on("pumSetupClose",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_setup_close),console.groupEnd()}).on("pumClosePrevented",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_close_prevented),console.groupEnd()}).on("pumBeforeClose",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_before_close),console.groupEnd()}).on("pumAfterClose",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_after_close),console.groupEnd()}).on("pumBeforeReposition",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_before_reposition),console.groupEnd()}).on("pumAfterReposition",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_after_reposition),console.groupEnd()}).on("pumCheckingCondition",".pum",function(t,o,n){var p=PUM.getPopup(e(this));p.popmake("getSettings");pum_debug.popup_event_header(p),console.groupCollapsed(i.label_event_checking_condition),console.log((n.not_operand?"(!) ":"")+n.target+": "+o,n),console.groupEnd()})}}(jQuery),function(e,t,o){"use strict";e.fn.popmake.defaults={meta:{display:{stackable:0,overlay_disabled:0,size:"medium",responsive_max_width:"",responsive_max_width_unit:"%",responsive_min_width:"",responsive_min_width_unit:"%",custom_width:"",custom_width_unit:"%",custom_height:"",custom_height_unit:"em",custom_height_auto:0,location:"center top",position_top:100,position_left:0,position_bottom:0,position_right:0,position_fixed:0,animation_type:"fade",animation_speed:350,animation_origin:"center top"},close:{overlay_click:0,esc_press:0,f4_press:0}},container:{active_class:"active",attr:{"class":"popmake"}},title:{attr:{"class":"popmake-title"}},content:{attr:{"class":"popmake-content"}},close:{close_speed:0,attr:{"class":"popmake-close"}},overlay:{attr:{id:"popmake-overlay","class":"popmake-overlay"}}}}(jQuery,document),function(e){"use strict";var t={openpopup:!1,openpopup_id:0,closepopup:!1,closedelay:0};window.PUM=window.PUM||{},window.PUM.forms=window.PUM.forms||{},window.PUM.forms.success=function(o,n){if(n=e.extend({},t,n)){var i=o.parents(".pum"),p=function(){n.openpopup&&PUM.getPopup(n.openpopup_id).length&&PUM.open(n.openpopup_id)};i.length&&i.trigger("pumFormSuccess"),i.length&&n.closepopup?setTimeout(function(){i.popmake("close",p)},parseInt(n.closedelay)):p()}}}(jQuery),function(e,t){"use strict";var o=function(){function e(e,t,o,n){return"string"==typeof e&&"function"==typeof t&&(o=parseInt(o||10,10),s("actions",e,t,o,n)),
2
+ u}function t(){var e=l.call(arguments),t=e.shift();return"string"==typeof t&&c("actions",t,e),u}function o(e,t){return"string"==typeof e&&a("actions",e,t),u}function n(e,t,o,n){return"string"==typeof e&&"function"==typeof t&&(o=parseInt(o||10,10),s("filters",e,t,o,n)),u}function i(){var e=l.call(arguments),t=e.shift();return"string"==typeof t?c("filters",t,e):u}function p(e,t){return"string"==typeof e&&a("filters",e,t),u}function a(e,t,o,n){var i,p,a;if(m[e][t])if(o)if(i=m[e][t],n)for(a=i.length;a--;)p=i[a],p.callback===o&&p.context===n&&i.splice(a,1);else for(a=i.length;a--;)i[a].callback===o&&i.splice(a,1);else m[e][t]=[]}function s(e,t,o,n,i){var p={callback:o,priority:n,context:i},a=m[e][t];a?(a.push(p),a=r(a)):a=[p],m[e][t]=a}function r(e){for(var t,o,n,i=1,p=e.length;i<p;i++){for(t=e[i],o=i;(n=e[o-1])&&n.priority>t.priority;)e[o]=e[o-1],--o;e[o]=t}return e}function c(e,t,o){var n,i,p=m[e][t];if(!p)return"filters"===e&&o[0];if(i=p.length,"filters"===e)for(n=0;n<i;n++)o[0]=p[n].callback.apply(p[n].context,o);else for(n=0;n<i;n++)p[n].callback.apply(p[n].context,o);return"filters"!==e||o[0]}var l=Array.prototype.slice,u={removeFilter:p,applyFilters:i,addFilter:n,removeAction:o,doAction:t,addAction:e},m={actions:{},filters:{}};return u};e.pum=e.pum||{},e.pum.hooks=e.pum.hooks||new o}(window),function(e){"use strict";var t={},o=!1;"undefined"==typeof Marionette&&"undefined"==typeof nfRadio||(o=Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("forms"),"submit:response",this.popupMaker)},popupMaker:function(t,o,n,i){var p=e("#nf-form-"+i+"-cont"),a={};t.errors.length||("undefined"!=typeof t.data.actions&&(a.openpopup="undefined"!=typeof t.data.actions.openpopup,a.openpopup_id=a.openpopup?parseInt(t.data.actions.openpopup):0,a.closepopup="undefined"!=typeof t.data.actions.closepopup,a.closedelay=a.closepopup?parseInt(t.data.actions.closepopup):0),window.PUM.forms.success(p,a))}})),e(document).ready(function(){o!==!1&&new o,e(".gform_wrapper > form").each(function(){var o=e(this),n=o.attr("id").replace("gform_",""),i=o.find("input.gforms-pum"),p=!!i.length&&JSON.parse(i.val());p&&"object"==typeof p&&(t[n]=p)})}).on("gform_confirmation_loaded",function(o,n){var i=e("#gforms_confirmation_message_"+n),p=t[n]||!1;window.PUM.forms.success(i,p)}).on("wpcf7:mailsent",".wpcf7",function(t){var o=e(t.target),n=o.find("input.wpcf7-pum"),i=!!n.length&&JSON.parse(n.val());window.PUM.forms.success(o,i)})}(jQuery),function(e,t,o){"use strict";e.extend(e.fn.popmake.methods,{addTrigger:function(t){return e.fn.popmake.triggers[t]?e.fn.popmake.triggers[t].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Trigger type "+t+" does not exist."),this)}}),e.fn.popmake.triggers={auto_open:function(t){var o=PUM.getPopup(this);setTimeout(function(){o.popmake("state","isOpen")||!o.popmake("checkCookies",t)&&o.popmake("checkConditions")&&(e.fn.popmake.last_open_trigger="Auto Open - Delay: "+t.delay,o.popmake("open"))},t.delay)},click_open:function(o){var n,i=PUM.getPopup(this),p=i.popmake("getSettings"),a=[".popmake-"+p.id,".popmake-"+decodeURIComponent(p.slug),'a[href$="#popmake-'+p.id+'"]'];o.extra_selectors&&""!==o.extra_selectors&&a.push(o.extra_selectors),a=pum.hooks.applyFilters("pum.trigger.click_open.selectors",a,o,i),n=a.join(", "),e(n).addClass("pum-trigger").css({cursor:"pointer"}),e(t).on("click.pumTrigger",n,function(t){var n=e(this),p=o.do_default||!1;i.has(n).length>0||i.popmake("state","isOpen")||!i.popmake("checkCookies",o)&&i.popmake("checkConditions")&&(n.data("do-default")?p=n.data("do-default"):(n.hasClass("do-default")||n.hasClass("popmake-do-default")||n.hasClass("pum-do-default"))&&(p=!0),t.ctrlKey||pum.hooks.applyFilters("pum.trigger.click_open.do_default",p,i,n)||(t.preventDefault(),t.stopPropagation()),e.fn.popmake.last_open_trigger=n,i.popmake("open"))})},admin_debug:function(){PUM.getPopup(this).popmake("open")}},e(t).on("pumInit",".pum",function(){var e,t=PUM.getPopup(this),n=t.popmake("getSettings"),i=n.triggers,p=null;if(i!==o&&i.length)for(e=0;i.length>e;e+=1)p=i[e],t.popmake("addTrigger",p.type,p.settings)})}(jQuery,document),function(e,t,o){"use strict";function n(t,o){return e.inArray(o,t)!==-1}function i(e,t,o){var n=t[0];t.length>1?(e[n]||(e[n]=t[1]?{}:[]),i(e[n],t.slice(1),o)):(n||(n=e.length),e[n]=o)}var p="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),a="select,textarea".split(","),s=/\[([^\]]*)\]/g;e.fn.popmake.utilities={convert_hex:function(e,t){e=e.replace("#","");var o=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16);return"rgba("+o+","+n+","+i+","+t/100+")"},debounce:function(e,t){var o;return function(){var n=this,i=arguments;window.clearTimeout(o),o=window.setTimeout(function(){e.apply(n,i)},t)}},throttle:function(e,t){var o=!1,n=function(){o=!1};return function(){o||(e.apply(this,arguments),window.setTimeout(n,t),o=!0)}},getXPath:function(t){var o,n,i,p,a,s=[];return e.each(e(t).parents(),function(t,r){return o=e(r),n=o.attr("id")||"",i=o.attr("class")||"",p=o.get(0).tagName.toLowerCase(),a=o.parent().children(p).index(o),"body"!==p&&(i.length>0&&(i=i.split(" "),i=i[0]),void s.push(p+(n.length>0?"#"+n:i.length>0?"."+i.split(" ").join("."):":eq("+a+")")))}),s.reverse().join(" > ")},strtotime:function(e,t){function n(e,t,n){var i,p=l[t];p!==o&&(i=p-c.getDay(),0===i?i=7*n:i>0&&"last"===e?i-=7:i<0&&"next"===e&&(i+=7),c.setDate(c.getDate()+i))}function i(e){var t=e.split(" "),o=t[0],i=t[1].substring(0,3),p=/\d+/.test(o),a="ago"===t[2],s=("last"===o?-1:1)*(a?-1:1);if(p&&(s*=parseInt(o,10)),u.hasOwnProperty(i)&&!t[1].match(/^mon(day|\.)?$/i))return c["set"+u[i]](c["get"+u[i]]()+s);if("wee"===i)return c.setDate(c.getDate()+7*s);if("next"===o||"last"===o)n(o,i,s);else if(!p)return!1;return!0}var p,a,s,r,c,l,u,m,d,f,g,_=!1;if(!e)return _;if(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase(),a=e.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/),a&&a[2]===a[4])if(a[1]>1901)switch(a[2]){case"-":return a[3]>12||a[5]>31?_:new Date(a[1],parseInt(a[3],10)-1,a[5],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3;case".":return _;case"/":return a[3]>12||a[5]>31?_:new Date(a[1],parseInt(a[3],10)-1,a[5],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3}else if(a[5]>1901)switch(a[2]){case"-":return a[3]>12||a[1]>31?_:new Date(a[5],parseInt(a[3],10)-1,a[1],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3;case".":return a[3]>12||a[1]>31?_:new Date(a[5],parseInt(a[3],10)-1,a[1],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3;case"/":return a[1]>12||a[3]>31?_:new Date(a[5],parseInt(a[1],10)-1,a[3],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3}else switch(a[2]){case"-":return a[3]>12||a[5]>31||a[1]<70&&a[1]>38?_:(r=a[1]>=0&&a[1]<=38?+a[1]+2e3:a[1],new Date(r,parseInt(a[3],10)-1,a[5],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3);case".":return a[5]>=70?a[3]>12||a[1]>31?_:new Date(a[5],parseInt(a[3],10)-1,a[1],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3:a[5]<60&&!a[6]?a[1]>23||a[3]>59?_:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),a[1]||0,a[3]||0,a[5]||0,a[9]||0)/1e3):_;case"/":return a[1]>12||a[3]>31||a[5]<70&&a[5]>38?_:(r=a[5]>=0&&a[5]<=38?+a[5]+2e3:a[5],new Date(r,parseInt(a[1],10)-1,a[3],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3);case":":return a[1]>23||a[3]>59||a[5]>59?_:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),a[1]||0,a[3]||0,a[5]||0)/1e3)}if("now"===e)return null===t||isNaN(t)?(new Date).getTime()/1e3||0:t||0;if(p=Date.parse(e),!isNaN(p))return p/1e3||0;if(c=t?new Date(1e3*t):new Date,l={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},u={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},d="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)",f="([+-]?\\d+\\s"+d+"|(last|next)\\s"+d+")(\\sago)?",a=e.match(new RegExp(f,"gi")),!a)return _;for(g=0,m=a.length;g<m;g+=1)if(!i(a[g]))return _;return c.getTime()/1e3},serializeObject:function(t){e.extend({},t);var o={},r=e.extend(!0,{include:[],exclude:[],includeByClass:""},t);return this.find(":input").each(function(){var t;!this.name||this.disabled||n(r.exclude,this.name)||r.include.length&&!n(r.include,this.name)||this.className.indexOf(r.includeByClass)===-1||(t=this.name.replace(s,"[$1").split("["),t[0]&&(this.checked||n(p,this.type)||n(a,this.nodeName.toLowerCase()))&&("checkbox"===this.type&&t.push(""),i(o,t,e(this).val())))}),o}},e.fn.pumSerializeObject=e.fn.popmake.utilities.serializeObject,e.fn.popmake.utilies=e.fn.popmake.utilities}(jQuery,document),function(e,t,o){"use strict";e.fn.popmake.version=1.4,e.fn.popmake.last_open_popup=null,e(t).ready(function(){e(".popmake").popmake()})}(jQuery);
includes/admin/metabox-support.php CHANGED
@@ -27,28 +27,30 @@ function popmake_support_meta_box_links() {
27
 
28
  $source = $pagenow;
29
 
 
 
30
  if ( isset( $_GET['page'] ) && $_GET['page'] == 'pum-settings' ) {
31
- $source = 'plugin-settings-page' . ( !empty( $_GET['tab'] ) ? '-' . $_GET['tab'] . '-tab' : '');
32
  } elseif ( isset( $_GET['page'] ) && $_GET['page'] == 'pum-tools' ) {
33
- $source = 'plugin-tools-page' . ( !empty( $_GET['tab'] ) ? '-' . $_GET['tab'] . '-tab' : '');
34
  }
35
  ?>
36
  <ul class="popmake-support-links">
37
  <li>
38
- <a href="http://docs.wppopupmaker.com/?utm_medium=support-sidebar&utm_campaign=ContextualHelp&utm_source=<?php echo $source; ?>&utm_content=documentation">
39
- <img src="<?php echo POPMAKE_URL; ?>/assets/images/support-pane-docs-icon.png"/>
40
- <span><?php _e( 'Documentation', 'popup-maker' ); ?></span>
41
  </a>
42
  </li>
43
  <li>
44
  <a href="https://wordpress.org/support/plugin/popup-maker">
45
- <img src="<?php echo POPMAKE_URL; ?>/assets/images/support-pane-wpforums-icon.png"/>
46
  <span><?php _e( 'Free Support Forums', 'popup-maker' ); ?></span>
47
  </a>
48
  </li>
49
  <li>
50
  <a href="https://wppopupmaker.com/support/?utm_medium=support-sidebar&utm_campaign=ContextualHelp&utm_source=<?php echo $source; ?>&utm_content=extension-support">
51
- <img src="<?php echo POPMAKE_URL; ?>/assets/images/support-pane-extensions-icon.png"/>
52
  <span><?php _e( 'Extension Support', 'popup-maker' ); ?></span>
53
  </a>
54
  </li>
27
 
28
  $source = $pagenow;
29
 
30
+ $active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], popmake_get_settings_tabs() ) ? $_GET['tab'] : null;
31
+
32
  if ( isset( $_GET['page'] ) && $_GET['page'] == 'pum-settings' ) {
33
+ $source = 'plugin-settings-page' . ( ! empty( $active_tab ) ? '-' . $active_tab . '-tab' : '' );
34
  } elseif ( isset( $_GET['page'] ) && $_GET['page'] == 'pum-tools' ) {
35
+ $source = 'plugin-tools-page' . ( ! empty( $active_tab ) ? '-' . $active_tab . '-tab' : '' );
36
  }
37
  ?>
38
  <ul class="popmake-support-links">
39
  <li>
40
+ <a href="http://docs.wppopupmaker.com/?utm_medium=support-sidebar&utm_campaign=ContextualHelp&utm_source=<?php echo $source; ?>&utm_content=documentation">
41
+ <img src="<?php echo POPMAKE_URL; ?>/assets/images/support-pane-docs-icon.png" />
42
+ <span><?php _e( 'Documentation', 'popup-maker' ); ?></span>
43
  </a>
44
  </li>
45
  <li>
46
  <a href="https://wordpress.org/support/plugin/popup-maker">
47
+ <img src="<?php echo POPMAKE_URL; ?>/assets/images/support-pane-wpforums-icon.png" />
48
  <span><?php _e( 'Free Support Forums', 'popup-maker' ); ?></span>
49
  </a>
50
  </li>
51
  <li>
52
  <a href="https://wppopupmaker.com/support/?utm_medium=support-sidebar&utm_campaign=ContextualHelp&utm_source=<?php echo $source; ?>&utm_content=extension-support">
53
+ <img src="<?php echo POPMAKE_URL; ?>/assets/images/support-pane-extensions-icon.png" />
54
  <span><?php _e( 'Extension Support', 'popup-maker' ); ?></span>
55
  </a>
56
  </li>
includes/admin/settings/register-settings.php CHANGED
@@ -130,13 +130,13 @@ function popmake_get_registered_settings() {
130
  'type' => 'checkbox',
131
  ),
132
  'disable_popup_maker_core_styles' => array(
133
- 'id' => 'disable_popup_theme_styles',
134
  'name' => __( 'Don\'t load Popup Maker core stylesheet.', 'popup-maker' ),
135
  'desc' => __( 'Check this if you have copied the Popup Maker core styles to your own stylesheet or are using custom styles.', 'popup-maker' ),
136
  'type' => 'checkbox',
137
  ),
138
  'disable_popup_theme_styles' => array(
139
- 'id' => 'disable_popup_maker_core_styles',
140
  'name' => __( 'Don\'t load popup theme styles to the head.', 'popup-maker' ),
141
  'desc' => __( 'Check this if you have copied the popup theme styles to your own stylesheet or are using custom styles.', 'popup-maker' ),
142
  'type' => 'checkbox',
@@ -246,7 +246,7 @@ function popmake_settings_sanitize( $input = array() ) {
246
  parse_str( $_POST['_wp_http_referer'], $referrer );
247
 
248
  $settings = popmake_get_registered_settings();
249
- $tab = isset( $referrer['tab'] ) ? $referrer['tab'] : 'general';
250
 
251
  $input = $input ? $input : array();
252
 
130
  'type' => 'checkbox',
131
  ),
132
  'disable_popup_maker_core_styles' => array(
133
+ 'id' => 'disable_popup_maker_core_styles',
134
  'name' => __( 'Don\'t load Popup Maker core stylesheet.', 'popup-maker' ),
135
  'desc' => __( 'Check this if you have copied the Popup Maker core styles to your own stylesheet or are using custom styles.', 'popup-maker' ),
136
  'type' => 'checkbox',
137
  ),
138
  'disable_popup_theme_styles' => array(
139
+ 'id' => 'disable_popup_theme_styles',
140
  'name' => __( 'Don\'t load popup theme styles to the head.', 'popup-maker' ),
141
  'desc' => __( 'Check this if you have copied the popup theme styles to your own stylesheet or are using custom styles.', 'popup-maker' ),
142
  'type' => 'checkbox',
246
  parse_str( $_POST['_wp_http_referer'], $referrer );
247
 
248
  $settings = popmake_get_registered_settings();
249
+ $tab = isset( $referrer['tab'] ) ? $referrer['tab'] : 'assets';
250
 
251
  $input = $input ? $input : array();
252
 
includes/class-pum-popup.php CHANGED
@@ -167,6 +167,7 @@ if ( ! class_exists( 'PUM_Popup' ) ) {
167
  'pum',
168
  'pum-overlay',
169
  'pum-theme-' . $this->get_theme_id(),
 
170
  'popmake-overlay', // Backward Compatibility
171
  ),
172
  'container' => array(
167
  'pum',
168
  'pum-overlay',
169
  'pum-theme-' . $this->get_theme_id(),
170
+ 'pum-theme-' . get_post_field( 'post_name', $this->get_theme_id() ),
171
  'popmake-overlay', // Backward Compatibility
172
  ),
173
  'container' => array(
includes/integrations/class-pum-cf7.php CHANGED
@@ -56,7 +56,7 @@ class PUM_CF7_Integration {
56
 
57
  $settings = wp_json_encode( self::form_options( $form->id() ) );
58
 
59
- return $elements . "<meta name='wpcf7-pum' content='$settings' />";
60
  }
61
 
62
  /**
56
 
57
  $settings = wp_json_encode( self::form_options( $form->id() ) );
58
 
59
+ return $elements . "<input type='hidden' class='wpcf7-pum' value='$settings' />";
60
  }
61
 
62
  /**
includes/integrations/class-pum-gravity-forms.php CHANGED
@@ -59,7 +59,7 @@ class PUM_Gravity_Forms_Integation {
59
 
60
  public static function get_form( $form_string, $form ) {
61
  $settings = wp_json_encode( self::form_options( $form['id'] ) );
62
- $field = "<meta name='gforms-pum' content='$settings' />";
63
  $form_string = preg_replace( '/(<form.*>)/', "$1 \r\n " . $field, $form_string );
64
 
65
  return $form_string;
59
 
60
  public static function get_form( $form_string, $form ) {
61
  $settings = wp_json_encode( self::form_options( $form['id'] ) );
62
+ $field = "<input type='hidden' class='gforms-pum' value='$settings' />";
63
  $form_string = preg_replace( '/(<form.*>)/', "$1 \r\n " . $field, $form_string );
64
 
65
  return $form_string;
includes/modules/menus.php CHANGED
@@ -92,7 +92,7 @@ class PUM_Modules_Menu {
92
  */
93
  public static function merge_item_data( $item ) {
94
 
95
- if ( ! is_object( $item ) || ! ! isset( $item->ID ) || $item->ID <= 0 ) {
96
  return $item;
97
  }
98
 
92
  */
93
  public static function merge_item_data( $item ) {
94
 
95
+ if ( ! is_object( $item ) || ! isset( $item->ID ) || $item->ID <= 0 ) {
96
  return $item;
97
  }
98
 
languages/popup-maker.pot CHANGED
@@ -184,15 +184,15 @@ msgstr ""
184
  msgid "Check it out"
185
  msgstr ""
186
 
187
- #: includes/admin/metabox-support.php:40, includes/admin/shortcode-ui/templates/fields.php:14
188
  msgid "Documentation"
189
  msgstr ""
190
 
191
- #: includes/admin/metabox-support.php:46
192
  msgid "Free Support Forums"
193
  msgstr ""
194
 
195
- #: includes/admin/metabox-support.php:52
196
  msgid "Extension Support"
197
  msgstr ""
198
 
184
  msgid "Check it out"
185
  msgstr ""
186
 
187
+ #: includes/admin/metabox-support.php:42, includes/admin/shortcode-ui/templates/fields.php:14
188
  msgid "Documentation"
189
  msgstr ""
190
 
191
+ #: includes/admin/metabox-support.php:48
192
  msgid "Free Support Forums"
193
  msgstr ""
194
 
195
+ #: includes/admin/metabox-support.php:54
196
  msgid "Extension Support"
197
  msgstr ""
198
 
popup-maker.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://wppopupmaker.com/?utm_capmaign=PluginInfo&utm_source=plugin-header&utm_medium=plugin-uri
5
  * Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
6
  * Author: WP Popup Maker
7
- * Version: 1.6.4
8
  * Author URI: https://wppopupmaker.com/?utm_capmaign=PluginInfo&utm_source=plugin-header&utm_medium=author-uri
9
  * Text Domain: popup-maker
10
  *
@@ -147,7 +147,7 @@ if ( ! class_exists( 'Popup_Maker' ) ) :
147
  }
148
 
149
  if ( ! defined( 'POPMAKE_VERSION' ) ) {
150
- define( 'POPMAKE_VERSION', '1.6.4' );
151
  }
152
 
153
  if ( ! defined( 'POPMAKE_DB_VERSION' ) ) {
4
  * Plugin URI: https://wppopupmaker.com/?utm_capmaign=PluginInfo&utm_source=plugin-header&utm_medium=plugin-uri
5
  * Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
6
  * Author: WP Popup Maker
7
+ * Version: 1.6.5
8
  * Author URI: https://wppopupmaker.com/?utm_capmaign=PluginInfo&utm_source=plugin-header&utm_medium=author-uri
9
  * Text Domain: popup-maker
10
  *
147
  }
148
 
149
  if ( ! defined( 'POPMAKE_VERSION' ) ) {
150
+ define( 'POPMAKE_VERSION', '1.6.5' );
151
  }
152
 
153
  if ( ! defined( 'POPMAKE_DB_VERSION' ) ) {
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link:
6
  Tags: marketing, optin, advertising, responsive popups, promotion, popover, pop-up, pop over, lightbox, conversion, modal, popup, popups
7
  Requires at least: 3.6
8
  Tested up to: 4.8
9
- Stable tag: 1.6.4
10
  License: GNU Version 3 or Any Later Version
11
 
12
  Create any popup imaginable! Customize your popups from head-to-toe and give your site more utility, usability, and conversions.
@@ -91,13 +91,25 @@ There are several common causes for this which include:
91
 
92
  == Changelog ==
93
 
 
 
 
 
 
 
 
 
94
  = v1.6.4 - 07/07/2017 =
95
  * Imporvement: Reworked all form integrations to be as DRY as possible making it more reliable.
96
  * Tweak: Added sanity check in case previous filter mucks up the $item object variable in menu item filters causing warnings.
97
  * Tweak: Disabled the open count & sorting when Popup Analytics is activated.
 
 
 
98
  * Fix: Bug caused by use of a function some users host blocked.
99
  * Fix: Bug caused by debug mode being enabled with a form success cookie.
100
  * Fix: Bug when Gravity Form was not in popup but triggered a thank you popup.
 
101
  * Fix: Bug where CF7 Forms with required fields trigger popup to close without being filled properly.
102
 
103
  = v1.6.3 - 05/19/2017 =
@@ -564,4 +576,4 @@ There are several common causes for this which include:
564
  * Misc Admin changes, including new filters/hooks for upcoming extensions.
565
 
566
  = v1.0.0 =
567
- * Initial Release
6
  Tags: marketing, optin, advertising, responsive popups, promotion, popover, pop-up, pop over, lightbox, conversion, modal, popup, popups
7
  Requires at least: 3.6
8
  Tested up to: 4.8
9
+ Stable tag: 1.6.5
10
  License: GNU Version 3 or Any Later Version
11
 
12
  Create any popup imaginable! Customize your popups from head-to-toe and give your site more utility, usability, and conversions.
91
 
92
  == Changelog ==
93
 
94
+ = v1.6.5 - 07/16/2017 =
95
+ * Tweak: Added new popup class for theme names. Thanks @bluantinoo.
96
+ * Fix: Bug in menu popups save and render functionality not working correctly.
97
+ * Fix: Finally found issue where randomly assets tab checkboxes wouldn't uncheck & save properly.
98
+ * Fix: Sanitized active tab key against whitelist to prevent possible XSS issue. Reported by Chris Liu
99
+ * Fix: Errors in w3c validation scans from form meta fields.
100
+ * Fix: Settings asset label mismatch.
101
+
102
  = v1.6.4 - 07/07/2017 =
103
  * Imporvement: Reworked all form integrations to be as DRY as possible making it more reliable.
104
  * Tweak: Added sanity check in case previous filter mucks up the $item object variable in menu item filters causing warnings.
105
  * Tweak: Disabled the open count & sorting when Popup Analytics is activated.
106
+ * Tweak: Added NF datepicker CSS fix.
107
+ * Tweak: Added media type to head styles to force optimization plugins to keep them in order.
108
+ * Tweak: Reverted to older method of click trigger assignment to better work with multiple popups on one trigger with conditions.
109
  * Fix: Bug caused by use of a function some users host blocked.
110
  * Fix: Bug caused by debug mode being enabled with a form success cookie.
111
  * Fix: Bug when Gravity Form was not in popup but triggered a thank you popup.
112
+ * Fix: Bug with GForms closing popup after submission.
113
  * Fix: Bug where CF7 Forms with required fields trigger popup to close without being filled properly.
114
 
115
  = v1.6.3 - 05/19/2017 =
576
  * Misc Admin changes, including new filters/hooks for upcoming extensions.
577
 
578
  = v1.0.0 =
579
+ * Initial Release