WordPress Landing Pages - Version 2.6.6

Version Description

  • Adding sanitations
Download this release

Release Info

Developer adbox
Plugin Icon 128x128 WordPress Landing Pages
Version 2.6.6
Comparing to
See all releases

Code changes from version 2.6.5 to 2.6.6

landing-pages.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Landing Pages
4
Plugin URI: http://www.inboundnow.com/landing-pages/
5
Description: Landing page template framework with variant testing and lead capturing through cooperation with Inbound Now's Leads plugin. This is the stand alone version served through WordPress.org.
6
- Version: 2.6.5
7
Author: Inbound Now
8
Author URI: http://www.inboundnow.com/
9
@@ -41,7 +41,7 @@ if (!class_exists('Inbound_Landing_Pages_Plugin')) {
41
*/
42
private static function load_constants() {
43
44
- define('LANDINGPAGES_CURRENT_VERSION', '2.6.5' );
45
define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
46
define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
47
define('LANDINGPAGES_PLUGIN_SLUG', 'landing-pages' );
3
Plugin Name: Landing Pages
4
Plugin URI: http://www.inboundnow.com/landing-pages/
5
Description: Landing page template framework with variant testing and lead capturing through cooperation with Inbound Now's Leads plugin. This is the stand alone version served through WordPress.org.
6
+ Version: 2.6.6
7
Author: Inbound Now
8
Author URI: http://www.inboundnow.com/
9
41
*/
42
private static function load_constants() {
43
44
+ define('LANDINGPAGES_CURRENT_VERSION', '2.6.6' );
45
define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
46
define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
47
define('LANDINGPAGES_PLUGIN_SLUG', 'landing-pages' );
readme.txt CHANGED
@@ -7,7 +7,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
8
Requires at least: 3.8
9
Tested up to: 4.8.1
10
- Stable Tag: 2.6.5
11
12
13
Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
@@ -85,6 +85,9 @@ We also offer a guide for using <a href="https://github.com/inboundnow/inbound-p
85
86
== Changelog ==
87
88
= 2.6.5 =
89
* Maintenance work on ACF repeater fields inside of nested content
90
7
Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
8
Requires at least: 3.8
9
Tested up to: 4.8.1
10
+ Stable Tag: 2.6.6
11
12
13
Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
85
86
== Changelog ==
87
88
+ = 2.6.6 =
89
+ * Adding sanitations
90
+
91
= 2.6.5 =
92
* Maintenance work on ACF repeater fields inside of nested content
93
shared/assets/js/frontend/analytics-src/analytics.page.js CHANGED
@@ -42,13 +42,17 @@ var _inboundPageTracking = (function(_inbound) {
42
return false; // in admin
43
}
44
45
- this.CheckTimeOut();
46
- // Set up options and defaults
47
options = options || {};
48
reportInterval = parseInt(options.reportInterval, 10) || 10;
49
idleTimeout = parseInt(options.idleTimeout, 10) || 3;
50
51
- // Basic activity event listeners
52
utils.addListener(document, 'keydown', utils.throttle(_inbound.PageTracking.pingSession, 1000));
53
utils.addListener(document, 'click', utils.throttle(_inbound.PageTracking.pingSession, 1000));
54
utils.addListener(window, 'mousemove', utils.throttle(_inbound.PageTracking.pingSession, 1000));
@@ -310,31 +314,6 @@ var _inboundPageTracking = (function(_inbound) {
310
,
311
CheckTimeOut: function() {
312
313
- var pageRevisit = this.isRevisit(Pages),
314
- status,
315
- timeout;
316
-
317
- /* Default */
318
- if (pageRevisit) {
319
-
320
- var prev = Pages[id].length - 1,
321
- lastView = Pages[id][prev],
322
- timeDiff = Math.abs(new Date(lastView).getTime() - new Date(timeNow).getTime());
323
-
324
- timeout = timeDiff > analyticsTimeout;
325
-
326
- if (timeout) {
327
- status = 'Timeout Happened. Page view fired';
328
- this.triggerPageView(pageRevisit);
329
- } else {
330
- time_left = Math.abs((analyticsTimeout - timeDiff)) * 0.001;
331
- status = analyticsTimeout / 1000 + ' sec timeout not done: ' + time_left + " seconds left";
332
- }
333
-
334
- } else {
335
- /*! Page never seen before save view */
336
- this.triggerPageView(pageRevisit);
337
- }
338
339
_inbound.deBugger('pages', status);
340
},
42
return false; // in admin
43
}
44
45
+ var pageRevisit = this.isRevisit(Pages);
46
+
47
+ /* Trigger page view*/
48
+ this.triggerPageView(pageRevisit);
49
+
50
+ /* Set up options and defaults */
51
options = options || {};
52
reportInterval = parseInt(options.reportInterval, 10) || 10;
53
idleTimeout = parseInt(options.idleTimeout, 10) || 3;
54
55
+ /* Basic activity event listeners */
56
utils.addListener(document, 'keydown', utils.throttle(_inbound.PageTracking.pingSession, 1000));
57
utils.addListener(document, 'click', utils.throttle(_inbound.PageTracking.pingSession, 1000));
58
utils.addListener(window, 'mousemove', utils.throttle(_inbound.PageTracking.pingSession, 1000));
314
,
315
CheckTimeOut: function() {
316
317
318
_inbound.deBugger('pages', status);
319
},
shared/assets/js/frontend/analytics/inboundAnalytics.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Inbound Analyticsv1.0.0 | (c) 2017 Inbound Now | https://github.com/inboundnow/cta */
2
/**
3
* # _inbound
4
*
@@ -130,7 +130,7 @@ var _inbound = (function(options) {
130
return Analytics;
131
132
})(_inboundOptions);
133
-
134
/**
135
* # Hooks & Filters
136
*
@@ -536,7 +536,7 @@ var _inboundHooks = (function (_inbound) {
536
return _inbound;
537
538
})(_inbound || {});
539
-
540
/**
541
* # _inbound UTILS
542
*
@@ -1395,7 +1395,7 @@ var _inboundUtils = (function(_inbound) {
1395
return _inbound;
1396
1397
})(_inbound || {});
1398
-
1399
/**
1400
* # Inbound Forms
1401
*
@@ -2606,7 +2606,7 @@ var InboundForms = (function(_inbound) {
2606
return _inbound;
2607
2608
})(_inbound || {});
2609
-
2610
/**
2611
* # Analytics Events
2612
*
@@ -3216,140 +3216,140 @@ function inboundFormNoRedirectContent(){
3216
}
3217
3218
_inbound.add_action( 'form_after_submission', inboundFormNoRedirectContent, 10 );
3219
-
3220
- /* LocalStorage Component */
3221
- var InboundTotalStorage = (function (_inbound){
3222
-
3223
- var supported, ls, mod = '_inbound';
3224
- if ('localStorage' in window){
3225
- try {
3226
- ls = (typeof window.localStorage === 'undefined') ? undefined : window.localStorage;
3227
- if (typeof ls == 'undefined' || typeof window.JSON == 'undefined'){
3228
- supported = false;
3229
- } else {
3230
- supported = true;
3231
- }
3232
- window.localStorage.setItem(mod, '1');
3233
- window.localStorage.removeItem(mod);
3234
- }
3235
- catch (err){
3236
- supported = false;
3237
- }
3238
- }
3239
-
3240
- /* Make the methods public */
3241
- _inbound.totalStorage = function(key, value, options){
3242
- return _inbound.totalStorage.impl.init(key, value);
3243
- };
3244
-
3245
- _inbound.totalStorage.setItem = function(key, value){
3246
- return _inbound.totalStorage.impl.setItem(key, value);
3247
- };
3248
-
3249
- _inbound.totalStorage.getItem = function(key){
3250
- return _inbound.totalStorage.impl.getItem(key);
3251
- };
3252
-
3253
- _inbound.totalStorage.getAll = function(){
3254
- return _inbound.totalStorage.impl.getAll();
3255
- };
3256
-
3257
- _inbound.totalStorage.deleteItem = function(key){
3258
- return _inbound.totalStorage.impl.deleteItem(key);
3259
- };
3260
-
3261
-
3262
- _inbound.totalStorage.impl = {
3263
-
3264
- init: function(key, value){
3265
- if (typeof value != 'undefined') {
3266
- return this.setItem(key, value);
3267
- } else {
3268
- return this.getItem(key);
3269
- }
3270
- },
3271
-
3272
- setItem: function(key, value){
3273
- if (!supported){
3274
- try {
3275
- _inbound.Utils.createCookie(key, value);
3276
- return value;
3277
- } catch(e){
3278
- console.log('Local Storage not supported by this browser. Install the cookie plugin on your site to take advantage of the same functionality. You can get it at https://github.com/carhartl/jquery-cookie');
3279
- }
3280
- }
3281
- var saver = JSON.stringify(value);
3282
- ls.setItem(key, saver);
3283
- return this.parseResult(saver);
3284
- },
3285
- getItem: function(key){
3286
- if (!supported){
3287
- try {
3288
- return this.parseResult(_inbound.Utils.readCookie(key));
3289
- } catch(e){
3290
- return null;
3291
- }
3292
- }
3293
- var item = ls.getItem(key);
3294
- return this.parseResult(item);
3295
- },
3296
- deleteItem: function(key){
3297
- if (!supported){
3298
- try {
3299
- _inbound.Utils.eraseCookie(key, null);
3300
- return true;
3301
- } catch(e){
3302
- return false;
3303
- }
3304
- }
3305
- ls.removeItem(key);
3306
- return true;
3307
- },
3308
- getAll: function(){
3309
- var items = [];
3310
- if (!supported){
3311
- try {
3312
- var pairs = document.cookie.split(";");
3313
- for (var i = 0; i<pairs.length; i++){
3314
- var pair = pairs[i].split('=');
3315
- var key = pair[0];
3316
- items.push({key:key, value:this.parseResult(_inbound.Utils.readCookie(key))});
3317
- }
3318
- } catch(e){
3319
- return null;
3320
- }
3321
- } else {
3322
- for (var j in ls){
3323
- if (j.length){
3324
- items.push({key:j, value:this.parseResult(ls.getItem(j))});
3325
- }
3326
- }
3327
- }
3328
- return items;
3329
- },
3330
- parseResult: function(res){
3331
- var ret;
3332
- try {
3333
- ret = JSON.parse(res);
3334
- if (typeof ret == 'undefined'){
3335
- ret = res;
3336
- }
3337
- if (ret == 'true'){
3338
- ret = true;
3339
- }
3340
- if (ret == 'false'){
3341
- ret = false;
3342
- }
3343
- if (parseFloat(ret) == ret && typeof ret != "object"){
3344
- ret = parseFloat(ret);
3345
- }
3346
- } catch(e){
3347
- ret = res;
3348
- }
3349
- return ret;
3350
- }
3351
- };
3352
- })(_inbound || {});
3353
/**
3354
* Leads API functions
3355
* @param Object _inbound - Main JS object
@@ -3437,7 +3437,7 @@ var _inboundLeadsAPI = (function(_inbound) {
3437
3438
return _inbound;
3439
3440
- })(_inbound || {});
3441
/**
3442
* # Page View Tracking
3443
*
@@ -3482,13 +3482,17 @@ var _inboundPageTracking = (function(_inbound) {
3482
return false; // in admin
3483
}
3484
3485
- this.CheckTimeOut();
3486
- // Set up options and defaults
3487
options = options || {};
3488
reportInterval = parseInt(options.reportInterval, 10) || 10;
3489
idleTimeout = parseInt(options.idleTimeout, 10) || 3;
3490
3491
- // Basic activity event listeners
3492
utils.addListener(document, 'keydown', utils.throttle(_inbound.PageTracking.pingSession, 1000));
3493
utils.addListener(document, 'click', utils.throttle(_inbound.PageTracking.pingSession, 1000));
3494
utils.addListener(window, 'mousemove', utils.throttle(_inbound.PageTracking.pingSession, 1000));
@@ -3750,31 +3754,6 @@ var _inboundPageTracking = (function(_inbound) {
3750
,
3751
CheckTimeOut: function() {
3752
3753
- var pageRevisit = this.isRevisit(Pages),
3754
- status,
3755
- timeout;
3756
-
3757
- /* Default */
3758
- if (pageRevisit) {
3759
-
3760
- var prev = Pages[id].length - 1,
3761
- lastView = Pages[id][prev],
3762
- timeDiff = Math.abs(new Date(lastView).getTime() - new Date(timeNow).getTime());
3763
-
3764
- timeout = timeDiff > analyticsTimeout;
3765
-
3766
- if (timeout) {
3767
- status = 'Timeout Happened. Page view fired';
3768
- this.triggerPageView(pageRevisit);
3769
- } else {
3770
- time_left = Math.abs((analyticsTimeout - timeDiff)) * 0.001;
3771
- status = analyticsTimeout / 1000 + ' sec timeout not done: ' + time_left + " seconds left";
3772
- }
3773
-
3774
- } else {
3775
- /*! Page never seen before save view */
3776
- this.triggerPageView(pageRevisit);
3777
- }
3778
3779
_inbound.deBugger('pages', status);
3780
},
@@ -3832,7 +3811,7 @@ var _inboundPageTracking = (function(_inbound) {
3832
3833
return _inbound;
3834
3835
- })(_inbound || {});
3836
/**
3837
* # Start
3838
*
1
+ /*! Inbound Analyticsv1.0.0 | (c) 2017 Inbound Now | https://github.com/inboundnow/cta */
2
/**
3
* # _inbound
4
*
130
return Analytics;
131
132
})(_inboundOptions);
133
+
134
/**
135
* # Hooks & Filters
136
*
536
return _inbound;
537
538
})(_inbound || {});
539
+
540
/**
541
* # _inbound UTILS
542
*
1395
return _inbound;
1396
1397
})(_inbound || {});
1398
+
1399
/**
1400
* # Inbound Forms
1401
*
2606
return _inbound;
2607
2608
})(_inbound || {});
2609
+
2610
/**
2611
* # Analytics Events
2612
*
3216
}
3217
3218
_inbound.add_action( 'form_after_submission', inboundFormNoRedirectContent, 10 );
3219
+
3220
+ /* LocalStorage Component */
3221
+ var InboundTotalStorage = (function (_inbound){
3222
+
3223
+ var supported, ls, mod = '_inbound';
3224
+ if ('localStorage' in window){
3225
+ try {
3226
+ ls = (typeof window.localStorage === 'undefined') ? undefined : window.localStorage;
3227
+ if (typeof ls == 'undefined' || typeof window.JSON == 'undefined'){
3228
+ supported = false;
3229
+ } else {
3230
+ supported = true;
3231
+ }
3232
+ window.localStorage.setItem(mod, '1');
3233
+ window.localStorage.removeItem(mod);
3234
+ }
3235
+ catch (err){
3236
+ supported = false;
3237
+ }
3238
+ }
3239
+
3240
+ /* Make the methods public */
3241
+ _inbound.totalStorage = function(key, value, options){
3242
+ return _inbound.totalStorage.impl.init(key, value);
3243
+ };
3244
+
3245
+ _inbound.totalStorage.setItem = function(key, value){
3246
+ return _inbound.totalStorage.impl.setItem(key, value);
3247
+ };
3248
+
3249
+ _inbound.totalStorage.getItem = function(key){
3250
+ return _inbound.totalStorage.impl.getItem(key);
3251
+ };
3252
+
3253
+ _inbound.totalStorage.getAll = function(){
3254
+ return _inbound.totalStorage.impl.getAll();
3255
+ };
3256
+
3257
+ _inbound.totalStorage.deleteItem = function(key){
3258
+ return _inbound.totalStorage.impl.deleteItem(key);
3259
+ };
3260
+
3261
+
3262
+ _inbound.totalStorage.impl = {
3263
+
3264
+ init: function(key, value){
3265
+ if (typeof value != 'undefined') {
3266
+ return this.setItem(key, value);
3267
+ } else {
3268
+ return this.getItem(key);
3269
+ }
3270
+ },
3271
+
3272
+ setItem: function(key, value){
3273
+ if (!supported){
3274
+ try {
3275
+ _inbound.Utils.createCookie(key, value);
3276
+ return value;
3277
+ } catch(e){
3278
+ console.log('Local Storage not supported by this browser. Install the cookie plugin on your site to take advantage of the same functionality. You can get it at https://github.com/carhartl/jquery-cookie');
3279
+ }
3280
+ }
3281
+ var saver = JSON.stringify(value);
3282
+ ls.setItem(key, saver);
3283
+ return this.parseResult(saver);
3284
+ },
3285
+ getItem: function(key){
3286
+ if (!supported){
3287
+ try {
3288
+ return this.parseResult(_inbound.Utils.readCookie(key));
3289
+ } catch(e){
3290
+ return null;
3291
+ }
3292
+ }
3293
+ var item = ls.getItem(key);
3294
+ return this.parseResult(item);
3295
+ },
3296
+ deleteItem: function(key){
3297
+ if (!supported){
3298
+ try {
3299
+ _inbound.Utils.eraseCookie(key, null);
3300
+ return true;
3301
+ } catch(e){
3302
+ return false;
3303
+ }
3304
+ }
3305
+ ls.removeItem(key);
3306
+ return true;
3307
+ },
3308
+ getAll: function(){
3309
+ var items = [];
3310
+ if (!supported){
3311
+ try {
3312
+ var pairs = document.cookie.split(";");
3313
+ for (var i = 0; i<pairs.length; i++){
3314
+ var pair = pairs[i].split('=');
3315
+ var key = pair[0];
3316
+ items.push({key:key, value:this.parseResult(_inbound.Utils.readCookie(key))});
3317
+ }
3318
+ } catch(e){
3319
+ return null;
3320
+ }
3321
+ } else {
3322
+ for (var j in ls){
3323
+ if (j.length){
3324
+ items.push({key:j, value:this.parseResult(ls.getItem(j))});
3325
+ }
3326
+ }
3327
+ }
3328
+ return items;
3329
+ },
3330
+ parseResult: function(res){
3331
+ var ret;
3332
+ try {
3333
+ ret = JSON.parse(res);
3334
+ if (typeof ret == 'undefined'){
3335
+ ret = res;
3336
+ }
3337
+ if (ret == 'true'){
3338
+ ret = true;
3339
+ }
3340
+ if (ret == 'false'){
3341
+ ret = false;
3342
+ }
3343
+ if (parseFloat(ret) == ret && typeof ret != "object"){
3344
+ ret = parseFloat(ret);
3345
+ }
3346
+ } catch(e){
3347
+ ret = res;
3348
+ }
3349
+ return ret;
3350
+ }
3351
+ };
3352
+ })(_inbound || {});
3353
/**
3354
* Leads API functions
3355
* @param Object _inbound - Main JS object
3437
3438
return _inbound;
3439
3440
+ })(_inbound || {});
3441
/**
3442
* # Page View Tracking
3443
*
3482
return false; // in admin
3483
}
3484
3485
+ var pageRevisit = this.isRevisit(Pages);
3486
+
3487
+ /* Trigger page view*/
3488
+ this.triggerPageView(pageRevisit);
3489
+
3490
+ /* Set up options and defaults */
3491
options = options || {};
3492
reportInterval = parseInt(options.reportInterval, 10) || 10;
3493
idleTimeout = parseInt(options.idleTimeout, 10) || 3;
3494
3495
+ /* Basic activity event listeners */
3496
utils.addListener(document, 'keydown', utils.throttle(_inbound.PageTracking.pingSession, 1000));
3497
utils.addListener(document, 'click', utils.throttle(_inbound.PageTracking.pingSession, 1000));
3498
utils.addListener(window, 'mousemove', utils.throttle(_inbound.PageTracking.pingSession, 1000));
3754
,
3755
CheckTimeOut: function() {
3756
3757
3758
_inbound.deBugger('pages', status);
3759
},
3811
3812
return _inbound;
3813
3814
+ })(_inbound || {});
3815
/**
3816
* # Start
3817
*
shared/assets/js/frontend/analytics/inboundAnalytics.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! Inbound Analyticsv1.0.0 | (c) 2017 Inbound Now | https://github.com/inboundnow/cta */
2
- function inboundFormNoRedirect(){if(null==window.frames.frameElement)e=document.querySelectorAll("button.inbound-button-submit[disabled]")[0];else if("iframe"==window.frames.frameElement.tagName.toLowerCase())var e=window.frames.frameElement.contentWindow.document.querySelectorAll("button.inbound-button-submit")[0];if(void 0!==e){var t=e.form,n=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])');0!=n.length&&"IA=="!=n[0].value||(t.action="javascript:void(0)")}}function inboundFormNoRedirectContent(){if(null==window.frames.frameElement)e=document.querySelectorAll("button.inbound-button-submit[disabled]")[0];else if("iframe"==window.frames.frameElement.tagName.toLowerCase())var e=window.frames.frameElement.contentWindow.document.querySelectorAll("button.inbound-button-submit")[0];if(void 0!==e){var t=e.form.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),n=jQuery(e).css("background"),o=jQuery(e).css("color"),a=jQuery(e).css("height"),i=e.getElementsByClassName("inbound-form-spinner");0!=t.length&&"IA=="!=t[0].value||(jQuery(i).remove(),jQuery(e).prepend('<div id="redir-check"><i class="fa fa-check-square" aria-hidden="true" style="background='+n+"; color="+o+"; font-size:calc("+a+' * .42);"></i></div>'))}}var inbound_data=inbound_data||{},_inboundOptions=_inboundOptions||{},_gaq=_gaq||[],_inbound=function(e){var t={timeout:inbound_settings.is_admin?500:1e4,formAutoTracking:!0,formAutoPopulation:!0},n={init:function(){_inbound.Utils.init(),_inbound.Utils.domReady(window,function(){_inbound.DomLoaded()})},DomLoaded:function(){_inbound.PageTracking.init(),_inbound.Forms.init(),_inbound.Utils.setUrlParams(),_inbound.LeadsAPI.init(),setTimeout(function(){_inbound.Forms.init()},2e3),_inbound.trigger("analytics_ready")},extend:function(e,t){var n,o={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n]);return o},debug:function(e,t){},deBugger:function(e,t,n){if(console){var o,a,i,r=document.location.hash?document.location.hash:"",s=r.indexOf("#debug")>-1,t=t||!1;r&&r.match(/debug/)&&(i=(r=r.split("-"))[1]),a="true"===_inbound.Utils.readCookie("inbound_debug"),((o="true"===_inbound.Utils.readCookie("inbound_debug_"+e))||s||a)&&(t&&"string"==typeof t&&(a||"all"===i?console.log('logAll "'+e+'" =>',t):o?console.log('log "'+e+'" =>',t):e===i&&console.log('#log "'+e+'" =>',t)),n&&n instanceof Function&&n())}}},o=n.extend(t,e);return n.Settings=o||{},n}(_inboundOptions),_inboundHooks=function(e){return e.hooks=new function(){function e(e,t,n,o){if(i[e][t])if(n){var a,r=i[e][t];if(o)for(a=r.length;a--;){var s=r[a];s.callback===n&&s.context===o&&r.splice(a,1)}else for(a=r.length;a--;)r[a].callback===n&&r.splice(a,1)}else i[e][t]=[]}function t(e,t,o,a,r){var s={callback:o,priority:a,context:r},l=i[e][t];l?(l.push(s),l=n(l)):l=[s],i[e][t]=l}function n(e){for(var t,n,o,a=1,i=e.length;a<i;a++){for(t=e[a],n=a;(o=e[n-1])&&o.priority>t.priority;)e[n]=e[n-1],--n;e[n]=t}return e}function o(e,t,n){var o=i[e][t];if(!o)return"filters"===e&&n[0];var a=0,r=o.length;if("filters"===e)for(;a<r;a++)n[0]=o[a].callback.apply(o[a].context,n);else for(;a<r;a++)o[a].callback.apply(o[a].context,n);return"filters"!==e||n[0]}var a={removeFilter:function(t,n){return"string"==typeof t&&e("filters",t,n),a},applyFilters:function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t?o("filters",t,e):a},addFilter:function(e,n,o,i){return"string"==typeof e&&"function"==typeof n&&t("filters",e,n,o=parseInt(o||10,10)),a},removeAction:function(t,n){return"string"==typeof t&&e("actions",t,n),a},doAction:function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t&&o("actions",t,e),a},addAction:function(e,n,o,i){return"string"==typeof e&&"function"==typeof n&&t("actions",e,n,o=parseInt(o||10,10),i),a}},i={actions:{},filters:{}};return a},e.add_action=function(){var t=arguments[0].split(" ");for(k in t)arguments[0]="inbound."+t[k],e.hooks.addAction.apply(this,arguments);return this},e.remove_action=function(){return arguments[0]="inbound."+arguments[0],e.hooks.removeAction.apply(this,arguments),this},e.do_action=function(){return arguments[0]="inbound."+arguments[0],e.hooks.doAction.apply(this,arguments),this},e.add_filter=function(){return arguments[0]="inbound."+arguments[0],e.hooks.addFilter.apply(this,arguments),this},e.remove_filter=function(){return arguments[0]="inbound."+arguments[0],e.hooks.removeFilter.apply(this,arguments),this},e.apply_filters=function(){return arguments[0]="inbound."+arguments[0],e.hooks.applyFilters.apply(this,arguments)},e}(_inbound||{}),_inboundUtils=function(e){var t,n=window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,o=(Object.prototype.toString,{api_host:("https:"==location.protocol?"https://":"http://")+location.hostname+location.pathname.replace(/\/#x2F;,""),track_pageview:!0,track_links_timeout:300,cookie_name:"_sp",cookie_expiration:365,cookie_domain:(host=location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}#x2F;i))?host[0]:""});return e.Utils={init:function(){this.polyFills(),this.checkLocalStorage(),this.SetUID(),this.storeReferralData()},polyFills:function(){window.console||(window.console={});for(var e=["log","info","warn","error","debug","trace","dir","group","groupCollapsed","groupEnd","time","timeEnd","profile","profileEnd","dirxml","assert","count","markTimeline","timeStamp","clear"],t=0;t<e.length;t++)window.console[e[t]]||(window.console[e[t]]=function(){});Date.prototype.toISOString||function(){function e(e){var t=String(e);return 1===t.length&&(t="0"+t),t}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+e(this.getUTCMonth()+1)+"-"+e(this.getUTCDate())+"T"+e(this.getUTCHours())+":"+e(this.getUTCMinutes())+":"+e(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}();try{new CustomEvent("?")}catch(e){this.CustomEvent=function(e,t){function n(t,n,o,a){this["init"+e](t,n,o,a),"detail"in this||(this.detail=a)}return function(o,a){var i=document.createEvent(e);return null!==o?n.call(i,o,(a||(a=t)).bubbles,a.cancelable,a.detail):i.initCustomEvent=n,i}}(this.CustomEvent?"CustomEvent":"Event",{bubbles:!1,cancelable:!1,detail:null})}document.querySelectorAll||(document.querySelectorAll=function(e){var t,n=document.createElement("style"),o=[];for(document.documentElement.firstChild.appendChild(n),document._qsa=[],n.styleSheet.cssText=e+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),n.parentNode.removeChild(n);document._qsa.length;)(t=document._qsa.shift()).style.removeAttribute("x-qsa"),o.push(t);return document._qsa=null,o}),document.querySelector||(document.querySelector=function(e){var t=document.querySelectorAll(e);return t.length?t[0]:null}),!("innerText"in document.createElement("a"))&&"getSelection"in window&&HTMLElement.prototype.__defineGetter__("innerText",function(){for(var e,t=window.getSelection(),n=[],o=0;o<t.rangeCount;o++)n[o]=t.getRangeAt(o);t.removeAllRanges(),t.selectAllChildren(this),e=t.toString(),t.removeAllRanges();for(o=0;o<n.length;o++)t.addRange(n[o]);return e})},createCookie:function(e,t,n){var o="";if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),o="; expires="+a.toGMTString()}document.cookie=e+"="+t+o+"; path=/"},readCookie:function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var a=n[o];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t))return a.substring(t.length,a.length)}return null},eraseCookie:function(e){this.createCookie(e,"",-1)},getAllCookies:function(){var t={};if(document.cookie&&""!==document.cookie)for(var n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o].split("=");a[0]=a[0].replace(/^ /,""),t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return e.totalStorage("inbound_cookies",t),t},setUrlParams:function(){var n={};!function(){for(var e,t=function(e){return decodeURIComponent(e).replace(/\+/g," ")},o=window.location.search.substring(1),a=/([^&=]+)=?([^&]*)/g;e=a.exec(o);)if("-1"==e[1].indexOf("["))n[t(e[1])]=t(e[2]);else{var i=e[1].indexOf("["),r=e[1].slice(i+1,e[1].indexOf("]",i)),s=t(e[1].slice(0,i));"object"!=typeof n[s]&&(n[t(s)]={},n[t(s)].length=0),r?n[t(s)][t(r)]=t(e[2]):Array.prototype.push.call(n[t(s)],t(e[2]))}}();for(var o in n)if("action"!=o)if("object"==typeof n[o])for(var a in n[o])this.createCookie(a,n[o][a],30);else this.createCookie(o,n[o],30);if(t){var i=e.totalStorage("inbound_url_params")||{},r=this.mergeObjs(i,n);e.totalStorage("inbound_url_params",r)}var s={option1:"yo",option2:"woooo"};e.trigger("url_parameters",n,s)},getAllUrlParams:function(){n={};if(t)var n=e.totalStorage("inbound_url_params");return n},getParameterVal:function(e,t){return(RegExp(e+"=(.+?)(&|$)").exec(t)||[,!1])[1]},checkLocalStorage:function(){if("localStorage"in window)try{ls=void 0===window.localStorage?void 0:window.localStorage,t="undefined"!=typeof ls&&void 0!==window.JSON}catch(e){t=!1}return t},showLocalStorageSize:function(){function e(e){return 2*e.length}function t(e){return e/1024/1024}var n=Object.keys(localStorage).map(function(t){return{name:t,size:e(localStorage[t])}}).map(function(e){return e.size=t(e.size).toFixed(2)+" MB",e});console.table(n)},addDays:function(e,t){return new Date(e.getTime()+24*t*60*60*1e3)},GetDate:function(){var e=new Date,t=e.getDate(),n=t<10?"0":"",o=e.getFullYear(),a=e.getHours(),i=a<10?"0":"",r=e.getMinutes(),s=r<10?"0":"",l=e.getSeconds(),u=l<10?"0":"",d=e.getMonth()+1;return o+"/"+(d<10?"0":"")+d+"/"+n+t+" "+i+a+":"+s+r+":"+u+l},SetSessionTimeout:function(){this.readCookie("lead_session_expire");var e=new Date;e.setTime(e.getTime()+18e5),this.createCookie("lead_session_expire",!0,e)},storeReferralData:function(){var t=new Date,n=document.referrer||"Direct Traffic",o=e.Utils.readCookie("inbound_referral_site"),a=e.totalStorage("inbound_original_referral");t.setTime(t.getTime()+18e5),o||this.createCookie("inbound_referral_site",n,t),a||e.totalStorage("inbound_original_referral",a)},CreateUID:function(e){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),n="";e||(e=Math.floor(Math.random()*t.length));for(var o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n},generateGUID:function(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,guid)},SetUID:function(e){if(!this.readCookie("wp_lead_uid")){var t=e||this.CreateUID(35);this.createCookie("wp_lead_uid",t)}},countProperties:function(e){var t=0;for(var n in e)e.hasOwnProperty(n)&&++t;return t},mergeObjs:function(e,t){var n={};for(var o in e)n[o]=e[o];for(var o in t)n[o]=t[o];return n},hasClass:function(e,t){if("classList"in document.documentElement)n=t.classList.contains(e);else var n=new RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className);return n},addClass:function(e,t){"classList"in document.documentElement?t.classList.add(e):this.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(e,t){"classList"in document.documentElement?t.classList.remove(e):this.hasClass(t,e)&&(t.className=t.className.replace(new RegExp("(^|\\s)*"+e+"(\\s|$)*","g"),""))},removeElement:function(e){e.parentNode.removeChild(e)},trim:function(e){return e=e.replace(/(^\s*)|(\s*$)/gi,""),e=e.replace(/[ ]{2,}/gi," "),e=e.replace(/\n /,"\n")},ajaxPolyFill:function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;for(var e,t=["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"],n=0;n<t.length;n++)try{e=new ActiveXObject(t[n]);break}catch(e){}return e},ajaxSendData:function(e,t,n,o,a){var i=this.ajaxPolyFill();setTimeout(function(){i.open(n,e,!0),i.onreadystatechange=function(){4==i.readyState&&t(i.responseText)},"POST"==n&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(o)},100)},ajaxGet:function(e,t,n,o){var a=[];for(var i in t)a.push(encodeURIComponent(i)+"="+encodeURIComponent(t[i]));this.ajaxSendData(e+"?"+a.join("&"),n,"GET",null,o)},ajaxPost:function(e,t,n,o){var a=[];for(var i in t)a.push(encodeURIComponent(i)+"="+encodeURIComponent(t[i]));this.ajaxSendData(e,n,"POST",a.join("&"),o)},sendEvent:function(e,t,a){t=t||{},async=!0;var i=getCookie();if(i){var r;for(r in i)t[r]=i[r]}t.id||(t.id=getId());var s={e:e,t:(new Date).toISOString(),kv:t},l=o.api_host+"/track?data="+encodeURIComponent(JSON.stringify(s));if(n){var u=new XMLHttpRequest;u.open("GET",l,async),u.withCredentials=async,u.send(null)}else{var d=document.createElement("script");d.type="text/javascript",d.async=async,d.defer=async,d.src=l;var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(d,c)}return action(a),self},domReady:function(e,t){var n=!1,o=!0,a=e.document,i=a.documentElement,r=a.addEventListener?"addEventListener":"attachEvent",s=a.addEventListener?"removeEventListener":"detachEvent",l=a.addEventListener?"":"on",u=function(o){"readystatechange"==o.type&&"complete"!=a.readyState||(("load"==o.type?e:a)[s](l+o.type,u,!1),!n&&(n=!0)&&t.call(e,o.type||o))},d=function(){try{i.doScroll("left")}catch(e){return void setTimeout(d,50)}u("poll")};if("complete"==a.readyState)t.call(e,"lazy");else{if(a.createEventObject&&i.doScroll){try{o=!e.frameElement}catch(e){}o&&d()}a[r](l+"DOMContentLoaded",u,!1),a[r](l+"readystatechange",u,!1),e[r](l+"load",u,!1)}},addListener:function(e,t,n){e&&(e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n)},removeListener:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},throttle:function(e,t){var n,o,a,i=null,r=0,s=function(){r=new Date,i=null,a=e.apply(n,o)};return function(){var l=new Date;r||(r=l);var u=t-(l-r);return n=this,o=arguments,u<=0?(clearTimeout(i),i=null,r=l,a=e.apply(n,o)):i||(i=setTimeout(s,u)),a}},checkTypeofGA:function(){"function"==typeof ga&&(universalGA=!0),void 0!==_gaq&&"function"==typeof _gaq.push&&(classicGA=!0),"undefined"!=typeof dataLayer&&"function"==typeof dataLayer.push&&(googleTagManager=!0)},cacheSearchData:function(n,o){if(t){var a=e.totalStorage.getItem("inbound_search_storage");if(a)a.unshift(n),e.totalStorage.setItem("inbound_search_storage",a);else{var i=[n];e.totalStorage.setItem("inbound_search_storage",i)}}else{var r=JSON.stringify(n),s=this.readCookie("inbound_search_storage");s&&(r+="SPLIT-TOKEN"+s),this.createCookie("inbound_search_storage",r,"180")}e.Forms.releaseFormSubmit(o)},storeSearchData:function(){if(inbound_settings.wp_lead_data.lead_id&&inbound_settings.wp_lead_data.lead_nonce){var t=[],n=e.totalStorage.getItem("inbound_search_storage"),o=this.readCookie("inbound_search_storage");if(n||o){if(o){o=o.split("SPLIT-TOKEN");for(var a in o)t.push(JSON.parse(o[a]))}n&&(t=t.concat(n)),t.sort(function(e,t){return e.timestamp-t.timestamp});var i={action:"inbound_search_store",data:t=encodeURIComponent(JSON.stringify(t)),nonce:inbound_settings.wp_lead_data.lead_nonce,lead_id:inbound_settings.wp_lead_data.lead_id};callback=function(t){t&&(t=JSON.parse(t)),t.success&&(console.log(t.success),e.Utils.eraseCookie("inbound_search_storage"),e.totalStorage.deleteItem("inbound_search_storage")),t.error&&console.log(t.error)},this.ajaxPost(inbound_settings.admin_url,i,callback)}}}},e}(_inbound||{}),InboundForms=function(e){var t=e.Utils,n=[],o=[],a=[],r={},s=e.Settings,l=["first name","last name","name","email","e-mail","phone","website","job title","your favorite food","company","tele","address","comment"];if(e.Forms={init:function(){e.Forms.runFieldMappingFilters(),e.Forms.formTrackInit(),e.Forms.searchTrackInit()},runFieldMappingFilters:function(){l=e.hooks.applyFilters("forms.field_map",l)},debug:function(e,t){return},formTrackInit:function(){for(var e=0;e<window.document.forms.length;e++){var t=window.document.forms[e];t.dataset.formProcessed||(t.dataset.formProcessed=!0,this.checkTrackStatus(t)&&(this.attachFormSubmitEvent(t),this.initFormMapping(t)))}},searchTrackInit:function(){if("off"!=inbound_settings.search_tracking&&!r.searchTrackInit){for(var e=0;e<window.document.forms.length;e++){var n=window.document.forms[e];n.dataset.searchChecked||(n.dataset.searchChecked=!0,this.checkSearchTrackStatus(n)&&this.attachSearchFormSubmitEvent(n))}t.storeSearchData(),r.searchTrackInit=!0}},checkTrackStatus:function(t){var n=t.getAttribute("class");if(""!==n&&null!==n)return n.toLowerCase().indexOf("wpl-track-me")>-1||(n.toLowerCase().indexOf("inbound-track")>-1||(cb=function(){console.log(t)},e.deBugger("forms","This form not tracked. Please assign on in settings...",cb),!1))},checkSearchTrackStatus:function(t){var n=t.getAttribute("class"),o=t.getAttribute("id");return""!==n&&null!==n&&n.toLowerCase().indexOf("search")>-1||(""===o||null===o?(cb=function(){console.log(t)},e.deBugger("searches","This search form is not tracked. Please assign on in settings...",cb),!1):o.toLowerCase().indexOf("search")>-1||void 0)},loopClassSelectors:function(n,o){for(var a=n.length-1;a>=0;a--){var i=t.trim(n[a]);-1===i.indexOf("#")&&-1===i.indexOf(".")&&(i="#"+i),(i=document.querySelector(i))&&("add"===o?(e.Utils.addClass("wpl-track-me",i),e.Utils.addClass("inbound-track",i)):(e.Utils.removeClass("wpl-track-me",i),e.Utils.removeClass("inbound-track",i)))}},initFormMapping:function(t){for(var n=[],o=0;o<t.elements.length;o++)formInput=t.elements[o],"hidden"!==formInput.type?(this.mapField(formInput),this.rememberInputValues(formInput),s.formAutoPopulation&&!e.Utils.hasClass("nopopulate",t)&&this.fillInputValues(formInput)):n.push(formInput);for(var a=n.length-1;a>=0;a--)formInput=n[a],this.mapField(formInput)},mapField:function(o){var a=o.id||!1,r=o.name||!1,s=this.getInputLabel(o);if(s&&this.ignoreFieldByLabel(s[0].innerText))return o.dataset.ignoreFormField=!0,!1;for(i=0;i<l.length;i++){var u=!1,d=l[i],c=t.trim(d),m=c.replace(/ /g,"_");r&&r.toLowerCase().indexOf(c)>-1?(u=!0,e.deBugger("forms","Found matching name attribute for -> "+c)):a&&a.toLowerCase().indexOf(c)>-1?(u=!0,e.deBugger("forms","Found matching ID attribute for ->"+c)):s?s[0].innerText.toLowerCase().indexOf(c)>-1&&(u=!0,e.deBugger("forms","Found matching sibling label for -> "+c)):n.push(c),u&&(this.addDataAttr(o,m),this.removeArrayItem(l,c),i--)}return inbound_data},formListener:function(t){t.preventDefault(),e.Forms.saveFormData(t.target),document.body.style.cursor="wait"},searchFormListener:function(t){t.preventDefault(),e.Forms.saveSearchData(t.target)},attachFormSubmitEvent:function(e){t.addListener(e,"submit",this.formListener);document.querySelector(".inbound-email")},attachSearchFormSubmitEvent:function(e){t.addListener(e,"submit",this.searchFormListener)},ignoreFieldByLabel:function(t){var n=!1;return!!t&&(-1==t.toLowerCase().indexOf("credit card")&&-1==t.toLowerCase().indexOf("card number")||(n=!0),-1==t.toLowerCase().indexOf("expiration")&&-1==t.toLowerCase().indexOf("expiry")||(n=!0),"month"!=t.toLowerCase()&&"mm"!=t.toLowerCase()&&"yy"!=t.toLowerCase()&&"yyyy"!=t.toLowerCase()&&"year"!=t.toLowerCase()||(n=!0),-1==t.toLowerCase().indexOf("cvv")&&-1==t.toLowerCase().indexOf("cvc")&&-1==t.toLowerCase().indexOf("secure code")&&-1==t.toLowerCase().indexOf("security code")||(n=!0),n&&e.deBugger("forms","ignore "+t),n)},ignoreFieldByValue:function(e){var t=!1;if(!e)return!1;if("visa"!=e.toLowerCase()&&"mastercard"!=e.toLowerCase()&&"american express"!=e.toLowerCase()&&"amex"!=e.toLowerCase()&&"discover"!=e.toLowerCase()||(t=!0),new RegExp("/^[0-9]+#x2F;").test(e)){var n=e.replace(" ","");this.isInt(n)&&n.length>=16&&(t=!0)}return t},isInt:function(e){return"number"==typeof e&&isFinite(e)&&e%1==0},releaseFormSubmit:function(e){document.body.style.cursor="default",t.removeClass("wpl-track-me",e),t.removeListener(e,"submit",this.formListener);var n=e.getAttribute("class");if(""!==n&&null!==n&&-1!=n.toLowerCase().indexOf("wpcf7-form"))return setTimeout(function(){document.body.style.cursor="default"},300),!0;e.submit(),setTimeout(function(){for(var t=0;t<e.elements.length;t++)formInput=e.elements[t],type=formInput.type||!1,"submit"===type&&"submit"===formInput.name&&e.elements[t].click()},2e3)},saveFormData:function(n){for(var i=i||{},r=0;r<n.elements.length;r++)if(formInput=n.elements[r],multiple=!1,formInput.name){if(formInput.dataset.ignoreFormField){e.deBugger("forms","ignore "+formInput.name);continue}switch(inputName=formInput.name.replace(/\[([^\[]*)\]/g,"%5B%5D$1"),i[inputName]||(i[inputName]={}),formInput.type&&(i[inputName].type=formInput.type),i[inputName].name||(i[inputName].name=formInput.name),formInput.dataset.mapFormField&&(i[inputName].map=formInput.dataset.mapFormField),formInput.nodeName){case"INPUT":if(!1===(l=this.getInputValue(formInput)))continue;break;case"TEXTAREA":l=formInput.value;break;case"SELECT":if(formInput.multiple){values=[],multiple=!0;for(var s=0;s<formInput.length;s++)formInput[s].selected&&values.push(encodeURIComponent(formInput[s].value))}else l=formInput.value}if(e.deBugger("forms","Input Value = "+l),l){i[inputName].value||(i[inputName].value=[]),i[inputName].value.push(multiple?values.join(","):encodeURIComponent(l));var l=multiple?values.join(","):encodeURIComponent(l)}}e.deBugger("forms",i);for(var u in i){var d=i[u].value,c=i[u].map;if(void 0!==d&&null!=d&&""!=d&&o.push(u+"="+i[u].value.join(",")),void 0!==c&&null!=c&&i[u].value&&(a.push(c+"="+i[u].value.join(",")),"email"===u))var m=i[u].value.join(",")}var f=o.join("&");e.deBugger("forms","Stringified Raw Form PARAMS: "+f);var g=a.join("&");e.deBugger("forms","Stringified Mapped PARAMS"+g),(m=t.getParameterVal("email",g)||t.readCookie("wp_lead_email"))||(m=t.getParameterVal("wpleads_email_address",g));var p=t.getParameterVal("name",g),h=t.getParameterVal("first_name",g),v=t.getParameterVal("last_name",g);if(!v&&h&&(_=decodeURI(h).split(" ")).length>0&&(h=_[0],v=_[1]),p&&!v&&!h){var _=decodeURI(p).split(" ");_.length>0&&(h=_[0],v=_[1])}p=h&&v?h+" "+v:p,h||(h=""),v||(v=""),e.deBugger("forms","fName = "+h),e.deBugger("forms","lName = "+v),e.deBugger("forms","fullName = "+p);var b=e.totalStorage("page_views")||{},y=e.totalStorage("inbound_url_params")||{},w=n.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),k=!1;if(0==w.length||"IA=="==w[0].value)k=!0;var S=n.querySelectorAll('input[value][type="hidden"][name="inbound_form_id"]');S=S.length>0?S[0].value:0;if("undefined"!=typeof landing_path_info)C=landing_path_info.variation;else if("undefined"!=typeof cta_path_info)C=cta_path_info.variation;else var C=inbound_settings.variation_id;var I=inbound_settings.post_type||"page",L=inbound_settings.post_id||0;search_data={},formData={action:"inbound_lead_store",email:m,full_name:p,first_name:h,last_name:v,raw_params:f,mapped_params:g,url_params:JSON.stringify(y),search_data:"test",page_views:JSON.stringify(b),post_type:I,page_id:L,variation:C,source:t.readCookie("inbound_referral_site"),inbound_submitted:k,inbound_form_id:S,inbound_nonce:inbound_settings.ajax_nonce,event:n},callback=function(o){e.deBugger("forms","Lead Created with ID: "+o),o=parseInt(o,10),formData.leadID=o,o&&(t.createCookie("wp_lead_id",o),e.totalStorage.deleteItem("page_views"),e.totalStorage.deleteItem("tracking_events")),e.trigger("form_after_submission",formData),e.Forms.releaseFormSubmit(n)},e.trigger("form_before_submission",formData),t.ajaxPost(inbound_settings.admin_url,formData,callback)},saveSearchData:function(n){for(var o=o||{},a=0;a<n.elements.length;a++)if(formInput=n.elements[a],multiple=!1,formInput.name){if(formInput.dataset.ignoreFormField){e.deBugger("searches","ignore "+formInput.name);continue}switch(c=formInput.name.replace(/\[([^\[]*)\]/g,"%5B%5D$1"),o[c]||(o[c]={}),formInput.type&&(o[c].type=formInput.type),o[c].name||(o[c].name=formInput.name),formInput.dataset.mapFormField&&(o[c].map=formInput.dataset.mapFormField),formInput.nodeName){case"INPUT":if(!1===(r=this.getInputValue(formInput)))continue;break;case"TEXTAREA":r=formInput.value;break;case"SELECT":if(formInput.multiple){values=[],multiple=!0;for(var i=0;i<formInput.length;i++)formInput[i].selected&&values.push(encodeURIComponent(formInput[i].value))}else r=formInput.value}if(e.deBugger("searches","Input Value = "+r),r){o[c].value||(o[c].value=[]),o[c].value.push(multiple?values.join(","):encodeURIComponent(r));var r=multiple?values.join(","):encodeURIComponent(r)}}e.deBugger("searches",o);var s=[];for(var l in o){var u=o[l].value,d=o[l].type,c=o[l].name;void 0!==u&&null!=u&&""!=u&&("search"==d?s.push("search_text|value|"+o[l].value):"s"==c&&s.push("search_text|value|"+o[l].value))}s[0]||e.Forms.releaseFormSubmit(n);var m=s.join("|field|");if(e.deBugger("searches","Stringified Search Form PARAMS: "+m),"undefined"!=typeof landing_path_info)f=landing_path_info.variation;else if("undefined"!=typeof cta_path_info)f=cta_path_info.variation;else var f=inbound_settings.variation_id;var g=inbound_settings.post_type||"page",p=inbound_settings.post_id||0,h=t.readCookie("wp_lead_uid");inbound_settings.wp_lead_data.lead_email?email=inbound_settings.wp_lead_data.lead_email:t.readCookie("inbound_wpleads_email_address")?email=t.readCookie("inbound_wpleads_email_address"):email="",searchData={email:email,search_data:m,user_UID:h,post_type:g,page_id:p,variation:f,source:t.readCookie("inbound_referral_site"),ip_address:inbound_settings.ip_address,timestamp:Math.floor((new Date).getTime()/1e3)},e.trigger("search_before_caching",searchData),inbound_settings.wp_lead_data.lead_id?(searchData.lead_id=inbound_settings.wp_lead_data.lead_id,t.cacheSearchData(searchData,n)):t.cacheSearchData(searchData,n)},rememberInputValues:function(n){n.name&&n.name;var o=n.type?n.type:"text";if("submit"===o||"hidden"===o||"file"===o||"password"===o||n.dataset.ignoreFormField)return!1;t.addListener(n,"change",function(n){if(n.target.name){if("checkbox"!==o)var a=n.target.value;else for(var i=[],r=document.querySelectorAll('input[name="'+n.target.name+'"]'),s=0;s<r.length;s++)r[s].checked&&i.push(r[s].value),a=i.join(",");inputData={name:n.target.name,node:n.target.nodeName.toLowerCase(),type:o,value:a,mapping:n.target.dataset.mapFormField},e.trigger("form_input_change",inputData),t.createCookie("inbound_"+n.target.name,encodeURIComponent(a))}})},fillInputValues:function(e){var n=e.name?"inbound_"+e.name:"",o=e.type?e.type:"text";if("submit"===o||"hidden"===o||"file"===o||"password"===o)return!1;if(t.readCookie(n)&&"comment"!=n)if(value=decodeURIComponent(t.readCookie(n)),"checkbox"===o||"radio"===o)for(var a=value.split(","),i=0;i<a.length;i++)e.value.indexOf(a[i])>-1&&(e.checked=!0);else"undefined"!==value&&(e.value=value)},getInputLabel:function(e){var t;return(t=this.siblingsIsLabel(e))?t:!!(t=this.CheckParentForLabel(e))&&t},getInputValue:function(e){var t=!1;switch(e.type){case"radio":case"checkbox":e.checked&&(t=e.value);break;case"text":case"hidden":default:t=e.value}return t},addDataAttr:function(e,t){for(var n=document.getElementsByName(e.name),o=n.length-1;o>=0;o--)e.dataset.mapFormField||(n[o].dataset.mapFormField=t)},removeArrayItem:function(e,t){if(e.indexOf)index=e.indexOf(t);else for(index=e.length-1;index>=0&&e[index]!==t;--index);index>=0&&e.splice(index,1)},siblingsIsLabel:function(e){for(var t=this.getSiblings(e),n=[],o=t.length-1;o>=0;o--)"label"===t[o].nodeName.toLowerCase()&&n.push(t[o]);return n.length>0&&n.length<2&&n},getChildren:function(e,t){for(var n=[];e;e=e.nextSibling)1==e.nodeType&&e!=t&&n.push(e);return n},getSiblings:function(e){return this.getChildren(e.parentNode.firstChild,e)},CheckParentForLabel:function(e){if("FORM"===e.nodeName)return null;do{var t=e.getElementsByTagName("label");if(t.length>0&&t.length<2)return e.getElementsByTagName("label")}while(e=e.parentNode);return null},mailCheck:function(){var e=document.querySelector(".inbound-email");e&&(t.addListener(e,"blur",this.mailCheck),u.run({email:document.querySelector(".inbound-email").value,suggested:function(n){var o=document.querySelector(".email_suggestion");o&&t.removeElement(o);var a=document.createElement("span");a.innerHTML="<span class=\"email_suggestion\">Did youu mean <b><i id='email_correction' style='cursor: pointer;' title=\"click to update\">"+n.full+"</b></i>?</span>",e.parentNode.insertBefore(a,e.nextSibling);var i=document.getElementById("email_correction");t.addListener(i,"click",function(){e.value=i.innerHTML,i.parentNode.parentNode.innerHTML="Fixed!"})},empty:function(){}}))}},void 0===u)var u={domainThreshold:1,topLevelThreshold:3,defaultDomains:["yahoo.com","google.com","hotmail.com","gmail.com","me.com","aol.com","mac.com","live.com","comcast.net","googlemail.com","msn.com","hotmail.co.uk","yahoo.co.uk","facebook.com","verizon.net","sbcglobal.net","att.net","gmx.com","mail.com","outlook.com","icloud.com"],defaultTopLevelDomains:["co.jp","co.uk","com","net","org","info","edu","gov","mil","ca","de"],run:function(e){e.domains=e.domains||u.defaultDomains,e.topLevelDomains=e.topLevelDomains||u.defaultTopLevelDomains,e.distanceFunction=e.distanceFunction||u.sift3Distance;var t=function(e){return e},n=e.suggested||t,o=e.empty||t,a=u.suggest(u.encodeEmail(e.email),e.domains,e.topLevelDomains,e.distanceFunction);return a?n(a):o()},suggest:function(e,t,n,o){e=e.toLowerCase();var a=this.splitEmail(e),i=this.findClosestDomain(a.domain,t,o,this.domainThreshold);if(i){if(i!=a.domain)return{address:a.address,domain:i,full:a.address+"@"+i}}else{var r=this.findClosestDomain(a.topLevelDomain,n,o,this.topLevelThreshold);if(a.domain&&r&&r!=a.topLevelDomain){var s=a.domain;return i=s.substring(0,s.lastIndexOf(a.topLevelDomain))+r,{address:a.address,domain:i,full:a.address+"@"+i}}}return!1},findClosestDomain:function(e,t,n,o){o=o||this.topLevelThreshold;var a,i=99,r=null;if(!e||!t)return!1;n||(n=this.sift3Distance);for(var s=0;s<t.length;s++){if(e===t[s])return e;(a=n(e,t[s]))<i&&(i=a,r=t[s])}return i<=o&&null!==r&&r},sift3Distance:function(e,t){if(null===e||0===e.length)return null===t||0===t.length?0:t.length;if(null===t||0===t.length)return e.length;for(var n=0,o=0,a=0,i=0;n+o<e.length&&n+a<t.length;){if(e.charAt(n+o)==t.charAt(n+a))i++;else{o=0,a=0;for(var r=0;r<5;r++){if(n+r<e.length&&e.charAt(n+r)==t.charAt(n)){o=r;break}if(n+r<t.length&&e.charAt(n)==t.charAt(n+r)){a=r;break}}}n++}return(e.length+t.length)/2-i},splitEmail:function(e){var t=e.trim().split("@");if(t.length<2)return!1;for(i=0;i<t.length;i++)if(""===t[i])return!1;var n=t.pop(),o=n.split("."),a="";if(0===o.length)return!1;if(1==o.length)a=o[0];else{for(var i=1;i<o.length;i++)a+=o[i]+".";o.length>=2&&(a=a.substring(0,a.length-1))}return{topLevelDomain:a,domain:n,address:t.join("@")}},encodeEmail:function(e){var t=encodeURI(e);return t=t.replace("%20"," ").replace("%25","%").replace("%5E","^").replace("%60","`").replace("%7B","{").replace("%7C","|").replace("%7D","}")}};return e}(_inbound||{}),_inboundEvents=function(e){function t(t,o,a){var o=o||{};(a=a||{}).bubbles=a.bubbles||!0,a.cancelable=a.cancelable||!0,o=e.apply_filters("filter_"+t,o);!window.ActiveXObject&&window;if("function"==typeof CustomEvent)var i=new CustomEvent(t,{detail:o,bubbles:a.bubbles,cancelable:a.cancelable});else(i=document.createEvent("Event")).initEvent(t,!0,!0);window.dispatchEvent(i),e.do_action(t,o),n(t,o)}function n(e,t){if(window.jQuery){var t=t||{};jQuery(document).trigger(e,t)}}e.trigger=function(t,n){e.Events[t](n)};return e.Events={analytics_ready:function(){t("analytics_ready",{data:"xyxy"},{opt1:!0})},url_parameters:function(e){t("url_parameters",e)},session_start:function(){console.log(""),t("session_start")},session_end:function(e){t("session_end",e),console.log("Session End")},session_active:function(){t("session_active")},session_idle:function(e){t("session_idle",e)},session_resume:function(){t("session_resume")},session_heartbeat:function(e){t("session_heartbeat",{clock:e,leadData:InboundLeadData})},page_visit:function(e){t("page_view",e)},page_first_visit:function(n){t("page_first_visit"),e.deBugger("pages","First Ever Page View of this Page")},page_revisit:function(n){t("page_revisit",n);e.deBugger("pages",status,function(){console.log("pageData",n),console.log("Page Revisit viewed "+n+" times")})},tab_hidden:function(n){e.deBugger("pages","Tab Hidden"),t("tab_hidden")},tab_visible:function(n){e.deBugger("pages","Tab Visible"),t("tab_visible")},tab_mouseout:function(n){e.deBugger("pages","Tab Mouseout"),t("tab_mouseout")},form_input_change:function(n){e.deBugger("forms","inputData change. Data=",function(){console.log(n)}),t("form_input_change",n)},form_before_submission:function(e){t("form_before_submission",e)},form_after_submission:function(e){t("form_after_submission",e)},search_before_caching:function(e){t("search_before_caching",e)},analyticsError:function(e,t,n){var o=new CustomEvent("inbound_analytics_error",{detail:{MLHttpRequest:e,textStatus:t,errorThrown:n}});window.dispatchEvent(o),console.log("Page Save Error")}},e}(_inbound||{});_inbound.add_action("form_before_submission",inboundFormNoRedirect,10),_inbound.add_action("form_after_submission",inboundFormNoRedirectContent,10);var InboundTotalStorage=function(e){var t,n;if("localStorage"in window)try{n=void 0===window.localStorage?void 0:window.localStorage,t=void 0!==n&&void 0!==window.JSON,window.localStorage.setItem("_inbound","1"),window.localStorage.removeItem("_inbound")}catch(e){t=!1}e.totalStorage=function(t,n,o){return e.totalStorage.impl.init(t,n)},e.totalStorage.setItem=function(t,n){return e.totalStorage.impl.setItem(t,n)},e.totalStorage.getItem=function(t){return e.totalStorage.impl.getItem(t)},e.totalStorage.getAll=function(){return e.totalStorage.impl.getAll()},e.totalStorage.deleteItem=function(t){return e.totalStorage.impl.deleteItem(t)},e.totalStorage.impl={init:function(e,t){return void 0!==t?this.setItem(e,t):this.getItem(e)},setItem:function(o,a){if(!t)try{return e.Utils.createCookie(o,a),a}catch(e){console.log("Local Storage not supported by this browser. Install the cookie plugin on your site to take advantage of the same functionality. You can get it at https://github.com/carhartl/jquery-cookie")}var i=JSON.stringify(a);return n.setItem(o,i),this.parseResult(i)},getItem:function(o){if(!t)try{return this.parseResult(e.Utils.readCookie(o))}catch(e){return null}var a=n.getItem(o);return this.parseResult(a)},deleteItem:function(o){if(!t)try{return e.Utils.eraseCookie(o,null),!0}catch(e){return!1}return n.removeItem(o),!0},getAll:function(){var o=[];if(t)for(var a in n)a.length&&o.push({key:a,value:this.parseResult(n.getItem(a))});else try{for(var i=document.cookie.split(";"),r=0;r<i.length;r++){var s=i[r].split("=")[0];o.push({key:s,value:this.parseResult(e.Utils.readCookie(s))})}}catch(e){return null}return o},parseResult:function(e){var t;try{void 0===(t=JSON.parse(e))&&(t=e),"true"==t&&(t=!0),"false"==t&&(t=!1),parseFloat(t)==t&&"object"!=typeof t&&(t=parseFloat(t))}catch(n){t=e}return t}}}(_inbound||{}),_inboundLeadsAPI=function(e){return e.LeadsAPI={init:function(){var t=e.Utils,n=(t.readCookie("wp_lead_uid"),t.readCookie("wp_lead_id"));t.readCookie("lead_data_expire")||(e.deBugger("leads","expired vistor. Run Processes"),n&&e.LeadsAPI.getAllLeadData())},setGlobalLeadData:function(e){InboundLeadData=e},getAllLeadData:function(t){var n=e.Utils.readCookie("wp_lead_id"),o=e.totalStorage("inbound_lead_data"),a=e.Utils.readCookie("lead_data_expire");data={action:"inbound_get_all_lead_data",wp_lead_id:n},success=function(t){var n=JSON.parse(t);e.LeadsAPI.setGlobalLeadData(n),e.totalStorage("inbound_lead_data",n);var o=new Date;o.setTime(o.getTime()+18e5);var a=e.Utils.addDays(o,3);e.Utils.createCookie("lead_data_expire",!0,a)},o?(e.LeadsAPI.setGlobalLeadData(o),e.deBugger("lead","Set Global Lead Data from Localstorage"),a||(e.Utils.ajaxPost(inbound_settings.admin_url,data,success),e.deBugger("lead","localized data old. Pull new from DB"))):e.Utils.ajaxPost(inbound_settings.admin_url,data,success)},getLeadLists:function(){var t={action:"wpl_check_lists",wp_lead_id:e.Utils.readCookie("wp_lead_id")};e.Utils.ajaxPost(inbound_settings.admin_url,t,function(t){e.Utils.createCookie("lead_session_list_check",!0,{path:"/",expires:1}),e.deBugger("lead","Lists checked")})}},e}(_inbound||{}),_inboundPageTracking=function(e){var t,n,o=!1,a=!1,i=!1,r=parseInt(e.Utils.readCookie("lead_session"),10)||0,s=0,l=(new Date,null),u=null,d=null,c=e.Utils,m=e.Utils.GetDate(),f="page_views",g=e.totalStorage(f)||{},p=inbound_settings.post_id||window.location.pathname,h=e.Settings.timeout||1e4;return e.PageTracking={init:function(o){this.CheckTimeOut(),o=o||{},t=parseInt(o.reportInterval,10)||10,n=parseInt(o.idleTimeout,10)||3,c.addListener(document,"keydown",c.throttle(e.PageTracking.pingSession,1e3)),c.addListener(document,"click",c.throttle(e.PageTracking.pingSession,1e3)),c.addListener(window,"mousemove",c.throttle(e.PageTracking.pingSession,1e3)),e.PageTracking.checkVisibility(),this.startSession()},setIdle:function(t){var n="Session IDLE. Activity Timeout due to "+(t=t||"No Movement");e.deBugger("pages",n),clearTimeout(e.PageTracking.idleTimer),e.PageTracking.stopClock(),e.trigger("session_idle")},checkVisibility:function(){var t,n;void 0!==document.hidden?(t="hidden",n="visibilitychange"):void 0!==document.mozHidden?(t="mozHidden",n="mozvisibilitychange"):void 0!==document.msHidden?(t="msHidden",n="msvisibilitychange"):void 0!==document.webkitHidden&&(t="webkitHidden",n="webkitvisibilitychange");var o=document[t];e.Utils.addListener(document,n,function(n){o!=document[t]&&(document[t]?(e.trigger("tab_hidden"),e.PageTracking.setIdle("browser tab switch")):(e.trigger("tab_visible"),e.PageTracking.pingSession()),o=document[t])})},clock:function(){var n="Total time spent on Page in this Session: "+((r+=1)/60).toFixed(2)+" min";if(e.deBugger("pages",n),r>0&&r%t==0){var o=new Date;o.setTime(o.getTime()+18e5),c.createCookie("lead_session",r,o),e.trigger("session_heartbeat",r)}},inactiveClock:function(){var t="Time until Session Timeout: "+((1800-(s+=1))/60).toFixed(2)+" min";e.deBugger("pages",t),s>1800&&(e.trigger("session_end",InboundLeadData),e.Utils.eraseCookie("lead_session"),s=0,clearTimeout(u))},stopClock:function(){a=!0,clearTimeout(l),clearTimeout(u),u=setInterval(e.PageTracking.inactiveClock,1e3)},restartClock:function(){a=!1,e.trigger("session_resume"),e.deBugger("pages","Activity resumed. Session Active"),clearTimeout(l),s=0,clearTimeout(u),l=setInterval(e.PageTracking.clock,1e3)},turnOff:function(){e.PageTracking.setIdle(),i=!0},turnOn:function(){i=!1},startSession:function(){new Date;if(o=!0,l=setInterval(e.PageTracking.clock,1e3),c.readCookie("lead_session"))e.trigger("session_active");else{e.trigger("session_start");var t=new Date;t.setTime(t.getTime()+18e5),e.Utils.createCookie("lead_session",1,t)}this.pingSession()},resetInactiveFunc:function(){s=0,clearTimeout(u)},pingSession:function(t){i||(o||e.PageTracking.startSession(),a&&e.PageTracking.restartClock(),clearTimeout(d),d=setTimeout(e.PageTracking.setIdle,1e3*n+100),void 0!==t&&"mousemove"===t.type&&e.PageTracking.mouseEvents(t))},mouseEvents:function(t){t.pageY<=5&&e.trigger("tab_mouseout")},getPageViews:function(){if(e.Utils.checkLocalStorage()){var t=localStorage.getItem(f),n=JSON.parse(t);return n}},isRevisit:function(e){var t=!1,n=(e=e||{})[p];return void 0!==n&&null!==n&&(t=!0),t},triggerPageView:function(t){var n={title:document.title,url:document.location.href,path:document.location.pathname,count:1};t?(g[p].push(m),n.count=g[p].length,e.trigger("page_revisit",n)):(g[p]=[],g[p].push(m),e.trigger("page_first_visit",n)),e.trigger("page_visit",n),e.totalStorage(f,g);document.onreadystatechange=function(){"loading"!==document.readyState&&e.PageTracking.storePageView()}},CheckTimeOut:function(){var t,n=this.isRevisit(g);if(n){var o=g[p].length-1,a=g[p][o],i=Math.abs(new Date(a).getTime()-new Date(m).getTime());i>h?(t="Timeout Happened. Page view fired",this.triggerPageView(n)):(time_left=.001*Math.abs(h-i),t=h/1e3+" sec timeout not done: "+time_left+" seconds left")}else this.triggerPageView(n);e.deBugger("pages",t)},storePageView:function(){"off"==inbound_settings.page_tracking&&"landing-page"!=inbound_settings.post_type||setTimeout(function(){var t=e.Utils.readCookie("wp_lead_id")?e.Utils.readCookie("wp_lead_id"):"",n=e.Utils.readCookie("wp_lead_uid")?e.Utils.readCookie("wp_lead_uid"):"",o=e.totalStorage("wp_cta_loaded"),a=e.totalStorage("wp_cta_impressions");stored=!0,e.totalStorage("wp_cta_impressions",{});var i={action:"inbound_track_lead",wp_lead_uid:n,wp_lead_id:t,page_id:inbound_settings.post_id,variation_id:inbound_settings.variation_id,post_type:inbound_settings.post_type,current_url:window.location.href,page_views:JSON.stringify(e.PageTracking.getPageViews()),cta_impressions:JSON.stringify(a),cta_history:JSON.stringify(o),json:"0"};e.Utils.ajaxPost(inbound_settings.admin_url,i,function(e){})},200)}},e}(_inbound||{});_inbound.init(),InboundLeadData=_inbound.totalStorage("inbound_lead_data")||null;
1
+ /*! Inbound Analyticsv1.0.0 | (c) 2017 Inbound Now | https://github.com/inboundnow/cta */
2
+ function inboundFormNoRedirect(){if(null==window.frames.frameElement)e=document.querySelectorAll("button.inbound-button-submit[disabled]")[0];else if("iframe"==window.frames.frameElement.tagName.toLowerCase())var e=window.frames.frameElement.contentWindow.document.querySelectorAll("button.inbound-button-submit")[0];if(void 0!==e){var t=e.form,n=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])');0!=n.length&&"IA=="!=n[0].value||(t.action="javascript:void(0)")}}function inboundFormNoRedirectContent(){if(null==window.frames.frameElement)e=document.querySelectorAll("button.inbound-button-submit[disabled]")[0];else if("iframe"==window.frames.frameElement.tagName.toLowerCase())var e=window.frames.frameElement.contentWindow.document.querySelectorAll("button.inbound-button-submit")[0];if(void 0!==e){var t=e.form.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),n=jQuery(e).css("background"),o=jQuery(e).css("color"),a=jQuery(e).css("height"),i=e.getElementsByClassName("inbound-form-spinner");0!=t.length&&"IA=="!=t[0].value||(jQuery(i).remove(),jQuery(e).prepend('<div id="redir-check"><i class="fa fa-check-square" aria-hidden="true" style="background='+n+"; color="+o+"; font-size:calc("+a+' * .42);"></i></div>'))}}var inbound_data=inbound_data||{},_inboundOptions=_inboundOptions||{},_gaq=_gaq||[],_inbound=function(e){var t={timeout:inbound_settings.is_admin?500:1e4,formAutoTracking:!0,formAutoPopulation:!0},n={init:function(){_inbound.Utils.init(),_inbound.Utils.domReady(window,function(){_inbound.DomLoaded()})},DomLoaded:function(){_inbound.PageTracking.init(),_inbound.Forms.init(),_inbound.Utils.setUrlParams(),_inbound.LeadsAPI.init(),setTimeout(function(){_inbound.Forms.init()},2e3),_inbound.trigger("analytics_ready")},extend:function(e,t){var n,o={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n]);return o},debug:function(e,t){},deBugger:function(e,t,n){if(console){var o,a,i,r=document.location.hash?document.location.hash:"",s=r.indexOf("#debug")>-1,t=t||!1;r&&r.match(/debug/)&&(i=(r=r.split("-"))[1]),a="true"===_inbound.Utils.readCookie("inbound_debug"),((o="true"===_inbound.Utils.readCookie("inbound_debug_"+e))||s||a)&&(t&&"string"==typeof t&&(a||"all"===i?console.log('logAll "'+e+'" =>',t):o?console.log('log "'+e+'" =>',t):e===i&&console.log('#log "'+e+'" =>',t)),n&&n instanceof Function&&n())}}},o=n.extend(t,e);return n.Settings=o||{},n}(_inboundOptions),_inboundHooks=function(e){return e.hooks=new function(){function e(e,t,n,o){if(i[e][t])if(n){var a,r=i[e][t];if(o)for(a=r.length;a--;){var s=r[a];s.callback===n&&s.context===o&&r.splice(a,1)}else for(a=r.length;a--;)r[a].callback===n&&r.splice(a,1)}else i[e][t]=[]}function t(e,t,o,a,r){var s={callback:o,priority:a,context:r},l=i[e][t];l?(l.push(s),l=n(l)):l=[s],i[e][t]=l}function n(e){for(var t,n,o,a=1,i=e.length;a<i;a++){for(t=e[a],n=a;(o=e[n-1])&&o.priority>t.priority;)e[n]=e[n-1],--n;e[n]=t}return e}function o(e,t,n){var o=i[e][t];if(!o)return"filters"===e&&n[0];var a=0,r=o.length;if("filters"===e)for(;a<r;a++)n[0]=o[a].callback.apply(o[a].context,n);else for(;a<r;a++)o[a].callback.apply(o[a].context,n);return"filters"!==e||n[0]}var a={removeFilter:function(t,n){return"string"==typeof t&&e("filters",t,n),a},applyFilters:function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t?o("filters",t,e):a},addFilter:function(e,n,o,i){return"string"==typeof e&&"function"==typeof n&&t("filters",e,n,o=parseInt(o||10,10)),a},removeAction:function(t,n){return"string"==typeof t&&e("actions",t,n),a},doAction:function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t&&o("actions",t,e),a},addAction:function(e,n,o,i){return"string"==typeof e&&"function"==typeof n&&t("actions",e,n,o=parseInt(o||10,10),i),a}},i={actions:{},filters:{}};return a},e.add_action=function(){var t=arguments[0].split(" ");for(k in t)arguments[0]="inbound."+t[k],e.hooks.addAction.apply(this,arguments);return this},e.remove_action=function(){return arguments[0]="inbound."+arguments[0],e.hooks.removeAction.apply(this,arguments),this},e.do_action=function(){return arguments[0]="inbound."+arguments[0],e.hooks.doAction.apply(this,arguments),this},e.add_filter=function(){return arguments[0]="inbound."+arguments[0],e.hooks.addFilter.apply(this,arguments),this},e.remove_filter=function(){return arguments[0]="inbound."+arguments[0],e.hooks.removeFilter.apply(this,arguments),this},e.apply_filters=function(){return arguments[0]="inbound."+arguments[0],e.hooks.applyFilters.apply(this,arguments)},e}(_inbound||{}),_inboundUtils=function(e){var t,n=window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,o=(Object.prototype.toString,{api_host:("https:"==location.protocol?"https://":"http://")+location.hostname+location.pathname.replace(/\/#x2F;,""),track_pageview:!0,track_links_timeout:300,cookie_name:"_sp",cookie_expiration:365,cookie_domain:(host=location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}#x2F;i))?host[0]:""});return e.Utils={init:function(){this.polyFills(),this.checkLocalStorage(),this.SetUID(),this.storeReferralData()},polyFills:function(){window.console||(window.console={});for(var e=["log","info","warn","error","debug","trace","dir","group","groupCollapsed","groupEnd","time","timeEnd","profile","profileEnd","dirxml","assert","count","markTimeline","timeStamp","clear"],t=0;t<e.length;t++)window.console[e[t]]||(window.console[e[t]]=function(){});Date.prototype.toISOString||function(){function e(e){var t=String(e);return 1===t.length&&(t="0"+t),t}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+e(this.getUTCMonth()+1)+"-"+e(this.getUTCDate())+"T"+e(this.getUTCHours())+":"+e(this.getUTCMinutes())+":"+e(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}();try{new CustomEvent("?")}catch(e){this.CustomEvent=function(e,t){function n(t,n,o,a){this["init"+e](t,n,o,a),"detail"in this||(this.detail=a)}return function(o,a){var i=document.createEvent(e);return null!==o?n.call(i,o,(a||(a=t)).bubbles,a.cancelable,a.detail):i.initCustomEvent=n,i}}(this.CustomEvent?"CustomEvent":"Event",{bubbles:!1,cancelable:!1,detail:null})}document.querySelectorAll||(document.querySelectorAll=function(e){var t,n=document.createElement("style"),o=[];for(document.documentElement.firstChild.appendChild(n),document._qsa=[],n.styleSheet.cssText=e+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),n.parentNode.removeChild(n);document._qsa.length;)(t=document._qsa.shift()).style.removeAttribute("x-qsa"),o.push(t);return document._qsa=null,o}),document.querySelector||(document.querySelector=function(e){var t=document.querySelectorAll(e);return t.length?t[0]:null}),!("innerText"in document.createElement("a"))&&"getSelection"in window&&HTMLElement.prototype.__defineGetter__("innerText",function(){for(var e,t=window.getSelection(),n=[],o=0;o<t.rangeCount;o++)n[o]=t.getRangeAt(o);t.removeAllRanges(),t.selectAllChildren(this),e=t.toString(),t.removeAllRanges();for(o=0;o<n.length;o++)t.addRange(n[o]);return e})},createCookie:function(e,t,n){var o="";if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),o="; expires="+a.toGMTString()}document.cookie=e+"="+t+o+"; path=/"},readCookie:function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var a=n[o];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t))return a.substring(t.length,a.length)}return null},eraseCookie:function(e){this.createCookie(e,"",-1)},getAllCookies:function(){var t={};if(document.cookie&&""!==document.cookie)for(var n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o].split("=");a[0]=a[0].replace(/^ /,""),t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return e.totalStorage("inbound_cookies",t),t},setUrlParams:function(){var n={};!function(){for(var e,t=function(e){return decodeURIComponent(e).replace(/\+/g," ")},o=window.location.search.substring(1),a=/([^&=]+)=?([^&]*)/g;e=a.exec(o);)if("-1"==e[1].indexOf("["))n[t(e[1])]=t(e[2]);else{var i=e[1].indexOf("["),r=e[1].slice(i+1,e[1].indexOf("]",i)),s=t(e[1].slice(0,i));"object"!=typeof n[s]&&(n[t(s)]={},n[t(s)].length=0),r?n[t(s)][t(r)]=t(e[2]):Array.prototype.push.call(n[t(s)],t(e[2]))}}();for(var o in n)if("action"!=o)if("object"==typeof n[o])for(var a in n[o])this.createCookie(a,n[o][a],30);else this.createCookie(o,n[o],30);if(t){var i=e.totalStorage("inbound_url_params")||{},r=this.mergeObjs(i,n);e.totalStorage("inbound_url_params",r)}var s={option1:"yo",option2:"woooo"};e.trigger("url_parameters",n,s)},getAllUrlParams:function(){n={};if(t)var n=e.totalStorage("inbound_url_params");return n},getParameterVal:function(e,t){return(RegExp(e+"=(.+?)(&|$)").exec(t)||[,!1])[1]},checkLocalStorage:function(){if("localStorage"in window)try{ls=void 0===window.localStorage?void 0:window.localStorage,t="undefined"!=typeof ls&&void 0!==window.JSON}catch(e){t=!1}return t},showLocalStorageSize:function(){function e(e){return 2*e.length}function t(e){return e/1024/1024}var n=Object.keys(localStorage).map(function(t){return{name:t,size:e(localStorage[t])}}).map(function(e){return e.size=t(e.size).toFixed(2)+" MB",e});console.table(n)},addDays:function(e,t){return new Date(e.getTime()+24*t*60*60*1e3)},GetDate:function(){var e=new Date,t=e.getDate(),n=t<10?"0":"",o=e.getFullYear(),a=e.getHours(),i=a<10?"0":"",r=e.getMinutes(),s=r<10?"0":"",l=e.getSeconds(),u=l<10?"0":"",d=e.getMonth()+1;return o+"/"+(d<10?"0":"")+d+"/"+n+t+" "+i+a+":"+s+r+":"+u+l},SetSessionTimeout:function(){this.readCookie("lead_session_expire");var e=new Date;e.setTime(e.getTime()+18e5),this.createCookie("lead_session_expire",!0,e)},storeReferralData:function(){var t=new Date,n=document.referrer||"Direct Traffic",o=e.Utils.readCookie("inbound_referral_site"),a=e.totalStorage("inbound_original_referral");t.setTime(t.getTime()+18e5),o||this.createCookie("inbound_referral_site",n,t),a||e.totalStorage("inbound_original_referral",a)},CreateUID:function(e){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),n="";e||(e=Math.floor(Math.random()*t.length));for(var o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n},generateGUID:function(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,guid)},SetUID:function(e){if(!this.readCookie("wp_lead_uid")){var t=e||this.CreateUID(35);this.createCookie("wp_lead_uid",t)}},countProperties:function(e){var t=0;for(var n in e)e.hasOwnProperty(n)&&++t;return t},mergeObjs:function(e,t){var n={};for(var o in e)n[o]=e[o];for(var o in t)n[o]=t[o];return n},hasClass:function(e,t){if("classList"in document.documentElement)n=t.classList.contains(e);else var n=new RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className);return n},addClass:function(e,t){"classList"in document.documentElement?t.classList.add(e):this.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(e,t){"classList"in document.documentElement?t.classList.remove(e):this.hasClass(t,e)&&(t.className=t.className.replace(new RegExp("(^|\\s)*"+e+"(\\s|$)*","g"),""))},removeElement:function(e){e.parentNode.removeChild(e)},trim:function(e){return e=e.replace(/(^\s*)|(\s*$)/gi,""),e=e.replace(/[ ]{2,}/gi," "),e=e.replace(/\n /,"\n")},ajaxPolyFill:function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;for(var e,t=["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"],n=0;n<t.length;n++)try{e=new ActiveXObject(t[n]);break}catch(e){}return e},ajaxSendData:function(e,t,n,o,a){var i=this.ajaxPolyFill();setTimeout(function(){i.open(n,e,!0),i.onreadystatechange=function(){4==i.readyState&&t(i.responseText)},"POST"==n&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(o)},100)},ajaxGet:function(e,t,n,o){var a=[];for(var i in t)a.push(encodeURIComponent(i)+"="+encodeURIComponent(t[i]));this.ajaxSendData(e+"?"+a.join("&"),n,"GET",null,o)},ajaxPost:function(e,t,n,o){var a=[];for(var i in t)a.push(encodeURIComponent(i)+"="+encodeURIComponent(t[i]));this.ajaxSendData(e,n,"POST",a.join("&"),o)},sendEvent:function(e,t,a){t=t||{},async=!0;var i=getCookie();if(i){var r;for(r in i)t[r]=i[r]}t.id||(t.id=getId());var s={e:e,t:(new Date).toISOString(),kv:t},l=o.api_host+"/track?data="+encodeURIComponent(JSON.stringify(s));if(n){var u=new XMLHttpRequest;u.open("GET",l,async),u.withCredentials=async,u.send(null)}else{var d=document.createElement("script");d.type="text/javascript",d.async=async,d.defer=async,d.src=l;var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(d,c)}return action(a),self},domReady:function(e,t){var n=!1,o=!0,a=e.document,i=a.documentElement,r=a.addEventListener?"addEventListener":"attachEvent",s=a.addEventListener?"removeEventListener":"detachEvent",l=a.addEventListener?"":"on",u=function(o){"readystatechange"==o.type&&"complete"!=a.readyState||(("load"==o.type?e:a)[s](l+o.type,u,!1),!n&&(n=!0)&&t.call(e,o.type||o))},d=function(){try{i.doScroll("left")}catch(e){return void setTimeout(d,50)}u("poll")};if("complete"==a.readyState)t.call(e,"lazy");else{if(a.createEventObject&&i.doScroll){try{o=!e.frameElement}catch(e){}o&&d()}a[r](l+"DOMContentLoaded",u,!1),a[r](l+"readystatechange",u,!1),e[r](l+"load",u,!1)}},addListener:function(e,t,n){e&&(e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n)},removeListener:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},throttle:function(e,t){var n,o,a,i=null,r=0,s=function(){r=new Date,i=null,a=e.apply(n,o)};return function(){var l=new Date;r||(r=l);var u=t-(l-r);return n=this,o=arguments,u<=0?(clearTimeout(i),i=null,r=l,a=e.apply(n,o)):i||(i=setTimeout(s,u)),a}},checkTypeofGA:function(){"function"==typeof ga&&(universalGA=!0),void 0!==_gaq&&"function"==typeof _gaq.push&&(classicGA=!0),"undefined"!=typeof dataLayer&&"function"==typeof dataLayer.push&&(googleTagManager=!0)},cacheSearchData:function(n,o){if(t){var a=e.totalStorage.getItem("inbound_search_storage");if(a)a.unshift(n),e.totalStorage.setItem("inbound_search_storage",a);else{var i=[n];e.totalStorage.setItem("inbound_search_storage",i)}}else{var r=JSON.stringify(n),s=this.readCookie("inbound_search_storage");s&&(r+="SPLIT-TOKEN"+s),this.createCookie("inbound_search_storage",r,"180")}e.Forms.releaseFormSubmit(o)},storeSearchData:function(){if(inbound_settings.wp_lead_data.lead_id&&inbound_settings.wp_lead_data.lead_nonce){var t=[],n=e.totalStorage.getItem("inbound_search_storage"),o=this.readCookie("inbound_search_storage");if(n||o){if(o){o=o.split("SPLIT-TOKEN");for(var a in o)t.push(JSON.parse(o[a]))}n&&(t=t.concat(n)),t.sort(function(e,t){return e.timestamp-t.timestamp});var i={action:"inbound_search_store",data:t=encodeURIComponent(JSON.stringify(t)),nonce:inbound_settings.wp_lead_data.lead_nonce,lead_id:inbound_settings.wp_lead_data.lead_id};callback=function(t){t&&(t=JSON.parse(t)),t.success&&(console.log(t.success),e.Utils.eraseCookie("inbound_search_storage"),e.totalStorage.deleteItem("inbound_search_storage")),t.error&&console.log(t.error)},this.ajaxPost(inbound_settings.admin_url,i,callback)}}}},e}(_inbound||{}),InboundForms=function(e){var t=e.Utils,n=[],o=[],a=[],r={},s=e.Settings,l=["first name","last name","name","email","e-mail","phone","website","job title","your favorite food","company","tele","address","comment"];if(e.Forms={init:function(){e.Forms.runFieldMappingFilters(),e.Forms.formTrackInit(),e.Forms.searchTrackInit()},runFieldMappingFilters:function(){l=e.hooks.applyFilters("forms.field_map",l)},debug:function(e,t){return},formTrackInit:function(){for(var e=0;e<window.document.forms.length;e++){var t=window.document.forms[e];t.dataset.formProcessed||(t.dataset.formProcessed=!0,this.checkTrackStatus(t)&&(this.attachFormSubmitEvent(t),this.initFormMapping(t)))}},searchTrackInit:function(){if("off"!=inbound_settings.search_tracking&&!r.searchTrackInit){for(var e=0;e<window.document.forms.length;e++){var n=window.document.forms[e];n.dataset.searchChecked||(n.dataset.searchChecked=!0,this.checkSearchTrackStatus(n)&&this.attachSearchFormSubmitEvent(n))}t.storeSearchData(),r.searchTrackInit=!0}},checkTrackStatus:function(t){var n=t.getAttribute("class");if(""!==n&&null!==n)return n.toLowerCase().indexOf("wpl-track-me")>-1||(n.toLowerCase().indexOf("inbound-track")>-1||(cb=function(){console.log(t)},e.deBugger("forms","This form not tracked. Please assign on in settings...",cb),!1))},checkSearchTrackStatus:function(t){var n=t.getAttribute("class"),o=t.getAttribute("id");return""!==n&&null!==n&&n.toLowerCase().indexOf("search")>-1||(""===o||null===o?(cb=function(){console.log(t)},e.deBugger("searches","This search form is not tracked. Please assign on in settings...",cb),!1):o.toLowerCase().indexOf("search")>-1||void 0)},loopClassSelectors:function(n,o){for(var a=n.length-1;a>=0;a--){var i=t.trim(n[a]);-1===i.indexOf("#")&&-1===i.indexOf(".")&&(i="#"+i),(i=document.querySelector(i))&&("add"===o?(e.Utils.addClass("wpl-track-me",i),e.Utils.addClass("inbound-track",i)):(e.Utils.removeClass("wpl-track-me",i),e.Utils.removeClass("inbound-track",i)))}},initFormMapping:function(t){for(var n=[],o=0;o<t.elements.length;o++)formInput=t.elements[o],"hidden"!==formInput.type?(this.mapField(formInput),this.rememberInputValues(formInput),s.formAutoPopulation&&!e.Utils.hasClass("nopopulate",t)&&this.fillInputValues(formInput)):n.push(formInput);for(var a=n.length-1;a>=0;a--)formInput=n[a],this.mapField(formInput)},mapField:function(o){var a=o.id||!1,r=o.name||!1,s=this.getInputLabel(o);if(s&&this.ignoreFieldByLabel(s[0].innerText))return o.dataset.ignoreFormField=!0,!1;for(i=0;i<l.length;i++){var u=!1,d=l[i],c=t.trim(d),m=c.replace(/ /g,"_");r&&r.toLowerCase().indexOf(c)>-1?(u=!0,e.deBugger("forms","Found matching name attribute for -> "+c)):a&&a.toLowerCase().indexOf(c)>-1?(u=!0,e.deBugger("forms","Found matching ID attribute for ->"+c)):s?s[0].innerText.toLowerCase().indexOf(c)>-1&&(u=!0,e.deBugger("forms","Found matching sibling label for -> "+c)):n.push(c),u&&(this.addDataAttr(o,m),this.removeArrayItem(l,c),i--)}return inbound_data},formListener:function(t){t.preventDefault(),e.Forms.saveFormData(t.target),document.body.style.cursor="wait"},searchFormListener:function(t){t.preventDefault(),e.Forms.saveSearchData(t.target)},attachFormSubmitEvent:function(e){t.addListener(e,"submit",this.formListener);document.querySelector(".inbound-email")},attachSearchFormSubmitEvent:function(e){t.addListener(e,"submit",this.searchFormListener)},ignoreFieldByLabel:function(t){var n=!1;return!!t&&(-1==t.toLowerCase().indexOf("credit card")&&-1==t.toLowerCase().indexOf("card number")||(n=!0),-1==t.toLowerCase().indexOf("expiration")&&-1==t.toLowerCase().indexOf("expiry")||(n=!0),"month"!=t.toLowerCase()&&"mm"!=t.toLowerCase()&&"yy"!=t.toLowerCase()&&"yyyy"!=t.toLowerCase()&&"year"!=t.toLowerCase()||(n=!0),-1==t.toLowerCase().indexOf("cvv")&&-1==t.toLowerCase().indexOf("cvc")&&-1==t.toLowerCase().indexOf("secure code")&&-1==t.toLowerCase().indexOf("security code")||(n=!0),n&&e.deBugger("forms","ignore "+t),n)},ignoreFieldByValue:function(e){var t=!1;if(!e)return!1;if("visa"!=e.toLowerCase()&&"mastercard"!=e.toLowerCase()&&"american express"!=e.toLowerCase()&&"amex"!=e.toLowerCase()&&"discover"!=e.toLowerCase()||(t=!0),new RegExp("/^[0-9]+#x2F;").test(e)){var n=e.replace(" ","");this.isInt(n)&&n.length>=16&&(t=!0)}return t},isInt:function(e){return"number"==typeof e&&isFinite(e)&&e%1==0},releaseFormSubmit:function(e){document.body.style.cursor="default",t.removeClass("wpl-track-me",e),t.removeListener(e,"submit",this.formListener);var n=e.getAttribute("class");if(""!==n&&null!==n&&-1!=n.toLowerCase().indexOf("wpcf7-form"))return setTimeout(function(){document.body.style.cursor="default"},300),!0;e.submit(),setTimeout(function(){for(var t=0;t<e.elements.length;t++)formInput=e.elements[t],type=formInput.type||!1,"submit"===type&&"submit"===formInput.name&&e.elements[t].click()},2e3)},saveFormData:function(n){for(var i=i||{},r=0;r<n.elements.length;r++)if(formInput=n.elements[r],multiple=!1,formInput.name){if(formInput.dataset.ignoreFormField){e.deBugger("forms","ignore "+formInput.name);continue}switch(inputName=formInput.name.replace(/\[([^\[]*)\]/g,"%5B%5D$1"),i[inputName]||(i[inputName]={}),formInput.type&&(i[inputName].type=formInput.type),i[inputName].name||(i[inputName].name=formInput.name),formInput.dataset.mapFormField&&(i[inputName].map=formInput.dataset.mapFormField),formInput.nodeName){case"INPUT":if(!1===(l=this.getInputValue(formInput)))continue;break;case"TEXTAREA":l=formInput.value;break;case"SELECT":if(formInput.multiple){values=[],multiple=!0;for(var s=0;s<formInput.length;s++)formInput[s].selected&&values.push(encodeURIComponent(formInput[s].value))}else l=formInput.value}if(e.deBugger("forms","Input Value = "+l),l){i[inputName].value||(i[inputName].value=[]),i[inputName].value.push(multiple?values.join(","):encodeURIComponent(l));var l=multiple?values.join(","):encodeURIComponent(l)}}e.deBugger("forms",i);for(var u in i){var d=i[u].value,c=i[u].map;if(void 0!==d&&null!=d&&""!=d&&o.push(u+"="+i[u].value.join(",")),void 0!==c&&null!=c&&i[u].value&&(a.push(c+"="+i[u].value.join(",")),"email"===u))var m=i[u].value.join(",")}var f=o.join("&");e.deBugger("forms","Stringified Raw Form PARAMS: "+f);var g=a.join("&");e.deBugger("forms","Stringified Mapped PARAMS"+g),(m=t.getParameterVal("email",g)||t.readCookie("wp_lead_email"))||(m=t.getParameterVal("wpleads_email_address",g));var p=t.getParameterVal("name",g),h=t.getParameterVal("first_name",g),v=t.getParameterVal("last_name",g);if(!v&&h&&(_=decodeURI(h).split(" ")).length>0&&(h=_[0],v=_[1]),p&&!v&&!h){var _=decodeURI(p).split(" ");_.length>0&&(h=_[0],v=_[1])}p=h&&v?h+" "+v:p,h||(h=""),v||(v=""),e.deBugger("forms","fName = "+h),e.deBugger("forms","lName = "+v),e.deBugger("forms","fullName = "+p);var b=e.totalStorage("page_views")||{},y=e.totalStorage("inbound_url_params")||{},w=n.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),k=!1;if(0==w.length||"IA=="==w[0].value)k=!0;var S=n.querySelectorAll('input[value][type="hidden"][name="inbound_form_id"]');S=S.length>0?S[0].value:0;if("undefined"!=typeof landing_path_info)I=landing_path_info.variation;else if("undefined"!=typeof cta_path_info)I=cta_path_info.variation;else var I=inbound_settings.variation_id;var C=inbound_settings.post_type||"page",L=inbound_settings.post_id||0;search_data={},formData={action:"inbound_lead_store",email:m,full_name:p,first_name:h,last_name:v,raw_params:f,mapped_params:g,url_params:JSON.stringify(y),search_data:"test",page_views:JSON.stringify(b),post_type:C,page_id:L,variation:I,source:t.readCookie("inbound_referral_site"),inbound_submitted:k,inbound_form_id:S,inbound_nonce:inbound_settings.ajax_nonce,event:n},callback=function(o){e.deBugger("forms","Lead Created with ID: "+o),o=parseInt(o,10),formData.leadID=o,o&&(t.createCookie("wp_lead_id",o),e.totalStorage.deleteItem("page_views"),e.totalStorage.deleteItem("tracking_events")),e.trigger("form_after_submission",formData),e.Forms.releaseFormSubmit(n)},e.trigger("form_before_submission",formData),t.ajaxPost(inbound_settings.admin_url,formData,callback)},saveSearchData:function(n){for(var o=o||{},a=0;a<n.elements.length;a++)if(formInput=n.elements[a],multiple=!1,formInput.name){if(formInput.dataset.ignoreFormField){e.deBugger("searches","ignore "+formInput.name);continue}switch(c=formInput.name.replace(/\[([^\[]*)\]/g,"%5B%5D$1"),o[c]||(o[c]={}),formInput.type&&(o[c].type=formInput.type),o[c].name||(o[c].name=formInput.name),formInput.dataset.mapFormField&&(o[c].map=formInput.dataset.mapFormField),formInput.nodeName){case"INPUT":if(!1===(r=this.getInputValue(formInput)))continue;break;case"TEXTAREA":r=formInput.value;break;case"SELECT":if(formInput.multiple){values=[],multiple=!0;for(var i=0;i<formInput.length;i++)formInput[i].selected&&values.push(encodeURIComponent(formInput[i].value))}else r=formInput.value}if(e.deBugger("searches","Input Value = "+r),r){o[c].value||(o[c].value=[]),o[c].value.push(multiple?values.join(","):encodeURIComponent(r));var r=multiple?values.join(","):encodeURIComponent(r)}}e.deBugger("searches",o);var s=[];for(var l in o){var u=o[l].value,d=o[l].type,c=o[l].name;void 0!==u&&null!=u&&""!=u&&("search"==d?s.push("search_text|value|"+o[l].value):"s"==c&&s.push("search_text|value|"+o[l].value))}s[0]||e.Forms.releaseFormSubmit(n);var m=s.join("|field|");if(e.deBugger("searches","Stringified Search Form PARAMS: "+m),"undefined"!=typeof landing_path_info)f=landing_path_info.variation;else if("undefined"!=typeof cta_path_info)f=cta_path_info.variation;else var f=inbound_settings.variation_id;var g=inbound_settings.post_type||"page",p=inbound_settings.post_id||0,h=t.readCookie("wp_lead_uid");inbound_settings.wp_lead_data.lead_email?email=inbound_settings.wp_lead_data.lead_email:t.readCookie("inbound_wpleads_email_address")?email=t.readCookie("inbound_wpleads_email_address"):email="",searchData={email:email,search_data:m,user_UID:h,post_type:g,page_id:p,variation:f,source:t.readCookie("inbound_referral_site"),ip_address:inbound_settings.ip_address,timestamp:Math.floor((new Date).getTime()/1e3)},e.trigger("search_before_caching",searchData),inbound_settings.wp_lead_data.lead_id?(searchData.lead_id=inbound_settings.wp_lead_data.lead_id,t.cacheSearchData(searchData,n)):t.cacheSearchData(searchData,n)},rememberInputValues:function(n){n.name&&n.name;var o=n.type?n.type:"text";if("submit"===o||"hidden"===o||"file"===o||"password"===o||n.dataset.ignoreFormField)return!1;t.addListener(n,"change",function(n){if(n.target.name){if("checkbox"!==o)var a=n.target.value;else for(var i=[],r=document.querySelectorAll('input[name="'+n.target.name+'"]'),s=0;s<r.length;s++)r[s].checked&&i.push(r[s].value),a=i.join(",");inputData={name:n.target.name,node:n.target.nodeName.toLowerCase(),type:o,value:a,mapping:n.target.dataset.mapFormField},e.trigger("form_input_change",inputData),t.createCookie("inbound_"+n.target.name,encodeURIComponent(a))}})},fillInputValues:function(e){var n=e.name?"inbound_"+e.name:"",o=e.type?e.type:"text";if("submit"===o||"hidden"===o||"file"===o||"password"===o)return!1;if(t.readCookie(n)&&"comment"!=n)if(value=decodeURIComponent(t.readCookie(n)),"checkbox"===o||"radio"===o)for(var a=value.split(","),i=0;i<a.length;i++)e.value.indexOf(a[i])>-1&&(e.checked=!0);else"undefined"!==value&&(e.value=value)},getInputLabel:function(e){var t;return(t=this.siblingsIsLabel(e))?t:!!(t=this.CheckParentForLabel(e))&&t},getInputValue:function(e){var t=!1;switch(e.type){case"radio":case"checkbox":e.checked&&(t=e.value);break;case"text":case"hidden":default:t=e.value}return t},addDataAttr:function(e,t){for(var n=document.getElementsByName(e.name),o=n.length-1;o>=0;o--)e.dataset.mapFormField||(n[o].dataset.mapFormField=t)},removeArrayItem:function(e,t){if(e.indexOf)index=e.indexOf(t);else for(index=e.length-1;index>=0&&e[index]!==t;--index);index>=0&&e.splice(index,1)},siblingsIsLabel:function(e){for(var t=this.getSiblings(e),n=[],o=t.length-1;o>=0;o--)"label"===t[o].nodeName.toLowerCase()&&n.push(t[o]);return n.length>0&&n.length<2&&n},getChildren:function(e,t){for(var n=[];e;e=e.nextSibling)1==e.nodeType&&e!=t&&n.push(e);return n},getSiblings:function(e){return this.getChildren(e.parentNode.firstChild,e)},CheckParentForLabel:function(e){if("FORM"===e.nodeName)return null;do{var t=e.getElementsByTagName("label");if(t.length>0&&t.length<2)return e.getElementsByTagName("label")}while(e=e.parentNode);return null},mailCheck:function(){var e=document.querySelector(".inbound-email");e&&(t.addListener(e,"blur",this.mailCheck),u.run({email:document.querySelector(".inbound-email").value,suggested:function(n){var o=document.querySelector(".email_suggestion");o&&t.removeElement(o);var a=document.createElement("span");a.innerHTML="<span class=\"email_suggestion\">Did youu mean <b><i id='email_correction' style='cursor: pointer;' title=\"click to update\">"+n.full+"</b></i>?</span>",e.parentNode.insertBefore(a,e.nextSibling);var i=document.getElementById("email_correction");t.addListener(i,"click",function(){e.value=i.innerHTML,i.parentNode.parentNode.innerHTML="Fixed!"})},empty:function(){}}))}},void 0===u)var u={domainThreshold:1,topLevelThreshold:3,defaultDomains:["yahoo.com","google.com","hotmail.com","gmail.com","me.com","aol.com","mac.com","live.com","comcast.net","googlemail.com","msn.com","hotmail.co.uk","yahoo.co.uk","facebook.com","verizon.net","sbcglobal.net","att.net","gmx.com","mail.com","outlook.com","icloud.com"],defaultTopLevelDomains:["co.jp","co.uk","com","net","org","info","edu","gov","mil","ca","de"],run:function(e){e.domains=e.domains||u.defaultDomains,e.topLevelDomains=e.topLevelDomains||u.defaultTopLevelDomains,e.distanceFunction=e.distanceFunction||u.sift3Distance;var t=function(e){return e},n=e.suggested||t,o=e.empty||t,a=u.suggest(u.encodeEmail(e.email),e.domains,e.topLevelDomains,e.distanceFunction);return a?n(a):o()},suggest:function(e,t,n,o){e=e.toLowerCase();var a=this.splitEmail(e),i=this.findClosestDomain(a.domain,t,o,this.domainThreshold);if(i){if(i!=a.domain)return{address:a.address,domain:i,full:a.address+"@"+i}}else{var r=this.findClosestDomain(a.topLevelDomain,n,o,this.topLevelThreshold);if(a.domain&&r&&r!=a.topLevelDomain){var s=a.domain;return i=s.substring(0,s.lastIndexOf(a.topLevelDomain))+r,{address:a.address,domain:i,full:a.address+"@"+i}}}return!1},findClosestDomain:function(e,t,n,o){o=o||this.topLevelThreshold;var a,i=99,r=null;if(!e||!t)return!1;n||(n=this.sift3Distance);for(var s=0;s<t.length;s++){if(e===t[s])return e;(a=n(e,t[s]))<i&&(i=a,r=t[s])}return i<=o&&null!==r&&r},sift3Distance:function(e,t){if(null===e||0===e.length)return null===t||0===t.length?0:t.length;if(null===t||0===t.length)return e.length;for(var n=0,o=0,a=0,i=0;n+o<e.length&&n+a<t.length;){if(e.charAt(n+o)==t.charAt(n+a))i++;else{o=0,a=0;for(var r=0;r<5;r++){if(n+r<e.length&&e.charAt(n+r)==t.charAt(n)){o=r;break}if(n+r<t.length&&e.charAt(n)==t.charAt(n+r)){a=r;break}}}n++}return(e.length+t.length)/2-i},splitEmail:function(e){var t=e.trim().split("@");if(t.length<2)return!1;for(i=0;i<t.length;i++)if(""===t[i])return!1;var n=t.pop(),o=n.split("."),a="";if(0===o.length)return!1;if(1==o.length)a=o[0];else{for(var i=1;i<o.length;i++)a+=o[i]+".";o.length>=2&&(a=a.substring(0,a.length-1))}return{topLevelDomain:a,domain:n,address:t.join("@")}},encodeEmail:function(e){var t=encodeURI(e);return t=t.replace("%20"," ").replace("%25","%").replace("%5E","^").replace("%60","`").replace("%7B","{").replace("%7C","|").replace("%7D","}")}};return e}(_inbound||{}),_inboundEvents=function(e){function t(t,o,a){var o=o||{};(a=a||{}).bubbles=a.bubbles||!0,a.cancelable=a.cancelable||!0,o=e.apply_filters("filter_"+t,o);!window.ActiveXObject&&window;if("function"==typeof CustomEvent)var i=new CustomEvent(t,{detail:o,bubbles:a.bubbles,cancelable:a.cancelable});else(i=document.createEvent("Event")).initEvent(t,!0,!0);window.dispatchEvent(i),e.do_action(t,o),n(t,o)}function n(e,t){if(window.jQuery){var t=t||{};jQuery(document).trigger(e,t)}}e.trigger=function(t,n){e.Events[t](n)};return e.Events={analytics_ready:function(){t("analytics_ready",{data:"xyxy"},{opt1:!0})},url_parameters:function(e){t("url_parameters",e)},session_start:function(){console.log(""),t("session_start")},session_end:function(e){t("session_end",e),console.log("Session End")},session_active:function(){t("session_active")},session_idle:function(e){t("session_idle",e)},session_resume:function(){t("session_resume")},session_heartbeat:function(e){t("session_heartbeat",{clock:e,leadData:InboundLeadData})},page_visit:function(e){t("page_view",e)},page_first_visit:function(n){t("page_first_visit"),e.deBugger("pages","First Ever Page View of this Page")},page_revisit:function(n){t("page_revisit",n);e.deBugger("pages",status,function(){console.log("pageData",n),console.log("Page Revisit viewed "+n+" times")})},tab_hidden:function(n){e.deBugger("pages","Tab Hidden"),t("tab_hidden")},tab_visible:function(n){e.deBugger("pages","Tab Visible"),t("tab_visible")},tab_mouseout:function(n){e.deBugger("pages","Tab Mouseout"),t("tab_mouseout")},form_input_change:function(n){e.deBugger("forms","inputData change. Data=",function(){console.log(n)}),t("form_input_change",n)},form_before_submission:function(e){t("form_before_submission",e)},form_after_submission:function(e){t("form_after_submission",e)},search_before_caching:function(e){t("search_before_caching",e)},analyticsError:function(e,t,n){var o=new CustomEvent("inbound_analytics_error",{detail:{MLHttpRequest:e,textStatus:t,errorThrown:n}});window.dispatchEvent(o),console.log("Page Save Error")}},e}(_inbound||{});_inbound.add_action("form_before_submission",inboundFormNoRedirect,10),_inbound.add_action("form_after_submission",inboundFormNoRedirectContent,10);var InboundTotalStorage=function(e){var t,n;if("localStorage"in window)try{n=void 0===window.localStorage?void 0:window.localStorage,t=void 0!==n&&void 0!==window.JSON,window.localStorage.setItem("_inbound","1"),window.localStorage.removeItem("_inbound")}catch(e){t=!1}e.totalStorage=function(t,n,o){return e.totalStorage.impl.init(t,n)},e.totalStorage.setItem=function(t,n){return e.totalStorage.impl.setItem(t,n)},e.totalStorage.getItem=function(t){return e.totalStorage.impl.getItem(t)},e.totalStorage.getAll=function(){return e.totalStorage.impl.getAll()},e.totalStorage.deleteItem=function(t){return e.totalStorage.impl.deleteItem(t)},e.totalStorage.impl={init:function(e,t){return void 0!==t?this.setItem(e,t):this.getItem(e)},setItem:function(o,a){if(!t)try{return e.Utils.createCookie(o,a),a}catch(e){console.log("Local Storage not supported by this browser. Install the cookie plugin on your site to take advantage of the same functionality. You can get it at https://github.com/carhartl/jquery-cookie")}var i=JSON.stringify(a);return n.setItem(o,i),this.parseResult(i)},getItem:function(o){if(!t)try{return this.parseResult(e.Utils.readCookie(o))}catch(e){return null}var a=n.getItem(o);return this.parseResult(a)},deleteItem:function(o){if(!t)try{return e.Utils.eraseCookie(o,null),!0}catch(e){return!1}return n.removeItem(o),!0},getAll:function(){var o=[];if(t)for(var a in n)a.length&&o.push({key:a,value:this.parseResult(n.getItem(a))});else try{for(var i=document.cookie.split(";"),r=0;r<i.length;r++){var s=i[r].split("=")[0];o.push({key:s,value:this.parseResult(e.Utils.readCookie(s))})}}catch(e){return null}return o},parseResult:function(e){var t;try{void 0===(t=JSON.parse(e))&&(t=e),"true"==t&&(t=!0),"false"==t&&(t=!1),parseFloat(t)==t&&"object"!=typeof t&&(t=parseFloat(t))}catch(n){t=e}return t}}}(_inbound||{}),_inboundLeadsAPI=function(e){return e.LeadsAPI={init:function(){var t=e.Utils,n=(t.readCookie("wp_lead_uid"),t.readCookie("wp_lead_id"));t.readCookie("lead_data_expire")||(e.deBugger("leads","expired vistor. Run Processes"),n&&e.LeadsAPI.getAllLeadData())},setGlobalLeadData:function(e){InboundLeadData=e},getAllLeadData:function(t){var n=e.Utils.readCookie("wp_lead_id"),o=e.totalStorage("inbound_lead_data"),a=e.Utils.readCookie("lead_data_expire");data={action:"inbound_get_all_lead_data",wp_lead_id:n},success=function(t){var n=JSON.parse(t);e.LeadsAPI.setGlobalLeadData(n),e.totalStorage("inbound_lead_data",n);var o=new Date;o.setTime(o.getTime()+18e5);var a=e.Utils.addDays(o,3);e.Utils.createCookie("lead_data_expire",!0,a)},o?(e.LeadsAPI.setGlobalLeadData(o),e.deBugger("lead","Set Global Lead Data from Localstorage"),a||(e.Utils.ajaxPost(inbound_settings.admin_url,data,success),e.deBugger("lead","localized data old. Pull new from DB"))):e.Utils.ajaxPost(inbound_settings.admin_url,data,success)},getLeadLists:function(){var t={action:"wpl_check_lists",wp_lead_id:e.Utils.readCookie("wp_lead_id")};e.Utils.ajaxPost(inbound_settings.admin_url,t,function(t){e.Utils.createCookie("lead_session_list_check",!0,{path:"/",expires:1}),e.deBugger("lead","Lists checked")})}},e}(_inbound||{}),_inboundPageTracking=function(e){var t,n,o=!1,a=!1,i=!1,r=parseInt(e.Utils.readCookie("lead_session"),10)||0,s=0,l=(new Date,null),u=null,d=null,c=e.Utils,m=e.Utils.GetDate(),f="page_views",g=e.totalStorage(f)||{},p=inbound_settings.post_id||window.location.pathname;e.Settings.timeout;return e.PageTracking={init:function(o){var a=this.isRevisit(g);this.triggerPageView(a),o=o||{},t=parseInt(o.reportInterval,10)||10,n=parseInt(o.idleTimeout,10)||3,c.addListener(document,"keydown",c.throttle(e.PageTracking.pingSession,1e3)),c.addListener(document,"click",c.throttle(e.PageTracking.pingSession,1e3)),c.addListener(window,"mousemove",c.throttle(e.PageTracking.pingSession,1e3)),e.PageTracking.checkVisibility(),this.startSession()},setIdle:function(t){var n="Session IDLE. Activity Timeout due to "+(t=t||"No Movement");e.deBugger("pages",n),clearTimeout(e.PageTracking.idleTimer),e.PageTracking.stopClock(),e.trigger("session_idle")},checkVisibility:function(){var t,n;void 0!==document.hidden?(t="hidden",n="visibilitychange"):void 0!==document.mozHidden?(t="mozHidden",n="mozvisibilitychange"):void 0!==document.msHidden?(t="msHidden",n="msvisibilitychange"):void 0!==document.webkitHidden&&(t="webkitHidden",n="webkitvisibilitychange");var o=document[t];e.Utils.addListener(document,n,function(n){o!=document[t]&&(document[t]?(e.trigger("tab_hidden"),e.PageTracking.setIdle("browser tab switch")):(e.trigger("tab_visible"),e.PageTracking.pingSession()),o=document[t])})},clock:function(){var n="Total time spent on Page in this Session: "+((r+=1)/60).toFixed(2)+" min";if(e.deBugger("pages",n),r>0&&r%t==0){var o=new Date;o.setTime(o.getTime()+18e5),c.createCookie("lead_session",r,o),e.trigger("session_heartbeat",r)}},inactiveClock:function(){var t="Time until Session Timeout: "+((1800-(s+=1))/60).toFixed(2)+" min";e.deBugger("pages",t),s>1800&&(e.trigger("session_end",InboundLeadData),e.Utils.eraseCookie("lead_session"),s=0,clearTimeout(u))},stopClock:function(){a=!0,clearTimeout(l),clearTimeout(u),u=setInterval(e.PageTracking.inactiveClock,1e3)},restartClock:function(){a=!1,e.trigger("session_resume"),e.deBugger("pages","Activity resumed. Session Active"),clearTimeout(l),s=0,clearTimeout(u),l=setInterval(e.PageTracking.clock,1e3)},turnOff:function(){e.PageTracking.setIdle(),i=!0},turnOn:function(){i=!1},startSession:function(){new Date;if(o=!0,l=setInterval(e.PageTracking.clock,1e3),c.readCookie("lead_session"))e.trigger("session_active");else{e.trigger("session_start");var t=new Date;t.setTime(t.getTime()+18e5),e.Utils.createCookie("lead_session",1,t)}this.pingSession()},resetInactiveFunc:function(){s=0,clearTimeout(u)},pingSession:function(t){i||(o||e.PageTracking.startSession(),a&&e.PageTracking.restartClock(),clearTimeout(d),d=setTimeout(e.PageTracking.setIdle,1e3*n+100),void 0!==t&&"mousemove"===t.type&&e.PageTracking.mouseEvents(t))},mouseEvents:function(t){t.pageY<=5&&e.trigger("tab_mouseout")},getPageViews:function(){if(e.Utils.checkLocalStorage()){var t=localStorage.getItem(f),n=JSON.parse(t);return n}},isRevisit:function(e){var t=!1,n=(e=e||{})[p];return void 0!==n&&null!==n&&(t=!0),t},triggerPageView:function(t){var n={title:document.title,url:document.location.href,path:document.location.pathname,count:1};t?(g[p].push(m),n.count=g[p].length,e.trigger("page_revisit",n)):(g[p]=[],g[p].push(m),e.trigger("page_first_visit",n)),e.trigger("page_visit",n),e.totalStorage(f,g);document.onreadystatechange=function(){"loading"!==document.readyState&&e.PageTracking.storePageView()}},CheckTimeOut:function(){e.deBugger("pages",status)},storePageView:function(){"off"==inbound_settings.page_tracking&&"landing-page"!=inbound_settings.post_type||setTimeout(function(){var t=e.Utils.readCookie("wp_lead_id")?e.Utils.readCookie("wp_lead_id"):"",n=e.Utils.readCookie("wp_lead_uid")?e.Utils.readCookie("wp_lead_uid"):"",o=e.totalStorage("wp_cta_loaded"),a=e.totalStorage("wp_cta_impressions");stored=!0,e.totalStorage("wp_cta_impressions",{});var i={action:"inbound_track_lead",wp_lead_uid:n,wp_lead_id:t,page_id:inbound_settings.post_id,variation_id:inbound_settings.variation_id,post_type:inbound_settings.post_type,current_url:window.location.href,page_views:JSON.stringify(e.PageTracking.getPageViews()),cta_impressions:JSON.stringify(a),cta_history:JSON.stringify(o),json:"0"};e.Utils.ajaxPost(inbound_settings.admin_url,i,function(e){})},200)}},e}(_inbound||{});_inbound.init(),InboundLeadData=_inbound.totalStorage("inbound_lead_data")||null;
shared/classes/class.lead-storage.php CHANGED
@@ -667,7 +667,7 @@ if (!class_exists('LeadStorage')) {
667
668
foreach ($fields as $key => $label ) {
669
if( isset( $args[ $key ]) && !isset($mappedData[$key]) ) {
670
- $mappedData[$key] = $args[ $key ];
671
}
672
}
673
@@ -765,7 +765,7 @@ if (!function_exists('inbound_store_lead')) {
765
$args = array_merge( $args, $_POST );
766
767
/* wpleads_email_address becomes wpleads_email */
768
- $args['email'] = $args['wpleads_email_address'];
769
770
/* Send data through new method */
771
$Leads = new LeadStorage();
667
668
foreach ($fields as $key => $label ) {
669
if( isset( $args[ $key ]) && !isset($mappedData[$key]) ) {
670
+ $mappedData[$key] = sanitize_text_field($args[ $key ]);
671
}
672
}
673
765
$args = array_merge( $args, $_POST );
766
767
/* wpleads_email_address becomes wpleads_email */
768
+ $args['email'] = sanitize_text_field($args['wpleads_email_address']);
769
770
/* Send data through new method */
771
$Leads = new LeadStorage();
shared/shortcodes/inbound-shortcodes.php CHANGED
@@ -575,6 +575,9 @@ class Inbound_Shortcodes {
575
</style>';
576
}
577
578
static function inbound_forms_header_area()
579
{
580
global $post;
575
</style>';
576
}
577
578
+ /**
579
+ *
580
+ */
581
static function inbound_forms_header_area()
582
{
583
global $post;