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

Version Description

Download this release

Release Info

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

Code changes from version 1.11.1 to 1.11.2

CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  ### v1.11.1 - 07/22/2020
2
  * Fix: Form submission cookies no longer set with Contact Form 7 5.2
3
 
1
+ ### v1.11.2 - 08/17/2020
2
+ * Fix: `wp_make_content_images_responsive` is deprecated, use `wp_filter_content_tags()` instead
3
+ * Fix: IE 11 does not support JS Promises
4
+ * Fix: Missing permission_callback on REST endpoint
5
+
6
  ### v1.11.1 - 07/22/2020
7
  * Fix: Form submission cookies no longer set with Contact Form 7 5.2
8
 
assets/js/site.js CHANGED
@@ -3855,4 +3855,305 @@ var pum_debug_mode = false,
3855
  exports.FormSerializer = FormSerializer;
3856
 
3857
  return FormSerializer;
3858
- }));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3855
  exports.FormSerializer = FormSerializer;
3856
 
3857
  return FormSerializer;
3858
+ }));
3859
+ (function (global, factory) {
3860
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
3861
+ typeof define === 'function' && define.amd ? define(factory) :
3862
+ (factory());
3863
+ }(this, (function () { 'use strict';
3864
+
3865
+ /**
3866
+ * @this {Promise}
3867
+ */
3868
+ function finallyConstructor(callback) {
3869
+ var constructor = this.constructor;
3870
+ return this.then(
3871
+ function(value) {
3872
+ // @ts-ignore
3873
+ return constructor.resolve(callback()).then(function() {
3874
+ return value;
3875
+ });
3876
+ },
3877
+ function(reason) {
3878
+ // @ts-ignore
3879
+ return constructor.resolve(callback()).then(function() {
3880
+ // @ts-ignore
3881
+ return constructor.reject(reason);
3882
+ });
3883
+ }
3884
+ );
3885
+ }
3886
+
3887
+ // Store setTimeout reference so promise-polyfill will be unaffected by
3888
+ // other code modifying setTimeout (like sinon.useFakeTimers())
3889
+ var setTimeoutFunc = setTimeout;
3890
+
3891
+ function isArray(x) {
3892
+ return Boolean(x && typeof x.length !== 'undefined');
3893
+ }
3894
+
3895
+ function noop() {}
3896
+
3897
+ // Polyfill for Function.prototype.bind
3898
+ function bind(fn, thisArg) {
3899
+ return function() {
3900
+ fn.apply(thisArg, arguments);
3901
+ };
3902
+ }
3903
+
3904
+ /**
3905
+ * @constructor
3906
+ * @param {Function} fn
3907
+ */
3908
+ function Promise(fn) {
3909
+ if (!(this instanceof Promise))
3910
+ throw new TypeError('Promises must be constructed via new');
3911
+ if (typeof fn !== 'function') throw new TypeError('not a function');
3912
+ /** @type {!number} */
3913
+ this._state = 0;
3914
+ /** @type {!boolean} */
3915
+ this._handled = false;
3916
+ /** @type {Promise|undefined} */
3917
+ this._value = undefined;
3918
+ /** @type {!Array<!Function>} */
3919
+ this._deferreds = [];
3920
+
3921
+ doResolve(fn, this);
3922
+ }
3923
+
3924
+ function handle(self, deferred) {
3925
+ while (self._state === 3) {
3926
+ self = self._value;
3927
+ }
3928
+ if (self._state === 0) {
3929
+ self._deferreds.push(deferred);
3930
+ return;
3931
+ }
3932
+ self._handled = true;
3933
+ Promise._immediateFn(function() {
3934
+ var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
3935
+ if (cb === null) {
3936
+ (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
3937
+ return;
3938
+ }
3939
+ var ret;
3940
+ try {
3941
+ ret = cb(self._value);
3942
+ } catch (e) {
3943
+ reject(deferred.promise, e);
3944
+ return;
3945
+ }
3946
+ resolve(deferred.promise, ret);
3947
+ });
3948
+ }
3949
+
3950
+ function resolve(self, newValue) {
3951
+ try {
3952
+ // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
3953
+ if (newValue === self)
3954
+ throw new TypeError('A promise cannot be resolved with itself.');
3955
+ if (
3956
+ newValue &&
3957
+ (typeof newValue === 'object' || typeof newValue === 'function')
3958
+ ) {
3959
+ var then = newValue.then;
3960
+ if (newValue instanceof Promise) {
3961
+ self._state = 3;
3962
+ self._value = newValue;
3963
+ finale(self);
3964
+ return;
3965
+ } else if (typeof then === 'function') {
3966
+ doResolve(bind(then, newValue), self);
3967
+ return;
3968
+ }
3969
+ }
3970
+ self._state = 1;
3971
+ self._value = newValue;
3972
+ finale(self);
3973
+ } catch (e) {
3974
+ reject(self, e);
3975
+ }
3976
+ }
3977
+
3978
+ function reject(self, newValue) {
3979
+ self._state = 2;
3980
+ self._value = newValue;
3981
+ finale(self);
3982
+ }
3983
+
3984
+ function finale(self) {
3985
+ if (self._state === 2 && self._deferreds.length === 0) {
3986
+ Promise._immediateFn(function() {
3987
+ if (!self._handled) {
3988
+ Promise._unhandledRejectionFn(self._value);
3989
+ }
3990
+ });
3991
+ }
3992
+
3993
+ for (var i = 0, len = self._deferreds.length; i < len; i++) {
3994
+ handle(self, self._deferreds[i]);
3995
+ }
3996
+ self._deferreds = null;
3997
+ }
3998
+
3999
+ /**
4000
+ * @constructor
4001
+ */
4002
+ function Handler(onFulfilled, onRejected, promise) {
4003
+ this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
4004
+ this.onRejected = typeof onRejected === 'function' ? onRejected : null;
4005
+ this.promise = promise;
4006
+ }
4007
+
4008
+ /**
4009
+ * Take a potentially misbehaving resolver function and make sure
4010
+ * onFulfilled and onRejected are only called once.
4011
+ *
4012
+ * Makes no guarantees about asynchrony.
4013
+ */
4014
+ function doResolve(fn, self) {
4015
+ var done = false;
4016
+ try {
4017
+ fn(
4018
+ function(value) {
4019
+ if (done) return;
4020
+ done = true;
4021
+ resolve(self, value);
4022
+ },
4023
+ function(reason) {
4024
+ if (done) return;
4025
+ done = true;
4026
+ reject(self, reason);
4027
+ }
4028
+ );
4029
+ } catch (ex) {
4030
+ if (done) return;
4031
+ done = true;
4032
+ reject(self, ex);
4033
+ }
4034
+ }
4035
+
4036
+ Promise.prototype['catch'] = function(onRejected) {
4037
+ return this.then(null, onRejected);
4038
+ };
4039
+
4040
+ Promise.prototype.then = function(onFulfilled, onRejected) {
4041
+ // @ts-ignore
4042
+ var prom = new this.constructor(noop);
4043
+
4044
+ handle(this, new Handler(onFulfilled, onRejected, prom));
4045
+ return prom;
4046
+ };
4047
+
4048
+ Promise.prototype['finally'] = finallyConstructor;
4049
+
4050
+ Promise.all = function(arr) {
4051
+ return new Promise(function(resolve, reject) {
4052
+ if (!isArray(arr)) {
4053
+ return reject(new TypeError('Promise.all accepts an array'));
4054
+ }
4055
+
4056
+ var args = Array.prototype.slice.call(arr);
4057
+ if (args.length === 0) return resolve([]);
4058
+ var remaining = args.length;
4059
+
4060
+ function res(i, val) {
4061
+ try {
4062
+ if (val && (typeof val === 'object' || typeof val === 'function')) {
4063
+ var then = val.then;
4064
+ if (typeof then === 'function') {
4065
+ then.call(
4066
+ val,
4067
+ function(val) {
4068
+ res(i, val);
4069
+ },
4070
+ reject
4071
+ );
4072
+ return;
4073
+ }
4074
+ }
4075
+ args[i] = val;
4076
+ if (--remaining === 0) {
4077
+ resolve(args);
4078
+ }
4079
+ } catch (ex) {
4080
+ reject(ex);
4081
+ }
4082
+ }
4083
+
4084
+ for (var i = 0; i < args.length; i++) {
4085
+ res(i, args[i]);
4086
+ }
4087
+ });
4088
+ };
4089
+
4090
+ Promise.resolve = function(value) {
4091
+ if (value && typeof value === 'object' && value.constructor === Promise) {
4092
+ return value;
4093
+ }
4094
+
4095
+ return new Promise(function(resolve) {
4096
+ resolve(value);
4097
+ });
4098
+ };
4099
+
4100
+ Promise.reject = function(value) {
4101
+ return new Promise(function(resolve, reject) {
4102
+ reject(value);
4103
+ });
4104
+ };
4105
+
4106
+ Promise.race = function(arr) {
4107
+ return new Promise(function(resolve, reject) {
4108
+ if (!isArray(arr)) {
4109
+ return reject(new TypeError('Promise.race accepts an array'));
4110
+ }
4111
+
4112
+ for (var i = 0, len = arr.length; i < len; i++) {
4113
+ Promise.resolve(arr[i]).then(resolve, reject);
4114
+ }
4115
+ });
4116
+ };
4117
+
4118
+ // Use polyfill for setImmediate for performance gains
4119
+ Promise._immediateFn =
4120
+ // @ts-ignore
4121
+ (typeof setImmediate === 'function' &&
4122
+ function(fn) {
4123
+ // @ts-ignore
4124
+ setImmediate(fn);
4125
+ }) ||
4126
+ function(fn) {
4127
+ setTimeoutFunc(fn, 0);
4128
+ };
4129
+
4130
+ Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
4131
+ if (typeof console !== 'undefined' && console) {
4132
+ console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
4133
+ }
4134
+ };
4135
+
4136
+ /** @suppress {undefinedVars} */
4137
+ var globalNS = (function() {
4138
+ // the only reliable means to get the global object is
4139
+ // `Function('return this')()`
4140
+ // However, this causes CSP violations in Chrome apps.
4141
+ if (typeof self !== 'undefined') {
4142
+ return self;
4143
+ }
4144
+ if (typeof window !== 'undefined') {
4145
+ return window;
4146
+ }
4147
+ if (typeof global !== 'undefined') {
4148
+ return global;
4149
+ }
4150
+ throw new Error('unable to locate global object');
4151
+ })();
4152
+
4153
+ if (!('Promise' in globalNS)) {
4154
+ globalNS['Promise'] = Promise;
4155
+ } else if (!globalNS.Promise.prototype['finally']) {
4156
+ globalNS.Promise.prototype['finally'] = finallyConstructor;
4157
+ }
4158
+
4159
+ })));
assets/js/site.min.js CHANGED
@@ -1 +1 @@
1
- var PUM,PUM_Accessibility,PUM_Analytics,pm_cookie,pm_cookie_json,pm_remove_cookie;!function(s){"use strict";void 0===s.fn.on&&(s.fn.on=function(e,o,t){return this.delegate(o,e,t)}),void 0===s.fn.off&&(s.fn.off=function(e,o,t){return this.undelegate(o,e,t)}),void 0===s.fn.bindFirst&&(s.fn.bindFirst=function(e,o){var t,n,i=s(this);i.unbind(e,o),i.bind(e,o),(n=(t=s._data(i[0]).events)[e]).unshift(n.pop()),t[e]=n}),void 0===s.fn.outerHtml&&(s.fn.outerHtml=function(){var e=s(this).clone();return s("<div/>").append(e).html()}),void 0===s.fn.isInViewport&&(s.fn.isInViewport=function(){var e=s(this).offset().top,o=e+s(this).outerHeight(),t=s(window).scrollTop(),n=t+s(window).height();return t<o&&e<n}),void 0===Date.now&&(Date.now=function(){return(new Date).getTime()})}(jQuery),function(p,s,r){"use strict";function i(e,o){function t(e,o,t){return o?e[o.slice(0,t?-1:o.length)]:e}return o.split(".").reduce(function(e,o){return o?o.split("[").reduce(t,e):e},e)}window.pum_vars=window.pum_vars||{default_theme:"0",home_url:"/",version:1.7,pm_dir_url:"",ajaxurl:"",restapi:!1,rest_nonce:null,debug_mode:!1,disable_tracking:!0,message_position:"top",core_sub_forms_enabled:!0,popups:{}},window.pum_popups=window.pum_popups||{},window.pum_vars.popups=window.pum_popups,PUM={get:new function(){function e(e,o,t){"boolean"==typeof o&&(t=o,o=!1);var n=o?o.selector+" "+e:e;return r!==i[n]&&!t||(i[n]=o?o.find(e):jQuery(e)),i[n]}var i={};return e.elementCache=i,e},getPopup:function(e){var o,t;return t=e,(o=isNaN(t)||parseInt(Number(t))!==parseInt(t)||isNaN(parseInt(t,10))?"current"===e?PUM.get(".pum-overlay.pum-active:eq(0)",!0):"open"===e?PUM.get(".pum-overlay.pum-active",!0):"closed"===e?PUM.get(".pum-overlay:not(.pum-active)",!0):e instanceof jQuery?e:p(e):PUM.get("#pum-"+e)).hasClass("pum-overlay")?o:o.hasClass("popmake")||o.parents(".pum-overlay").length?o.parents(".pum-overlay"):p()},open:function(e,o){PUM.getPopup(e).popmake("open",o)},close:function(e,o){PUM.getPopup(e).popmake("close",o)},preventOpen:function(e){PUM.getPopup(e).addClass("preventOpen")},getSettings:function(e){return PUM.getPopup(e).popmake("getSettings")},getSetting:function(e,o,t){var n=i(PUM.getSettings(e),o);return void 0!==n?n:t!==r?t:null},checkConditions:function(e){return PUM.getPopup(e).popmake("checkConditions")},getCookie:function(e){return p.pm_cookie(e)},getJSONCookie:function(e){return p.pm_cookie_json(e)},setCookie:function(e,o){PUM.getPopup(e).popmake("setCookie",jQuery.extend({name:"pum-"+PUM.getSetting(e,"id"),expires:"+30 days"},o))},clearCookie:function(e,o){p.pm_remove_cookie(e),"function"==typeof o&&o()},clearCookies:function(e,o){var t,n=PUM.getPopup(e).popmake("getSettings").cookies;if(n!==r&&n.length)for(t=0;n.length>t;t+=1)p.pm_remove_cookie(n[t].settings.name);"function"==typeof o&&o()},getClickTriggerSelector:function(e,o){var t=PUM.getPopup(e),n=PUM.getSettings(e),i=[".popmake-"+n.id,".popmake-"+decodeURIComponent(n.slug),'a[href$="#popmake-'+n.id+'"]'];return o.extra_selectors&&""!==o.extra_selectors&&i.push(o.extra_selectors),(i=pum.hooks.applyFilters("pum.trigger.click_open.selectors",i,o,t)).join(", ")},disableClickTriggers:function(e,o){if(e!==r)if(o!==r){var t=PUM.getClickTriggerSelector(e,o);p(t).removeClass("pum-trigger"),p(s).off("click.pumTrigger click.popmakeOpen",t)}else{var n=PUM.getSetting(e,"triggers",[]);if(n.length)for(var i=0;n.length>i;i++){-1!==pum.hooks.applyFilters("pum.disableClickTriggers.clickTriggerTypes",["click_open"]).indexOf(n[i].type)&&(t=PUM.getClickTriggerSelector(e,n[i].settings),p(t).removeClass("pum-trigger"),p(s).off("click.pumTrigger click.popmakeOpen",t))}}}},p.fn.popmake=function(e){return p.fn.popmake.methods[e]?(p(s).trigger("pumMethodCall",arguments),p.fn.popmake.methods[e].apply(this,Array.prototype.slice.call(arguments,1))):"object"!=typeof e&&e?void(window.console&&console.warn("Method "+e+" does not exist on $.fn.popmake")):p.fn.popmake.methods.init.apply(this,arguments)},p.fn.popmake.methods={init:function(){return this.each(function(){var e,o=PUM.getPopup(this),t=o.popmake("getSettings");return t.theme_id<=0&&(t.theme_id=pum_vars.default_theme),t.disable_reposition!==r&&t.disable_reposition||p(window).on("resize",function(){(o.hasClass("pum-active")||o.find(".popmake.active").length)&&p.fn.popmake.utilities.throttle(setTimeout(function(){o.popmake("reposition")},25),500,!1)}),o.find(".pum-container").data("popmake",t),o.data("popmake",t).trigger("pumInit"),t.open_sound&&"none"!==t.open_sound&&((e="custom"!==t.open_sound?new Audio(pum_vars.pm_dir_url+"/assets/sounds/"+t.open_sound):new Audio(t.custom_sound)).addEventListener("canplaythrough",function(){o.data("popAudio",e)}),e.addEventListener("error",function(){console.warn("Error occurred when trying to load Popup opening sound.")}),e.load()),this})},getOverlay:function(){return PUM.getPopup(this)},getContainer:function(){return PUM.getPopup(this).find(".pum-container")},getTitle:function(){return PUM.getPopup(this).find(".pum-title")||null},getContent:function(){return PUM.getPopup(this).find(".pum-content")||null},getClose:function(){return PUM.getPopup(this).find(".pum-content + .pum-close")||null},getSettings:function(){var e=PUM.getPopup(this);return p.extend(!0,{},p.fn.popmake.defaults,e.data("popmake")||{},"object"==typeof pum_popups&&void 0!==pum_popups[e.attr("id")]?pum_popups[e.attr("id")]:{})},state:function(e){var o=PUM.getPopup(this);if(r!==e)switch(e){case"isOpen":return o.hasClass("pum-open")||o.popmake("getContainer").hasClass("active");case"isClosed":return!o.hasClass("pum-open")&&!o.popmake("getContainer").hasClass("active")}},open:function(e){var o=PUM.getPopup(this),t=o.popmake("getContainer"),n=o.popmake("getClose"),i=o.popmake("getSettings"),s=p("html");return o.trigger("pumBeforeOpen"),o.hasClass("preventOpen")||t.hasClass("preventOpen")?(console.log("prevented"),o.removeClass("preventOpen").removeClass("pum-active").trigger("pumOpenPrevented")):(i.stackable||o.popmake("close_all"),o.addClass("pum-active"),0<i.close_button_delay&&n.fadeOut(0),s.addClass("pum-open"),i.overlay_disabled?s.addClass("pum-open-overlay-disabled"):s.addClass("pum-open-overlay"),i.position_fixed?s.addClass("pum-open-fixed"):s.addClass("pum-open-scrollable"),o.popmake("setup_close").popmake("reposition").popmake("animate",i.animation_type,function(){0<i.close_button_delay&&setTimeout(function(){n.fadeIn()},i.close_button_delay),o.trigger("pumAfterOpen"),p(window).trigger("resize"),p.fn.popmake.last_open_popup=o,e!==r&&e()}),void 0!==o.data("popAudio")&&o.data("popAudio").play().catch(function(e){console.warn("Sound was not able to play when popup opened. Reason: "+e)})),this},setup_close:function(){var t=PUM.getPopup(this),e=t.popmake("getClose"),n=t.popmake("getSettings");return(e=e.add(p(".popmake-close, .pum-close",t).not(e))).off("click.pum").on("click.pum",function(e){var o=p(this);o.hasClass("pum-do-default")||o.data("do-default")!==r&&o.data("do-default")||e.preventDefault(),p.fn.popmake.last_close_trigger="Close Button",t.popmake("close")}),(n.close_on_esc_press||n.close_on_f4_press)&&p(window).off("keyup.popmake").on("keyup.popmake",function(e){27===e.keyCode&&n.close_on_esc_press&&(p.fn.popmake.last_close_trigger="ESC Key",t.popmake("close")),115===e.keyCode&&n.close_on_f4_press&&(p.fn.popmake.last_close_trigger="F4 Key",t.popmake("close"))}),n.close_on_overlay_click&&(t.on("pumAfterOpen",function(){p(s).on("click.pumCloseOverlay",function(e){p(e.target).closest(".pum-container").length||(p.fn.popmake.last_close_trigger="Overlay Click",t.popmake("close"))})}),t.on("pumAfterClose",function(){p(s).off("click.pumCloseOverlay")})),n.close_on_form_submission&&PUM.hooks.addAction("pum.integration.form.success",function(e,o){o.popup&&o.popup[0]===t[0]&&setTimeout(function(){p.fn.popmake.last_close_trigger="Form Submission",t.popmake("close")},n.close_on_form_submission_delay||0)}),t.trigger("pumSetupClose"),this},close:function(n){return this.each(function(){var e=PUM.getPopup(this),o=e.popmake("getContainer"),t=(t=e.popmake("getClose")).add(p(".popmake-close, .pum-close",e).not(t));return e.trigger("pumBeforeClose"),e.hasClass("preventClose")||o.hasClass("preventClose")?e.removeClass("preventClose").trigger("pumClosePrevented"):o.fadeOut("fast",function(){e.is(":visible")&&e.fadeOut("fast"),p(window).off("keyup.popmake"),e.off("click.popmake"),t.off("click.popmake"),1===p(".pum-active").length&&p("html").removeClass("pum-open").removeClass("pum-open-scrollable").removeClass("pum-open-overlay").removeClass("pum-open-overlay-disabled").removeClass("pum-open-fixed"),e.removeClass("pum-active").trigger("pumAfterClose"),o.find("iframe").filter('[src*="youtube"],[src*="vimeo"]').each(function(){var e=p(this),o=e.attr("src"),t=o.replace("autoplay=1","1=1");t!==o&&(o=t),e.prop("src",o)}),o.find("video").each(function(){this.pause()}),n!==r&&n()}),this})},close_all:function(){return p(".pum-active").popmake("close"),this},reposition:function(e){var o=PUM.getPopup(this).trigger("pumBeforeReposition"),t=o.popmake("getContainer"),n=o.popmake("getSettings"),i=n.location,s={my:"",at:"",of:window,collision:"none",using:"function"==typeof e?e:p.fn.popmake.callbacks.reposition_using},r={overlay:null,container:null},a=null;try{a=p(p.fn.popmake.last_open_trigger)}catch(e){a=p()}return n.position_from_trigger&&a.length?(s.of=a,0<=i.indexOf("left")&&(s.my+=" right",s.at+=" left"+(0!==n.position_left?"-"+n.position_left:"")),0<=i.indexOf("right")&&(s.my+=" left",s.at+=" right"+(0!==n.position_right?"+"+n.position_right:"")),0<=i.indexOf("center")&&(s.my="center"===i?"center":s.my+" center",s.at="center"===i?"center":s.at+" center"),0<=i.indexOf("top")&&(s.my+=" bottom",s.at+=" top"+(0!==n.position_top?"-"+n.position_top:"")),0<=i.indexOf("bottom")&&(s.my+=" top",s.at+=" bottom"+(0!==n.position_bottom?"+"+n.position_bottom:""))):(0<=i.indexOf("left")&&(s.my+=" left"+(0!==n.position_left?"+"+n.position_left:""),s.at+=" left"),0<=i.indexOf("right")&&(s.my+=" right"+(0!==n.position_right?"-"+n.position_right:""),s.at+=" right"),0<=i.indexOf("center")&&(s.my="center"===i?"center":s.my+" center",s.at="center"===i?"center":s.at+" center"),0<=i.indexOf("top")&&(s.my+=" top"+(0!==n.position_top?"+"+(p("body").hasClass("admin-bar")?parseInt(n.position_top,10)+32:n.position_top):""),s.at+=" top"),0<=i.indexOf("bottom")&&(s.my+=" bottom"+(0!==n.position_bottom?"-"+n.position_bottom:""),s.at+=" bottom")),s.my=p.trim(s.my),s.at=p.trim(s.at),o.is(":hidden")&&(r.overlay=o.css("opacity"),o.css({opacity:0}).show(0)),t.is(":hidden")&&(r.container=t.css("opacity"),t.css({opacity:0}).show(0)),n.position_fixed&&t.addClass("fixed"),"custom"===n.size?t.css({width:n.custom_width,height:n.custom_height_auto?"auto":n.custom_height}):"auto"!==n.size&&t.addClass("responsive").css({minWidth:""!==n.responsive_min_width?n.responsive_min_width:"auto",maxWidth:""!==n.responsive_max_width?n.responsive_max_width:"auto"}),o.trigger("pumAfterReposition"),t.addClass("custom-position").position(s).trigger("popmakeAfterReposition"),"center"===i&&t[0].offsetTop<0&&t.css({top:p("body").hasClass("admin-bar")?42:10}),r.overlay&&o.css({opacity:r.overlay}).hide(0),r.container&&t.css({opacity:r.container}).hide(0),this},animation_origin:function(e){var o=PUM.getPopup(this).popmake("getContainer"),t={my:"",at:""};switch(e){case"top":t={my:"left+"+o.offset().left+" bottom-100",at:"left top"};break;case"bottom":t={my:"left+"+o.offset().left+" top+100",at:"left bottom"};break;case"left":t={my:"right top+"+o.offset().top,at:"left top"};break;case"right":t={my:"left top+"+o.offset().top,at:"right top"};break;default:0<=e.indexOf("left")&&(t={my:t.my+" right",at:t.at+" left"}),0<=e.indexOf("right")&&(t={my:t.my+" left",at:t.at+" right"}),0<=e.indexOf("center")&&(t={my:t.my+" center",at:t.at+" center"}),0<=e.indexOf("top")&&(t={my:t.my+" bottom-100",at:t.at+" top"}),0<=e.indexOf("bottom")&&(t={my:t.my+" top+100",at:t.at+" bottom"}),t.my=p.trim(t.my),t.at=p.trim(t.at)}return t.of=window,t.collision="none",t}}}(jQuery,document),function(e){"use strict";e.fn.popmake.version=1.8,e.fn.popmake.last_open_popup=null,window.PUM.init=function(){console.log("init popups ✔"),e(".pum").popmake(),e(void 0).trigger("pumInitialized"),"object"==typeof pum_vars.form_success&&(pum_vars.form_success=e.extend({popup_id:null,settings:{}}),PUM.forms.success(pum_vars.form_success.popup_id,pum_vars.form_success.settings)),PUM.integrations.init()},e(void 0).ready(function(){var e=PUM.hooks.applyFilters("pum.initHandler",PUM.init),o=PUM.hooks.applyFilters("pum.initPromises",[]);Promise.all(o).then(e)}),e(".pum").on("pumInit",function(){var e=PUM.getPopup(this),o=PUM.getSetting(e,"id"),t=e.find("form");t.length&&t.append('<input type="hidden" name="pum_form_popup_id" value="'+o+'" />')})}(jQuery),function(s,t){"use strict";var n,i,r,a="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]",e=".pum:not(.pum-accessibility-disabled)";PUM_Accessibility={forceFocus:function(e){r&&r.length&&!r[0].contains(e.target)&&(e.stopPropagation(),PUM_Accessibility.setFocusToFirstItem())},trapTabKey:function(e){var o,t,n,i;9===e.keyCode&&(o=r.find(".pum-container *").filter(a).filter(":visible"),t=s(":focus"),n=o.length,i=o.index(t),e.shiftKey?0===i&&(o.get(n-1).focus(),e.preventDefault()):i===n-1&&(o.get(0).focus(),e.preventDefault()))},setFocusToFirstItem:function(){r.find(".pum-container *").filter(a).filter(":visible").filter(":not(.pum-close)").first().focus()}},s(t).on("pumInit",e,function(){PUM.getPopup(this).find("[tabindex]").each(function(){var e=s(this);e.data("tabindex",e.attr("tabindex")).prop("tabindex","0")})}).on("pumBeforeOpen",e,function(){var e=PUM.getPopup(this),o=s(":focus");e.has(o).length||(i=o),r=e.on("keydown.pum_accessibility",PUM_Accessibility.trapTabKey).attr("aria-hidden","false"),(n=s("body > *").filter(":visible").not(r)).attr("aria-hidden","true"),s(t).one("focusin.pum_accessibility",PUM_Accessibility.forceFocus),PUM_Accessibility.setFocusToFirstItem()}).on("pumAfterOpen",e,function(){}).on("pumBeforeClose",e,function(){}).on("pumAfterClose",e,function(){PUM.getPopup(this).off("keydown.pum_accessibility").attr("aria-hidden","true"),n&&(n.attr("aria-hidden","false"),n=null),void 0!==i&&i.length&&i.focus(),r=null,s(t).off("focusin.pum_accessibility")}).on("pumSetupClose",e,function(){}).on("pumOpenPrevented",e,function(){}).on("pumClosePrevented",e,function(){}).on("pumBeforeReposition",e,function(){})}(jQuery,document),function(s){"use strict";s.fn.popmake.last_open_trigger=null,s.fn.popmake.last_close_trigger=null,s.fn.popmake.conversion_trigger=null;var r=!(void 0===pum_vars.restapi||!pum_vars.restapi);PUM_Analytics={beacon:function(e,o){var t=new Image,n=r?pum_vars.restapi:pum_vars.ajaxurl,i={route:pum.hooks.applyFilters("pum.analyticsBeaconRoute","/analytics/"),data:pum.hooks.applyFilters("pum.AnalyticsBeaconData",s.extend(!0,{event:"open",pid:null,_cache:+new Date},e)),callback:"function"==typeof o?o:function(){}};r?n+=i.route:i.data.action="pum_analytics",n&&(s(t).on("error success load done",i.callback),t.src=n+"?"+s.param(i.data))}},void 0!==pum_vars.disable_tracking&&pum_vars.disable_tracking||s(document).on("pumAfterOpen.core_analytics",".pum",function(){var e=PUM.getPopup(this),o={pid:parseInt(e.popmake("getSettings").id,10)||null};0<o.pid&&!s("body").hasClass("single-popup")&&PUM_Analytics.beacon(o)})}(jQuery),function(n,s){"use strict";function r(e){var o=e.popmake("getContainer"),t={display:"",opacity:""};e.css(t),o.css(t)}function a(e){return e.overlay_disabled?0:e.animation_speed/2}function p(e){return e.overlay_disabled?parseInt(e.animation_speed):e.animation_speed/2}n.fn.popmake.methods.animate_overlay=function(e,o,t){return PUM.getPopup(this).popmake("getSettings").overlay_disabled?n.fn.popmake.overlay_animations.none.apply(this,[o,t]):n.fn.popmake.overlay_animations[e]?n.fn.popmake.overlay_animations[e].apply(this,[o,t]):(window.console&&console.warn("Animation style "+e+" does not exist."),this)},n.fn.popmake.methods.animate=function(e){return n.fn.popmake.animations[e]?n.fn.popmake.animations[e].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Animation style "+e+" does not exist."),this)},n.fn.popmake.animations={none:function(e){var o=PUM.getPopup(this);return o.popmake("getContainer").css({opacity:1,display:"block"}),o.popmake("animate_overlay","none",0,function(){e!==s&&e()}),this},slide:function(o){var e=PUM.getPopup(this),t=e.popmake("getContainer"),n=e.popmake("getSettings"),i=e.popmake("animation_origin",n.animation_origin);return r(e),t.position(i),e.popmake("animate_overlay","fade",a(n),function(){t.popmake("reposition",function(e){t.animate(e,p(n),"swing",function(){o!==s&&o()})})}),this},fade:function(e){var o=PUM.getPopup(this),t=o.popmake("getContainer"),n=o.popmake("getSettings");return r(o),o.css({opacity:0,display:"block"}),t.css({opacity:0,display:"block"}),o.popmake("animate_overlay","fade",a(n),function(){t.animate({opacity:1},p(n),"swing",function(){e!==s&&e()})}),this},fadeAndSlide:function(o){var e=PUM.getPopup(this),t=e.popmake("getContainer"),n=e.popmake("getSettings"),i=e.popmake("animation_origin",n.animation_origin);return r(e),e.css({display:"block",opacity:0}),t.css({display:"block",opacity:0}),t.position(i),e.popmake("animate_overlay","fade",a(n),function(){t.popmake("reposition",function(e){e.opacity=1,t.animate(e,p(n),"swing",function(){o!==s&&o()})})}),this},grow:function(e){return n.fn.popmake.animations.fade.apply(this,arguments)},growAndSlide:function(e){return n.fn.popmake.animations.fadeAndSlide.apply(this,arguments)}},n.fn.popmake.overlay_animations={none:function(e,o){PUM.getPopup(this).css({opacity:1,display:"block"}),"function"==typeof o&&o()},fade:function(e,o){PUM.getPopup(this).css({opacity:0,display:"block"}).animate({opacity:1},e,"swing",o)},slide:function(e,o){PUM.getPopup(this).slideDown(e,o)}}}(jQuery,void document),function(e,o){"use strict";e(o).on("pumInit",".pum",function(){e(this).popmake("getContainer").trigger("popmakeInit")}).on("pumBeforeOpen",".pum",function(){e(this).popmake("getContainer").addClass("active").trigger("popmakeBeforeOpen")}).on("pumAfterOpen",".pum",function(){e(this).popmake("getContainer").trigger("popmakeAfterOpen")}).on("pumBeforeClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeClose")}).on("pumAfterClose",".pum",function(){e(this).popmake("getContainer").removeClass("active").trigger("popmakeAfterClose")}).on("pumSetupClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeSetupClose")}).on("pumOpenPrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventOpen").removeClass("active")}).on("pumClosePrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventClose")}).on("pumBeforeReposition",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeReposition")})}(jQuery,document),function(o){"use strict";o.fn.popmake.callbacks={reposition_using:function(e){o(this).css(e)}}}(jQuery,document),function(p){"use strict";function u(){return void 0===e&&(e="undefined"!=typeof MobileDetect?new MobileDetect(window.navigator.userAgent):{phone:function(){return!1},tablet:function(){return!1}}),e}var e;p.extend(p.fn.popmake.methods,{checkConditions:function(){var e,o,t,n,i,s=PUM.getPopup(this),r=s.popmake("getSettings"),a=!0;if(r.disable_on_mobile&&u().phone())return!1;if(r.disable_on_tablet&&u().tablet())return!1;if(r.conditions.length)for(o=0;r.conditions.length>o;o++){for(n=r.conditions[o],e=!1,t=0;n.length>t&&((!(i=p.extend({},{not_operand:!1},n[t])).not_operand&&s.popmake("checkCondition",i)||i.not_operand&&!s.popmake("checkCondition",i))&&(e=!0),p(this).trigger("pumCheckingCondition",[e,i]),!e);t++);e||(a=!1)}return a},checkCondition:function(e){var o=e.target||null;e.settings;return o?p.fn.popmake.conditions[o]?p.fn.popmake.conditions[o].apply(this,[e]):window.console?(console.warn("Condition "+o+" does not exist."),!0):void 0:(console.warn("Condition type not set."),!1)}}),p.fn.popmake.conditions={}}(jQuery,document),function(c){"use strict";function m(e,o,t){var n,i=new Date;if("undefined"!=typeof document){if(1<arguments.length){switch(typeof(t=c.extend({path:pum_vars.home_url},m.defaults,t)).expires){case"number":i.setMilliseconds(i.getMilliseconds()+864e5*t.expires),t.expires=i;break;case"string":i.setTime(1e3*c.fn.popmake.utilities.strtotime("+"+t.expires)),t.expires=i}try{n=JSON.stringify(o),/^[\{\[]/.test(n)&&(o=n)}catch(e){}return o=d.write?d.write(o,e):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[e,"=",o,t.expires?"; expires="+t.expires.toUTCString():"",t.path?"; path="+t.path:"",t.domain?"; domain="+t.domain:"",t.secure?"; secure":""].join("")}e||(n={});for(var s=document.cookie?document.cookie.split("; "):[],r=/(%[0-9A-Z]{2})+/g,a=0;a<s.length;a++){var p=s[a].split("=");'"'===(l=p.slice(1).join("=")).charAt(0)&&(l=l.slice(1,-1));try{var u=p[0].replace(r,decodeURIComponent),l=d.read?d.read(l,u):d(l,u)||l.replace(r,decodeURIComponent);if(this.json)try{l=JSON.parse(l)}catch(e){}if(e===u){n=l;break}e||(n[u]=l)}catch(e){}}return n}}var d;c.extend(c.fn.popmake,{cookie:(void 0===d&&(d=function(){}),(m.set=m).get=function(e){return m.call(m,e)},m.getJSON=function(){return m.apply({json:!0},[].slice.call(arguments))},m.defaults={},m.remove=function(e,o){m(e,"",c.extend({},o,{expires:-1,path:""})),m(e,"",c.extend({},o,{expires:-1}))},m.process=function(e,o,t,n){return m.apply(m,3<arguments.length&&"object"!=typeof t&&void 0!==o?[e,o,{expires:t,path:n}]:[].slice.call(arguments,[0,2]))},m.withConverter=c.fn.popmake.cookie,m)}),pm_cookie=c.pm_cookie=c.fn.popmake.cookie.process,pm_cookie_json=c.pm_cookie_json=c.fn.popmake.cookie.getJSON,pm_remove_cookie=c.pm_remove_cookie=c.fn.popmake.cookie.remove}(jQuery),function(i,e,n){"use strict";function s(e){i.pm_cookie(e.name,!0,e.session?null:e.time,e.path?pum_vars.home_url||"/":null),pum.hooks.doAction("popmake.setCookie",e)}i.extend(i.fn.popmake.methods,{addCookie:function(e){return pum.hooks.doAction("popmake.addCookie",arguments),i.fn.popmake.cookies[e]?i.fn.popmake.cookies[e].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Cookie type "+e+" does not exist."),this)},setCookie:s,checkCookies:function(e){var o,t=!1;if(e.cookie_name===n||null===e.cookie_name||""===e.cookie_name)return!1;switch(typeof e.cookie_name){case"object":case"array":for(o=0;e.cookie_name.length>o;o+=1)i.pm_cookie(e.cookie_name[o])!==n&&(t=!0);break;case"string":i.pm_cookie(e.cookie_name)!==n&&(t=!0)}return pum.hooks.doAction("popmake.checkCookies",e,t),t}}),i.fn.popmake.cookies=i.fn.popmake.cookies||{},i.extend(i.fn.popmake.cookies,{on_popup_open:function(e){var o=PUM.getPopup(this);o.on("pumAfterOpen",function(){o.popmake("setCookie",e)})},on_popup_close:function(e){var o=PUM.getPopup(this);o.on("pumBeforeClose",function(){o.popmake("setCookie",e)})},form_submission:function(t){var n=PUM.getPopup(this);t=i.extend({form:"",formInstanceId:"",only_in_popup:!1},t),PUM.hooks.addAction("pum.integration.form.success",function(e,o){t.form.length&&PUM.integrations.checkFormKeyMatches(t.form,t.formInstanceId,o)&&(t.only_in_popup&&PUM.getPopup(e).length&&PUM.getPopup(e).is(n)||!t.only_in_popup)&&n.popmake("setCookie",t)})},manual:function(e){var o=PUM.getPopup(this);o.on("pumSetCookie",function(){o.popmake("setCookie",e)})},form_success:function(e){var o=PUM.getPopup(this);o.on("pumFormSuccess",function(){o.popmake("setCookie",e)})},pum_sub_form_success:function(e){var o=PUM.getPopup(this);o.find("form.pum-sub-form").on("success",function(){o.popmake("setCookie",e)})},pum_sub_form_already_subscribed:function(e){var o=PUM.getPopup(this);o.find("form.pum-sub-form").on("success",function(){o.popmake("setCookie",e)})},ninja_form_success:function(e){return i.fn.popmake.cookies.form_success.apply(this,arguments)},cf7_form_success:function(e){return i.fn.popmake.cookies.form_success.apply(this,arguments)},gforms_form_success:function(e){return i.fn.popmake.cookies.form_success.apply(this,arguments)}}),i(e).ready(function(){var e=i(".pum-cookie");e.each(function(){var o=i(this),t=e.index(o),n=o.data("cookie-args");!o.data("only-onscreen")||o.isInViewport()&&o.is(":visible")?s(n):i(window).on("scroll.pum-cookie-"+t,i.fn.popmake.utilities.throttle(function(e){o.isInViewport()&&o.is(":visible")&&(s(n),i(window).off("scroll.pum-cookie-"+t))},100))})}).on("pumInit",".pum",function(){var e,o=PUM.getPopup(this),t=o.popmake("getSettings").cookies||[],n=null;if(t.length)for(e=0;e<t.length;e+=1)n=t[e],o.popmake("addCookie",n.event,n.settings)})}(jQuery,document);var pum_debug,pum_debug_mode=!1;!function(r,e){var a,t,p;e=window.pum_vars||{debug_mode:!1},(pum_debug_mode=void 0!==e.debug_mode&&e.debug_mode)||-1===window.location.href.indexOf("pum_debug")||(pum_debug_mode=!0),pum_debug_mode&&(t=a=!1,p=window.pum_debug_vars||{debug_mode_enabled:"Popup Maker: Debug Mode Enabled",debug_started_at:"Debug started at:",debug_more_info:"For more information on how to use this information visit https://docs.wppopupmaker.com/?utm_medium=js-debug-info&utm_campaign=ContextualHelp&utm_source=browser-console&utm_content=more-info",global_info:"Global Information",localized_vars:"Localized variables",popups_initializing:"Popups Initializing",popups_initialized:"Popups Initialized",single_popup_label:"Popup: #",theme_id:"Theme ID: ",label_method_call:"Method Call:",label_method_args:"Method Arguments:",label_popup_settings:"Settings",label_triggers:"Triggers",label_cookies:"Cookies",label_delay:"Delay:",label_conditions:"Conditions",label_cookie:"Cookie:",label_settings:"Settings:",label_selector:"Selector:",label_mobile_disabled:"Mobile Disabled:",label_tablet_disabled:"Tablet Disabled:",label_event:"Event: %s",triggers:[],cookies:[]},pum_debug={odump:function(e){return r.extend({},e)},logo:function(){console.log(" -------------------------------------------------------------\n| ____ __ __ _ |\n| | _ \\ ___ _ __ _ _ _ __ | \\/ | __ _| | _____ _ __ |\n| | |_) / _ \\| '_ \\| | | | '_ \\ | |\\/| |/ _` | |/ / _ \\ '__| |\n| | __/ (_) | |_) | |_| | |_) | | | | | (_| | < __/ | |\n| |_| \\___/| .__/ \\__,_| .__/ |_| |_|\\__,_|_|\\_\\___|_| |\n| |_| |_| |\n -------------------------------------------------------------")},initialize:function(){a=!0,pum_debug.logo(),console.debug(p.debug_mode_enabled),console.log(p.debug_started_at,new Date),console.info(p.debug_more_info),pum_debug.divider(p.global_info),console.groupCollapsed(p.localized_vars),console.log("pum_vars:",pum_debug.odump(e)),r(document).trigger("pum_debug_initialize_localized_vars"),console.groupEnd(),r(document).trigger("pum_debug_initialize")},popup_event_header:function(e){var o=e.popmake("getSettings");t!==o.id&&(t=o.id,pum_debug.divider(p.single_popup_label+o.id+" - "+o.slug))},divider:function(e){var o=62,t=0,n=" "+new Array(63).join("-")+" ";"string"==typeof e?(o=62-e.length,(t={left:Math.floor(o/2),right:Math.floor(o/2)}).left+t.right===o-1&&t.right++,t.left=new Array(t.left+1).join(" "),t.right=new Array(t.right+1).join(" "),console.log(n+"\n|"+t.left+e+t.right+"|\n"+n)):console.log(n)},click_trigger:function(e,o){var t,n=e.popmake("getSettings"),i=[".popmake-"+n.id,".popmake-"+decodeURIComponent(n.slug),'a[href$="#popmake-'+n.id+'"]'];o.extra_selectors&&""!==o.extra_selectors&&i.push(o.extra_selectors),t=(i=pum.hooks.applyFilters("pum.trigger.click_open.selectors",i,o,e)).join(", "),console.log(p.label_selector,t)},trigger:function(e,o){if("string"==typeof p.triggers[o.type]){switch(console.groupCollapsed(p.triggers[o.type]),o.type){case"auto_open":console.log(p.label_delay,o.settings.delay),console.log(p.label_cookie,o.settings.cookie_name);break;case"click_open":pum_debug.click_trigger(e,o.settings),console.log(p.label_cookie,o.settings.cookie_name)}r(document).trigger("pum_debug_render_trigger",e,o),console.groupEnd()}},cookie:function(e,o){if("string"==typeof p.cookies[o.event]){switch(console.groupCollapsed(p.cookies[o.event]),o.event){case"on_popup_open":case"on_popup_close":case"manual":case"ninja_form_success":console.log(p.label_cookie,pum_debug.odump(o.settings))}r(document).trigger("pum_debug_render_trigger",e,o),console.groupEnd()}}},r(document).on("pumInit",".pum",function(){var e=PUM.getPopup(r(this)),o=e.popmake("getSettings"),t=o.triggers||[],n=o.cookies||[],i=o.conditions||[],s=0;if(a||(pum_debug.initialize(),pum_debug.divider(p.popups_initializing)),console.groupCollapsed(p.single_popup_label+o.id+" - "+o.slug),console.log(p.theme_id,o.theme_id),t.length){for(console.groupCollapsed(p.label_triggers),s=0;s<t.length;s++)pum_debug.trigger(e,t[s]);console.groupEnd()}if(n.length){for(console.groupCollapsed(p.label_cookies),s=0;s<n.length;s+=1)pum_debug.cookie(e,n[s]);console.groupEnd()}i.length&&(console.groupCollapsed(p.label_conditions),console.log(i),console.groupEnd()),console.groupCollapsed(p.label_popup_settings),console.log(p.label_mobile_disabled,!1!==o.disable_on_mobile),console.log(p.label_tablet_disabled,!1!==o.disable_on_tablet),console.log(p.label_display_settings,pum_debug.odump(o)),e.trigger("pum_debug_popup_settings"),console.groupEnd(),console.groupEnd()}).on("pumBeforeOpen",".pum",function(){var e=PUM.getPopup(r(this)),o=r.fn.popmake.last_open_trigger;pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumBeforeOpen"));try{o=(o=r(r.fn.popmake.last_open_trigger)).length?o:r.fn.popmake.last_open_trigger.toString()}catch(e){o=""}finally{console.log(p.label_triggers,[o])}console.groupEnd()}).on("pumOpenPrevented",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumOpenPrevented")),console.groupEnd()}).on("pumAfterOpen",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumAfterOpen")),console.groupEnd()}).on("pumSetupClose",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumSetupClose")),console.groupEnd()}).on("pumClosePrevented",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumClosePrevented")),console.groupEnd()}).on("pumBeforeClose",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumBeforeClose")),console.groupEnd()}).on("pumAfterClose",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumAfterClose")),console.groupEnd()}).on("pumBeforeReposition",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumBeforeReposition")),console.groupEnd()}).on("pumAfterReposition",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumAfterReposition")),console.groupEnd()}).on("pumCheckingCondition",".pum",function(e,o,t){var n=PUM.getPopup(r(this));pum_debug.popup_event_header(n),console.groupCollapsed(p.label_event.replace("%s","pumCheckingCondition")),console.log((t.not_operand?"(!) ":"")+t.target+": "+o,t),console.groupEnd()}))}(jQuery),function(e){"use strict";e.fn.popmake.defaults={id:null,slug:"",theme_id:null,cookies:[],triggers:[],conditions:[],mobile_disabled:null,tablet_disabled:null,custom_height_auto:!1,scrollable_content:!1,position_from_trigger:!1,position_fixed:!1,overlay_disabled:!1,stackable:!1,disable_reposition:!1,close_on_overlay_click:!1,close_on_form_submission:!1,close_on_form_submission_delay:0,close_on_esc_press:!1,close_on_f4_press:!1,disable_on_mobile:!1,disable_on_tablet:!1,size:"medium",responsive_min_width:"0%",responsive_max_width:"100%",custom_width:"640px",custom_height:"380px",animation_type:"fade",animation_speed:"350",animation_origin:"center top",location:"center top",position_top:"100",position_bottom:"0",position_left:"0",position_right:"0",zindex:"1999999999",close_button_delay:"0",meta:{display:{stackable:!1,overlay_disabled:!1,size:"medium",responsive_max_width:"100",responsive_max_width_unit:"%",responsive_min_width:"0",responsive_min_width_unit:"%",custom_width:"640",custom_width_unit:"px",custom_height:"380",custom_height_unit:"px",custom_height_auto:!1,location:"center top",position_top:100,position_left:0,position_bottom:0,position_right:0,position_fixed:!1,animation_type:"fade",animation_speed:350,animation_origin:"center top",scrollable_content:!1,disable_reposition:!1,position_from_trigger:!1,overlay_zindex:!1,zindex:"1999999999"},close:{overlay_click:!1,esc_press:!1,f4_press:!1,text:"",button_delay:0},click_open:[]},container:{active_class:"active",attr:{class:"popmake"}},title:{attr:{class:"popmake-title"}},content:{attr:{class:"popmake-content"}},close:{close_speed:0,attr:{class:"popmake-close"}},overlay:{attr:{id:"popmake-overlay",class:"popmake-overlay"}}}}(jQuery,document),function(s){"use strict";var r={openpopup:!1,openpopup_id:0,closepopup:!1,closedelay:0,redirect_enabled:!1,redirect:"",cookie:!1};window.PUM=window.PUM||{},window.PUM.forms=window.PUM.forms||{},s.extend(window.PUM.forms,{form:{validation:{errors:[]},responseHandler:function(e,o){var t=o.data;o.success?window.PUM.forms.form.success(e,t):window.PUM.forms.form.errors(e,t)},display_errors:function(e,o){window.PUM.forms.messages.add(e,o||this.validation.errors,"error")},beforeAjax:function(e){var o=e.find('[type="submit"]'),t=o.find(".pum-form__loader");window.PUM.forms.messages.clear_all(e),t.length||(t=s('<span class="pum-form__loader"></span>'),""!==o.attr("value")?t.insertAfter(o):o.append(t)),o.prop("disabled",!0),t.show(),e.addClass("pum-form--loading").removeClass("pum-form--errors")},afterAjax:function(e){var o=e.find('[type="submit"]'),t=o.find(".pum-form__loader");o.prop("disabled",!1),t.hide(),e.removeClass("pum-form--loading")},success:function(e,o){void 0!==o.message&&""!==o.message&&window.PUM.forms.messages.add(e,[{message:o.message}]),e.trigger("success",[o]),!e.data("noredirect")&&void 0!==e.data("redirect_enabled")&&o.redirect&&(""!==o.redirect?window.location=o.redirect:window.location.reload(!0))},errors:function(e,o){void 0!==o.errors&&o.errors.length&&(console.log(o.errors),window.PUM.forms.form.display_errors(e,o.errors),window.PUM.forms.messages.scroll_to_first(e),e.addClass("pum-form--errors").trigger("errors",[o]))},submit:function(e){var o=s(this),t=o.pumSerializeObject();e.preventDefault(),e.stopPropagation(),window.PUM.forms.form.beforeAjax(o),s.ajax({type:"POST",dataType:"json",url:pum_vars.ajaxurl,data:{action:"pum_form",values:t}}).always(function(){window.PUM.forms.form.afterAjax(o)}).done(function(e){window.PUM.forms.form.responseHandler(o,e)}).error(function(e,o,t){console.log("Error: type of "+o+" with message of "+t)})}},messages:{add:function(e,o,t){var n=e.find(".pum-form__messages"),i=0;if(t=t||"success",o=o||[],!n.length)switch(n=s('<div class="pum-form__messages">').hide(),pum_vars.message_position){case"bottom":e.append(n.addClass("pum-form__messages--bottom"));break;case"top":e.prepend(n.addClass("pum-form__messages--top"))}if(0<=["bottom","top"].indexOf(pum_vars.message_position))for(;o.length>i;i++)this.add_message(n,o[i].message,t);else for(;o.length>i;i++)void 0!==o[i].field?this.add_field_error(e,o[i]):this.add_message(n,o[i].message,t);n.is(":hidden")&&s(".pum-form__message",n).length&&n.slideDown()},add_message:function(e,o,t){var n=s('<p class="pum-form__message">').html(o);t=t||"success",n.addClass("pum-form__message--"+t),e.append(n),e.is(":visible")&&n.hide().slideDown()},add_field_error:function(e,o){var t=s('[name="'+o.field+'"]',e).parents(".pum-form__field").addClass("pum-form__field--error");this.add_message(t,o.message,"error")},clear_all:function(e,o){var t=e.find(".pum-form__messages"),n=t.find(".pum-form__message"),i=e.find(".pum-form__field.pum-form__field--error");o=o||!1,t.length&&n.slideUp("fast",function(){s(this).remove(),o&&t.hide()}),i.length&&i.removeClass("pum-form__field--error").find("p.pum-form__message").remove()},scroll_to_first:function(e){window.PUM.utilities.scrollTo(s(".pum-form__field.pum-form__field--error",e).eq(0))}},success:function(e,o){var t,n,i;(o=s.extend({},r,o))&&(t=PUM.getPopup(e),n={},i=function(){o.openpopup&&PUM.getPopup(o.openpopup_id).length?PUM.open(o.openpopup_id):o.redirect_enabled&&(""!==o.redirect?window.location=o.redirect:window.location.reload(!0))},t.length&&(t.trigger("pumFormSuccess"),o.cookie&&(n=s.extend({name:"pum-"+PUM.getSetting(t,"id"),expires:"+1 year"},"object"==typeof o.cookie?o.cookie:{}),PUM.setCookie(t,n))),t.length&&o.closepopup?setTimeout(function(){t.popmake("close",i)},1e3*parseInt(o.closedelay)):i())}})}(jQuery),function(e){"use strict";e.pum=e.pum||{},e.pum.hooks=e.pum.hooks||new function(){var t=Array.prototype.slice,i={removeFilter:function(e,o){"string"==typeof e&&n("filters",e,o);return i},applyFilters:function(){var e=t.call(arguments),o=e.shift();return"string"!=typeof o?i:r("filters",o,e)},addFilter:function(e,o,t,n){"string"==typeof e&&"function"==typeof o&&(t=parseInt(t||10,10),s("filters",e,o,t,n));return i},removeAction:function(e,o){"string"==typeof e&&n("actions",e,o);return i},doAction:function(){var e=t.call(arguments),o=e.shift();"string"==typeof o&&r("actions",o,e);return i},addAction:function(e,o,t,n){"string"==typeof e&&"function"==typeof o&&(t=parseInt(t||10,10),s("actions",e,o,t,n));return i}},a={actions:{},filters:{}};function n(e,o,t,n){var i,s,r;if(a[e][o])if(t)if(i=a[e][o],n)for(r=i.length;r--;)(s=i[r]).callback===t&&s.context===n&&i.splice(r,1);else for(r=i.length;r--;)i[r].callback===t&&i.splice(r,1);else a[e][o]=[]}function s(e,o,t,n,i){var s={callback:t,priority:n,context:i},r=(r=a[e][o])?(r.push(s),function(e){for(var o,t,n,i=1,s=e.length;i<s;i++){for(o=e[i],t=i;(n=e[t-1])&&n.priority>o.priority;)e[t]=e[t-1],--t;e[t]=o}return e}(r)):[s];a[e][o]=r}function r(e,o,t){var n,i,s=a[e][o];if(!s)return"filters"===e&&t[0];if(i=s.length,"filters"===e)for(n=0;n<i;n++)t[0]=s[n].callback.apply(s[n].context,t);else for(n=0;n<i;n++)s[n].callback.apply(s[n].context,t);return"filters"!==e||t[0]}return i},e.PUM=e.PUM||{},e.PUM.hooks=e.pum.hooks}(window),function(t){"use strict";function n(e){return e}window.PUM=window.PUM||{},window.PUM.integrations=window.PUM.integrations||{},t.extend(window.PUM.integrations,{init:function(){var e;void 0!==pum_vars.form_submission&&((e=pum_vars.form_submission).ajax=!1,e.popup=0<e.popupId?PUM.getPopup(e.popupId):null,PUM.integrations.formSubmission(null,e))},formSubmission:function(e,o){(o=t.extend({popup:PUM.getPopup(e),formProvider:null,formId:null,formInstanceId:null,formKey:null,ajax:!0,tracked:!1},o)).formKey=o.formKey||[o.formProvider,o.formId,o.formInstanceId].filter(n).join("_"),o.popup&&o.popup.length&&(o.popupId=PUM.getSetting(o.popup,"id")),window.PUM.hooks.doAction("pum.integration.form.success",e,o)},checkFormKeyMatches:function(e,o,t){o=""===o&&o;var n=-1!==["any"===e,"pumsubform"===e&&"pumsubform"===t.formProvider,e===t.formProvider+"_any",!o&&new RegExp("^"+e+"(_[d]*)?").test(t.formKey),!!o&&e+"_"+o===t.formKey].indexOf(!0);return window.PUM.hooks.applyFilters("pum.integration.checkFormKeyMatches",n,{formIdentifier:e,formInstanceId:o,submittedFormArgs:t})}})}(window.jQuery),function(p){"use strict";pum_vars&&void 0!==pum_vars.core_sub_forms_enabled&&!pum_vars.core_sub_forms_enabled||(window.PUM=window.PUM||{},window.PUM.newsletter=window.PUM.newsletter||{},p.extend(window.PUM.newsletter,{form:p.extend({},window.PUM.forms.form,{submit:function(e){var o=p(this),t=o.pumSerializeObject();e.preventDefault(),e.stopPropagation(),window.PUM.newsletter.form.beforeAjax(o),p.ajax({type:"POST",dataType:"json",url:pum_vars.ajaxurl,data:{action:"pum_sub_form",values:t}}).always(function(){window.PUM.newsletter.form.afterAjax(o)}).done(function(e){window.PUM.newsletter.form.responseHandler(o,e)}).error(function(e,o,t){console.log("Error: type of "+o+" with message of "+t)})}})}),p(document).on("submit","form.pum-sub-form",window.PUM.newsletter.form.submit).on("success","form.pum-sub-form",function(e,o){var t=p(e.target),n=t.data("settings")||{},i=t.pumSerializeObject(),s=PUM.getPopup(t),r=PUM.getSetting(s,"id"),a=p("form.pum-sub-form",s).index(t)+1;window.PUM.integrations.formSubmission(t,{formProvider:"pumsubform",formId:r,formInstanceId:a,extras:{data:o,values:i,settings:n}}),t.trigger("pumNewsletterSuccess",[o]).addClass("pum-newsletter-success"),t[0].reset(),window.pum.hooks.doAction("pum-sub-form.success",o,t),"string"==typeof n.redirect&&""!==n.redirect&&(n.redirect=atob(n.redirect)),window.PUM.forms.success(t,n)}).on("error","form.pum-sub-form",function(e,o){var t=p(e.target);t.trigger("pumNewsletterError",[o]),window.pum.hooks.doAction("pum-sub-form.errors",o,t)}))}(jQuery),function(s,r){"use strict";s.extend(s.fn.popmake.methods,{addTrigger:function(e){return s.fn.popmake.triggers[e]?s.fn.popmake.triggers[e].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Trigger type "+e+" does not exist."),this)}}),s.fn.popmake.triggers={auto_open:function(e){var o=PUM.getPopup(this);setTimeout(function(){o.popmake("state","isOpen")||!o.popmake("checkCookies",e)&&o.popmake("checkConditions")&&(s.fn.popmake.last_open_trigger="Auto Open - Delay: "+e.delay,o.popmake("open"))},e.delay)},click_open:function(n){var e,i=PUM.getPopup(this),o=i.popmake("getSettings"),t=[".popmake-"+o.id,".popmake-"+decodeURIComponent(o.slug),'a[href$="#popmake-'+o.id+'"]'];n.extra_selectors&&""!==n.extra_selectors&&t.push(n.extra_selectors),e=(t=pum.hooks.applyFilters("pum.trigger.click_open.selectors",t,n,i)).join(", "),s(e).addClass("pum-trigger").css({cursor:"pointer"}),s(r).on("click.pumTrigger",e,function(e){var o=s(this),t=n.do_default||!1;0<i.has(o).length||i.popmake("state","isOpen")||!i.popmake("checkCookies",n)&&i.popmake("checkConditions")&&(o.data("do-default")?t=o.data("do-default"):(o.hasClass("do-default")||o.hasClass("popmake-do-default")||o.hasClass("pum-do-default"))&&(t=!0),e.ctrlKey||pum.hooks.applyFilters("pum.trigger.click_open.do_default",t,i,o)||(e.preventDefault(),e.stopPropagation()),s.fn.popmake.last_open_trigger=o,i.popmake("open"))})},form_submission:function(t){var n=PUM.getPopup(this);t=s.extend({form:"",formInstanceId:"",delay:0},t);PUM.hooks.addAction("pum.integration.form.success",function(e,o){t.form.length&&PUM.integrations.checkFormKeyMatches(t.form,t.formInstanceId,o)&&setTimeout(function(){n.popmake("state","isOpen")||!n.popmake("checkCookies",t)&&n.popmake("checkConditions")&&(s.fn.popmake.last_open_trigger="Form Submission",n.popmake("open"))},t.delay)})},admin_debug:function(){PUM.getPopup(this).popmake("open")}},s(r).on("pumInit",".pum",function(){var e,o=PUM.getPopup(this),t=o.popmake("getSettings").triggers||[],n=null;if(t.length)for(e=0;e<t.length;e+=1)n=t[e],o.popmake("addTrigger",n.type,n.settings)})}(jQuery,document),function(p){"use strict";var n="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),i="select,textarea".split(","),s=/\[([^\]]*)\]/g;Array.prototype.indexOf||(Array.prototype.indexOf=function(e){if(null==this)throw new TypeError;var o=Object(this),t=o.length>>>0;if(0==t)return-1;var n=0;if(0<arguments.length&&((n=Number(arguments[1]))!=n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(0<n||-1)*Math.floor(Math.abs(n)))),t<=n)return-1;for(var i=0<=n?n:Math.max(t-Math.abs(n),0);i<t;i++)if(i in o&&o[i]===e)return i;return-1}),p.fn.popmake.utilities={scrollTo:function(e,o){var t=p(e)||p();t.length&&p("html, body").animate({scrollTop:t.offset().top-100},1e3,"swing",function(){var e=t.find(':input:not([type="button"]):not([type="hidden"]):not(button)').eq(0);e.hasClass("wp-editor-area")?tinyMCE.execCommand("mceFocus",!1,e.attr("id")):e.focus(),"function"==typeof o&&o()})},inArray:function(e,o){return!!~o.indexOf(e)},convert_hex:function(e,o){return e=e.replace("#",""),"rgba("+parseInt(e.substring(0,2),16)+","+parseInt(e.substring(2,4),16)+","+parseInt(e.substring(4,6),16)+","+o/100+")"},debounce:function(t,n){var i;return function(){var e=this,o=arguments;window.clearTimeout(i),i=window.setTimeout(function(){t.apply(e,o)},n)}},throttle:function(e,o){function t(){n=!1}var n=!1;return function(){n||(e.apply(this,arguments),window.setTimeout(t,o),n=!0)}},getXPath:function(e){var t,n,i,s,r,a=[];return p.each(p(e).parents(),function(e,o){return t=p(o),n=t.attr("id")||"",i=t.attr("class")||"",s=t.get(0).tagName.toLowerCase(),r=t.parent().children(s).index(t),"body"!==s&&(0<i.length&&(i=(i=i.split(" "))[0]),void a.push(s+(0<n.length?"#"+n:0<i.length?"."+i.split(" ").join("."):":eq("+r+")")))}),a.reverse().join(" > ")},strtotime:function(e,o){var t,n,i,s,l,c,m,r,a,p;if(!e)return!1;if((n=(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase()).match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/))&&n[2]===n[4])if(1901<n[1])switch(n[2]){case"-":return 12<n[3]||31<n[5]?!1:new Date(n[1],parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case".":return!1;case"/":return 12<n[3]||31<n[5]?!1:new Date(n[1],parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3}else if(1901<n[5])switch(n[2]){case"-":case".":return 12<n[3]||31<n[1]?!1:new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case"/":return 12<n[1]||31<n[3]?!1:new Date(n[5],parseInt(n[1],10)-1,n[3],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3}else switch(n[2]){case"-":return 12<n[3]||31<n[5]||n[1]<70&&38<n[1]?!1:(s=0<=n[1]&&n[1]<=38?+n[1]+2e3:n[1],new Date(s,parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3);case".":return 70<=n[5]?!(12<n[3]||31<n[1])&&new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3:n[5]<60&&!n[6]&&(!(23<n[1]||59<n[3])&&(i=new Date,new Date(i.getFullYear(),i.getMonth(),i.getDate(),n[1]||0,n[3]||0,n[5]||0,n[9]||0)/1e3));case"/":return 12<n[1]||31<n[3]||n[5]<70&&38<n[5]?!1:(s=0<=n[5]&&n[5]<=38?+n[5]+2e3:n[5],new Date(s,parseInt(n[1],10)-1,n[3],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3);case":":return 23<n[1]||59<n[3]||59<n[5]?!1:(i=new Date,new Date(i.getFullYear(),i.getMonth(),i.getDate(),n[1]||0,n[3]||0,n[5]||0)/1e3)}if("now"===e)return null===o||isNaN(o)?(new Date).getTime()/1e3||0:o||0;if(t=Date.parse(e),!isNaN(t))return t/1e3||0;function u(e){var o,t,n,i,s=e.split(" "),r=s[0],a=s[1].substring(0,3),p=/\d+/.test(r),u=("last"===r?-1:1)*("ago"===s[2]?-1:1);if(p&&(u*=parseInt(r,10)),m.hasOwnProperty(a)&&!s[1].match(/^mon(day|\.)?$/i))return l["set"+m[a]](l["get"+m[a]]()+u);if("wee"===a)return l.setDate(l.getDate()+7*u);if("next"===r||"last"===r)o=r,t=u,void 0!==(i=c[a])&&(0===(n=i-l.getDay())?n=7*t:0<n&&"last"===o?n-=7:n<0&&"next"===o&&(n+=7),l.setDate(l.getDate()+n));else if(!p)return;return 1}if(l=o?new Date(1e3*o):new Date,c={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},m={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},a="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)",!(n=e.match(new RegExp("([+-]?\\d+\\s(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)|(last|next)\\s(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?))(\\sago)?","gi"))))return!1;for(p=0,r=n.length;p<r;p+=1)if(!u(n[p]))return!1;return l.getTime()/1e3},serializeObject:function(e){p.extend({},e);var o={},t=p.extend(!0,{include:[],exclude:[],includeByClass:""},e);return this.find(":input").each(function(){var e;!this.name||this.disabled||window.PUM.utilities.inArray(this.name,t.exclude)||t.include.length&&!window.PUM.utilities.inArray(this.name,t.include)||-1===this.className.indexOf(t.includeByClass)||(e=this.name.replace(s,"[$1").split("["))[0]&&(this.checked||window.PUM.utilities.inArray(this.type,n)||window.PUM.utilities.inArray(this.nodeName.toLowerCase(),i))&&("checkbox"===this.type&&e.push(""),function e(o,t,n){var i=t[0];1<t.length?(o[i]||(o[i]=t[1]?{}:[]),e(o[i],t.slice(1),n)):o[i=i||o.length]=n}(o,e,p(this).val()))}),o}},p.fn.popmake.utilies=p.fn.popmake.utilities,window.PUM=window.PUM||{},window.PUM.utilities=window.PUM.utilities||{},window.PUM.utilities=p.extend(window.PUM.utilities,p.fn.popmake.utilities)}(jQuery,document),function(e){!function(e,m){var d={validate:/^[a-z_][a-z0-9_]*(?:\[(?:\d*|[a-z0-9_]+)\])*$/i,key:/[a-z0-9_]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_]+$/i};function t(n,o){var t={},i={};function s(e,o,t){e[o]=t;return e}function r(e,o){var t=e.match(d.key),n;try{o=JSON.parse(o)}catch(e){}while((n=t.pop())!==undefined){if(d.push.test(n)){var i=a(e.replace(/\[\]$/,""));o=s([],i,o)}else if(d.fixed.test(n)){o=s([],n,o)}else if(d.named.test(n)){o=s({},n,o)}}return o}function a(e){if(i[e]===undefined){i[e]=0}return i[e]++}function p(e){switch(m('[name="'+e.name+'"]',o).attr("type")){case"checkbox":return e.value==="1"?true:e.value;default:return e.value}}function e(e){if(!d.validate.test(e.name))return this;var o=r(e.name,p(e));t=n.extend(true,t,o);return this}function u(e){if(!n.isArray(e)){throw new Error("formSerializer.addPairs expects an Array")}for(var o=0,t=e.length;o<t;o++){this.addPair(e[o])}return this}function l(){return t}function c(){return JSON.stringify(l())}this.addPair=e;this.addPairs=u;this.serialize=l;this.serializeJSON=c}if(t.patterns=d,t.serializeObject=function e(){var o;if(this.is("form")){o=this.serializeArray()}else{o=this.find(":input").serializeArray()}return new t(m,this).addPairs(o).serialize()},t.serializeJSON=function e(){var o;if(this.is("form")){o=this.serializeArray()}else{o=this.find(":input").serializeArray()}return new t(m,this).addPairs(o).serializeJSON()},typeof m.fn!=="undefined"){m.fn.pumSerializeObject=t.serializeObject;m.fn.pumSerializeJSON=t.serializeJSON}e.FormSerializer=t}(e,e.jQuery||e.Zepto||e.ender||e.$)}(this);
1
+ var PUM,PUM_Accessibility,PUM_Analytics,pm_cookie,pm_cookie_json,pm_remove_cookie;!function(s){"use strict";void 0===s.fn.on&&(s.fn.on=function(e,o,t){return this.delegate(o,e,t)}),void 0===s.fn.off&&(s.fn.off=function(e,o,t){return this.undelegate(o,e,t)}),void 0===s.fn.bindFirst&&(s.fn.bindFirst=function(e,o){var t,n,i=s(this);i.unbind(e,o),i.bind(e,o),(n=(t=s._data(i[0]).events)[e]).unshift(n.pop()),t[e]=n}),void 0===s.fn.outerHtml&&(s.fn.outerHtml=function(){var e=s(this).clone();return s("<div/>").append(e).html()}),void 0===s.fn.isInViewport&&(s.fn.isInViewport=function(){var e=s(this).offset().top,o=e+s(this).outerHeight(),t=s(window).scrollTop(),n=t+s(window).height();return t<o&&e<n}),void 0===Date.now&&(Date.now=function(){return(new Date).getTime()})}(jQuery),function(p,s,r){"use strict";function i(e,o){function t(e,o,t){return o?e[o.slice(0,t?-1:o.length)]:e}return o.split(".").reduce(function(e,o){return o?o.split("[").reduce(t,e):e},e)}window.pum_vars=window.pum_vars||{default_theme:"0",home_url:"/",version:1.7,pm_dir_url:"",ajaxurl:"",restapi:!1,rest_nonce:null,debug_mode:!1,disable_tracking:!0,message_position:"top",core_sub_forms_enabled:!0,popups:{}},window.pum_popups=window.pum_popups||{},window.pum_vars.popups=window.pum_popups,PUM={get:new function(){function e(e,o,t){"boolean"==typeof o&&(t=o,o=!1);var n=o?o.selector+" "+e:e;return r!==i[n]&&!t||(i[n]=o?o.find(e):jQuery(e)),i[n]}var i={};return e.elementCache=i,e},getPopup:function(e){var o,t;return t=e,(o=isNaN(t)||parseInt(Number(t))!==parseInt(t)||isNaN(parseInt(t,10))?"current"===e?PUM.get(".pum-overlay.pum-active:eq(0)",!0):"open"===e?PUM.get(".pum-overlay.pum-active",!0):"closed"===e?PUM.get(".pum-overlay:not(.pum-active)",!0):e instanceof jQuery?e:p(e):PUM.get("#pum-"+e)).hasClass("pum-overlay")?o:o.hasClass("popmake")||o.parents(".pum-overlay").length?o.parents(".pum-overlay"):p()},open:function(e,o){PUM.getPopup(e).popmake("open",o)},close:function(e,o){PUM.getPopup(e).popmake("close",o)},preventOpen:function(e){PUM.getPopup(e).addClass("preventOpen")},getSettings:function(e){return PUM.getPopup(e).popmake("getSettings")},getSetting:function(e,o,t){var n=i(PUM.getSettings(e),o);return void 0!==n?n:t!==r?t:null},checkConditions:function(e){return PUM.getPopup(e).popmake("checkConditions")},getCookie:function(e){return p.pm_cookie(e)},getJSONCookie:function(e){return p.pm_cookie_json(e)},setCookie:function(e,o){PUM.getPopup(e).popmake("setCookie",jQuery.extend({name:"pum-"+PUM.getSetting(e,"id"),expires:"+30 days"},o))},clearCookie:function(e,o){p.pm_remove_cookie(e),"function"==typeof o&&o()},clearCookies:function(e,o){var t,n=PUM.getPopup(e).popmake("getSettings").cookies;if(n!==r&&n.length)for(t=0;n.length>t;t+=1)p.pm_remove_cookie(n[t].settings.name);"function"==typeof o&&o()},getClickTriggerSelector:function(e,o){var t=PUM.getPopup(e),n=PUM.getSettings(e),i=[".popmake-"+n.id,".popmake-"+decodeURIComponent(n.slug),'a[href$="#popmake-'+n.id+'"]'];return o.extra_selectors&&""!==o.extra_selectors&&i.push(o.extra_selectors),(i=pum.hooks.applyFilters("pum.trigger.click_open.selectors",i,o,t)).join(", ")},disableClickTriggers:function(e,o){if(e!==r)if(o!==r){var t=PUM.getClickTriggerSelector(e,o);p(t).removeClass("pum-trigger"),p(s).off("click.pumTrigger click.popmakeOpen",t)}else{var n=PUM.getSetting(e,"triggers",[]);if(n.length)for(var i=0;n.length>i;i++){-1!==pum.hooks.applyFilters("pum.disableClickTriggers.clickTriggerTypes",["click_open"]).indexOf(n[i].type)&&(t=PUM.getClickTriggerSelector(e,n[i].settings),p(t).removeClass("pum-trigger"),p(s).off("click.pumTrigger click.popmakeOpen",t))}}}},p.fn.popmake=function(e){return p.fn.popmake.methods[e]?(p(s).trigger("pumMethodCall",arguments),p.fn.popmake.methods[e].apply(this,Array.prototype.slice.call(arguments,1))):"object"!=typeof e&&e?void(window.console&&console.warn("Method "+e+" does not exist on $.fn.popmake")):p.fn.popmake.methods.init.apply(this,arguments)},p.fn.popmake.methods={init:function(){return this.each(function(){var e,o=PUM.getPopup(this),t=o.popmake("getSettings");return t.theme_id<=0&&(t.theme_id=pum_vars.default_theme),t.disable_reposition!==r&&t.disable_reposition||p(window).on("resize",function(){(o.hasClass("pum-active")||o.find(".popmake.active").length)&&p.fn.popmake.utilities.throttle(setTimeout(function(){o.popmake("reposition")},25),500,!1)}),o.find(".pum-container").data("popmake",t),o.data("popmake",t).trigger("pumInit"),t.open_sound&&"none"!==t.open_sound&&((e="custom"!==t.open_sound?new Audio(pum_vars.pm_dir_url+"/assets/sounds/"+t.open_sound):new Audio(t.custom_sound)).addEventListener("canplaythrough",function(){o.data("popAudio",e)}),e.addEventListener("error",function(){console.warn("Error occurred when trying to load Popup opening sound.")}),e.load()),this})},getOverlay:function(){return PUM.getPopup(this)},getContainer:function(){return PUM.getPopup(this).find(".pum-container")},getTitle:function(){return PUM.getPopup(this).find(".pum-title")||null},getContent:function(){return PUM.getPopup(this).find(".pum-content")||null},getClose:function(){return PUM.getPopup(this).find(".pum-content + .pum-close")||null},getSettings:function(){var e=PUM.getPopup(this);return p.extend(!0,{},p.fn.popmake.defaults,e.data("popmake")||{},"object"==typeof pum_popups&&void 0!==pum_popups[e.attr("id")]?pum_popups[e.attr("id")]:{})},state:function(e){var o=PUM.getPopup(this);if(r!==e)switch(e){case"isOpen":return o.hasClass("pum-open")||o.popmake("getContainer").hasClass("active");case"isClosed":return!o.hasClass("pum-open")&&!o.popmake("getContainer").hasClass("active")}},open:function(e){var o=PUM.getPopup(this),t=o.popmake("getContainer"),n=o.popmake("getClose"),i=o.popmake("getSettings"),s=p("html");return o.trigger("pumBeforeOpen"),o.hasClass("preventOpen")||t.hasClass("preventOpen")?(console.log("prevented"),o.removeClass("preventOpen").removeClass("pum-active").trigger("pumOpenPrevented")):(i.stackable||o.popmake("close_all"),o.addClass("pum-active"),0<i.close_button_delay&&n.fadeOut(0),s.addClass("pum-open"),i.overlay_disabled?s.addClass("pum-open-overlay-disabled"):s.addClass("pum-open-overlay"),i.position_fixed?s.addClass("pum-open-fixed"):s.addClass("pum-open-scrollable"),o.popmake("setup_close").popmake("reposition").popmake("animate",i.animation_type,function(){0<i.close_button_delay&&setTimeout(function(){n.fadeIn()},i.close_button_delay),o.trigger("pumAfterOpen"),p(window).trigger("resize"),p.fn.popmake.last_open_popup=o,e!==r&&e()}),void 0!==o.data("popAudio")&&o.data("popAudio").play().catch(function(e){console.warn("Sound was not able to play when popup opened. Reason: "+e)})),this},setup_close:function(){var t=PUM.getPopup(this),e=t.popmake("getClose"),n=t.popmake("getSettings");return(e=e.add(p(".popmake-close, .pum-close",t).not(e))).off("click.pum").on("click.pum",function(e){var o=p(this);o.hasClass("pum-do-default")||o.data("do-default")!==r&&o.data("do-default")||e.preventDefault(),p.fn.popmake.last_close_trigger="Close Button",t.popmake("close")}),(n.close_on_esc_press||n.close_on_f4_press)&&p(window).off("keyup.popmake").on("keyup.popmake",function(e){27===e.keyCode&&n.close_on_esc_press&&(p.fn.popmake.last_close_trigger="ESC Key",t.popmake("close")),115===e.keyCode&&n.close_on_f4_press&&(p.fn.popmake.last_close_trigger="F4 Key",t.popmake("close"))}),n.close_on_overlay_click&&(t.on("pumAfterOpen",function(){p(s).on("click.pumCloseOverlay",function(e){p(e.target).closest(".pum-container").length||(p.fn.popmake.last_close_trigger="Overlay Click",t.popmake("close"))})}),t.on("pumAfterClose",function(){p(s).off("click.pumCloseOverlay")})),n.close_on_form_submission&&PUM.hooks.addAction("pum.integration.form.success",function(e,o){o.popup&&o.popup[0]===t[0]&&setTimeout(function(){p.fn.popmake.last_close_trigger="Form Submission",t.popmake("close")},n.close_on_form_submission_delay||0)}),t.trigger("pumSetupClose"),this},close:function(n){return this.each(function(){var e=PUM.getPopup(this),o=e.popmake("getContainer"),t=(t=e.popmake("getClose")).add(p(".popmake-close, .pum-close",e).not(t));return e.trigger("pumBeforeClose"),e.hasClass("preventClose")||o.hasClass("preventClose")?e.removeClass("preventClose").trigger("pumClosePrevented"):o.fadeOut("fast",function(){e.is(":visible")&&e.fadeOut("fast"),p(window).off("keyup.popmake"),e.off("click.popmake"),t.off("click.popmake"),1===p(".pum-active").length&&p("html").removeClass("pum-open").removeClass("pum-open-scrollable").removeClass("pum-open-overlay").removeClass("pum-open-overlay-disabled").removeClass("pum-open-fixed"),e.removeClass("pum-active").trigger("pumAfterClose"),o.find("iframe").filter('[src*="youtube"],[src*="vimeo"]').each(function(){var e=p(this),o=e.attr("src"),t=o.replace("autoplay=1","1=1");t!==o&&(o=t),e.prop("src",o)}),o.find("video").each(function(){this.pause()}),n!==r&&n()}),this})},close_all:function(){return p(".pum-active").popmake("close"),this},reposition:function(e){var o=PUM.getPopup(this).trigger("pumBeforeReposition"),t=o.popmake("getContainer"),n=o.popmake("getSettings"),i=n.location,s={my:"",at:"",of:window,collision:"none",using:"function"==typeof e?e:p.fn.popmake.callbacks.reposition_using},r={overlay:null,container:null},a=null;try{a=p(p.fn.popmake.last_open_trigger)}catch(e){a=p()}return n.position_from_trigger&&a.length?(s.of=a,0<=i.indexOf("left")&&(s.my+=" right",s.at+=" left"+(0!==n.position_left?"-"+n.position_left:"")),0<=i.indexOf("right")&&(s.my+=" left",s.at+=" right"+(0!==n.position_right?"+"+n.position_right:"")),0<=i.indexOf("center")&&(s.my="center"===i?"center":s.my+" center",s.at="center"===i?"center":s.at+" center"),0<=i.indexOf("top")&&(s.my+=" bottom",s.at+=" top"+(0!==n.position_top?"-"+n.position_top:"")),0<=i.indexOf("bottom")&&(s.my+=" top",s.at+=" bottom"+(0!==n.position_bottom?"+"+n.position_bottom:""))):(0<=i.indexOf("left")&&(s.my+=" left"+(0!==n.position_left?"+"+n.position_left:""),s.at+=" left"),0<=i.indexOf("right")&&(s.my+=" right"+(0!==n.position_right?"-"+n.position_right:""),s.at+=" right"),0<=i.indexOf("center")&&(s.my="center"===i?"center":s.my+" center",s.at="center"===i?"center":s.at+" center"),0<=i.indexOf("top")&&(s.my+=" top"+(0!==n.position_top?"+"+(p("body").hasClass("admin-bar")?parseInt(n.position_top,10)+32:n.position_top):""),s.at+=" top"),0<=i.indexOf("bottom")&&(s.my+=" bottom"+(0!==n.position_bottom?"-"+n.position_bottom:""),s.at+=" bottom")),s.my=p.trim(s.my),s.at=p.trim(s.at),o.is(":hidden")&&(r.overlay=o.css("opacity"),o.css({opacity:0}).show(0)),t.is(":hidden")&&(r.container=t.css("opacity"),t.css({opacity:0}).show(0)),n.position_fixed&&t.addClass("fixed"),"custom"===n.size?t.css({width:n.custom_width,height:n.custom_height_auto?"auto":n.custom_height}):"auto"!==n.size&&t.addClass("responsive").css({minWidth:""!==n.responsive_min_width?n.responsive_min_width:"auto",maxWidth:""!==n.responsive_max_width?n.responsive_max_width:"auto"}),o.trigger("pumAfterReposition"),t.addClass("custom-position").position(s).trigger("popmakeAfterReposition"),"center"===i&&t[0].offsetTop<0&&t.css({top:p("body").hasClass("admin-bar")?42:10}),r.overlay&&o.css({opacity:r.overlay}).hide(0),r.container&&t.css({opacity:r.container}).hide(0),this},animation_origin:function(e){var o=PUM.getPopup(this).popmake("getContainer"),t={my:"",at:""};switch(e){case"top":t={my:"left+"+o.offset().left+" bottom-100",at:"left top"};break;case"bottom":t={my:"left+"+o.offset().left+" top+100",at:"left bottom"};break;case"left":t={my:"right top+"+o.offset().top,at:"left top"};break;case"right":t={my:"left top+"+o.offset().top,at:"right top"};break;default:0<=e.indexOf("left")&&(t={my:t.my+" right",at:t.at+" left"}),0<=e.indexOf("right")&&(t={my:t.my+" left",at:t.at+" right"}),0<=e.indexOf("center")&&(t={my:t.my+" center",at:t.at+" center"}),0<=e.indexOf("top")&&(t={my:t.my+" bottom-100",at:t.at+" top"}),0<=e.indexOf("bottom")&&(t={my:t.my+" top+100",at:t.at+" bottom"}),t.my=p.trim(t.my),t.at=p.trim(t.at)}return t.of=window,t.collision="none",t}}}(jQuery,document),function(e){"use strict";e.fn.popmake.version=1.8,e.fn.popmake.last_open_popup=null,window.PUM.init=function(){console.log("init popups ✔"),e(".pum").popmake(),e(void 0).trigger("pumInitialized"),"object"==typeof pum_vars.form_success&&(pum_vars.form_success=e.extend({popup_id:null,settings:{}}),PUM.forms.success(pum_vars.form_success.popup_id,pum_vars.form_success.settings)),PUM.integrations.init()},e(void 0).ready(function(){var e=PUM.hooks.applyFilters("pum.initHandler",PUM.init),o=PUM.hooks.applyFilters("pum.initPromises",[]);Promise.all(o).then(e)}),e(".pum").on("pumInit",function(){var e=PUM.getPopup(this),o=PUM.getSetting(e,"id"),t=e.find("form");t.length&&t.append('<input type="hidden" name="pum_form_popup_id" value="'+o+'" />')})}(jQuery),function(s,t){"use strict";var n,i,r,a="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]",e=".pum:not(.pum-accessibility-disabled)";PUM_Accessibility={forceFocus:function(e){r&&r.length&&!r[0].contains(e.target)&&(e.stopPropagation(),PUM_Accessibility.setFocusToFirstItem())},trapTabKey:function(e){var o,t,n,i;9===e.keyCode&&(o=r.find(".pum-container *").filter(a).filter(":visible"),t=s(":focus"),n=o.length,i=o.index(t),e.shiftKey?0===i&&(o.get(n-1).focus(),e.preventDefault()):i===n-1&&(o.get(0).focus(),e.preventDefault()))},setFocusToFirstItem:function(){r.find(".pum-container *").filter(a).filter(":visible").filter(":not(.pum-close)").first().focus()}},s(t).on("pumInit",e,function(){PUM.getPopup(this).find("[tabindex]").each(function(){var e=s(this);e.data("tabindex",e.attr("tabindex")).prop("tabindex","0")})}).on("pumBeforeOpen",e,function(){var e=PUM.getPopup(this),o=s(":focus");e.has(o).length||(i=o),r=e.on("keydown.pum_accessibility",PUM_Accessibility.trapTabKey).attr("aria-hidden","false"),(n=s("body > *").filter(":visible").not(r)).attr("aria-hidden","true"),s(t).one("focusin.pum_accessibility",PUM_Accessibility.forceFocus),PUM_Accessibility.setFocusToFirstItem()}).on("pumAfterOpen",e,function(){}).on("pumBeforeClose",e,function(){}).on("pumAfterClose",e,function(){PUM.getPopup(this).off("keydown.pum_accessibility").attr("aria-hidden","true"),n&&(n.attr("aria-hidden","false"),n=null),void 0!==i&&i.length&&i.focus(),r=null,s(t).off("focusin.pum_accessibility")}).on("pumSetupClose",e,function(){}).on("pumOpenPrevented",e,function(){}).on("pumClosePrevented",e,function(){}).on("pumBeforeReposition",e,function(){})}(jQuery,document),function(s){"use strict";s.fn.popmake.last_open_trigger=null,s.fn.popmake.last_close_trigger=null,s.fn.popmake.conversion_trigger=null;var r=!(void 0===pum_vars.restapi||!pum_vars.restapi);PUM_Analytics={beacon:function(e,o){var t=new Image,n=r?pum_vars.restapi:pum_vars.ajaxurl,i={route:pum.hooks.applyFilters("pum.analyticsBeaconRoute","/analytics/"),data:pum.hooks.applyFilters("pum.AnalyticsBeaconData",s.extend(!0,{event:"open",pid:null,_cache:+new Date},e)),callback:"function"==typeof o?o:function(){}};r?n+=i.route:i.data.action="pum_analytics",n&&(s(t).on("error success load done",i.callback),t.src=n+"?"+s.param(i.data))}},void 0!==pum_vars.disable_tracking&&pum_vars.disable_tracking||s(document).on("pumAfterOpen.core_analytics",".pum",function(){var e=PUM.getPopup(this),o={pid:parseInt(e.popmake("getSettings").id,10)||null};0<o.pid&&!s("body").hasClass("single-popup")&&PUM_Analytics.beacon(o)})}(jQuery),function(n,s){"use strict";function r(e){var o=e.popmake("getContainer"),t={display:"",opacity:""};e.css(t),o.css(t)}function a(e){return e.overlay_disabled?0:e.animation_speed/2}function p(e){return e.overlay_disabled?parseInt(e.animation_speed):e.animation_speed/2}n.fn.popmake.methods.animate_overlay=function(e,o,t){return PUM.getPopup(this).popmake("getSettings").overlay_disabled?n.fn.popmake.overlay_animations.none.apply(this,[o,t]):n.fn.popmake.overlay_animations[e]?n.fn.popmake.overlay_animations[e].apply(this,[o,t]):(window.console&&console.warn("Animation style "+e+" does not exist."),this)},n.fn.popmake.methods.animate=function(e){return n.fn.popmake.animations[e]?n.fn.popmake.animations[e].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Animation style "+e+" does not exist."),this)},n.fn.popmake.animations={none:function(e){var o=PUM.getPopup(this);return o.popmake("getContainer").css({opacity:1,display:"block"}),o.popmake("animate_overlay","none",0,function(){e!==s&&e()}),this},slide:function(o){var e=PUM.getPopup(this),t=e.popmake("getContainer"),n=e.popmake("getSettings"),i=e.popmake("animation_origin",n.animation_origin);return r(e),t.position(i),e.popmake("animate_overlay","fade",a(n),function(){t.popmake("reposition",function(e){t.animate(e,p(n),"swing",function(){o!==s&&o()})})}),this},fade:function(e){var o=PUM.getPopup(this),t=o.popmake("getContainer"),n=o.popmake("getSettings");return r(o),o.css({opacity:0,display:"block"}),t.css({opacity:0,display:"block"}),o.popmake("animate_overlay","fade",a(n),function(){t.animate({opacity:1},p(n),"swing",function(){e!==s&&e()})}),this},fadeAndSlide:function(o){var e=PUM.getPopup(this),t=e.popmake("getContainer"),n=e.popmake("getSettings"),i=e.popmake("animation_origin",n.animation_origin);return r(e),e.css({display:"block",opacity:0}),t.css({display:"block",opacity:0}),t.position(i),e.popmake("animate_overlay","fade",a(n),function(){t.popmake("reposition",function(e){e.opacity=1,t.animate(e,p(n),"swing",function(){o!==s&&o()})})}),this},grow:function(e){return n.fn.popmake.animations.fade.apply(this,arguments)},growAndSlide:function(e){return n.fn.popmake.animations.fadeAndSlide.apply(this,arguments)}},n.fn.popmake.overlay_animations={none:function(e,o){PUM.getPopup(this).css({opacity:1,display:"block"}),"function"==typeof o&&o()},fade:function(e,o){PUM.getPopup(this).css({opacity:0,display:"block"}).animate({opacity:1},e,"swing",o)},slide:function(e,o){PUM.getPopup(this).slideDown(e,o)}}}(jQuery,void document),function(e,o){"use strict";e(o).on("pumInit",".pum",function(){e(this).popmake("getContainer").trigger("popmakeInit")}).on("pumBeforeOpen",".pum",function(){e(this).popmake("getContainer").addClass("active").trigger("popmakeBeforeOpen")}).on("pumAfterOpen",".pum",function(){e(this).popmake("getContainer").trigger("popmakeAfterOpen")}).on("pumBeforeClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeClose")}).on("pumAfterClose",".pum",function(){e(this).popmake("getContainer").removeClass("active").trigger("popmakeAfterClose")}).on("pumSetupClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeSetupClose")}).on("pumOpenPrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventOpen").removeClass("active")}).on("pumClosePrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventClose")}).on("pumBeforeReposition",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeReposition")})}(jQuery,document),function(o){"use strict";o.fn.popmake.callbacks={reposition_using:function(e){o(this).css(e)}}}(jQuery,document),function(p){"use strict";function u(){return void 0===e&&(e="undefined"!=typeof MobileDetect?new MobileDetect(window.navigator.userAgent):{phone:function(){return!1},tablet:function(){return!1}}),e}var e;p.extend(p.fn.popmake.methods,{checkConditions:function(){var e,o,t,n,i,s=PUM.getPopup(this),r=s.popmake("getSettings"),a=!0;if(r.disable_on_mobile&&u().phone())return!1;if(r.disable_on_tablet&&u().tablet())return!1;if(r.conditions.length)for(o=0;r.conditions.length>o;o++){for(n=r.conditions[o],e=!1,t=0;n.length>t&&((!(i=p.extend({},{not_operand:!1},n[t])).not_operand&&s.popmake("checkCondition",i)||i.not_operand&&!s.popmake("checkCondition",i))&&(e=!0),p(this).trigger("pumCheckingCondition",[e,i]),!e);t++);e||(a=!1)}return a},checkCondition:function(e){var o=e.target||null;e.settings;return o?p.fn.popmake.conditions[o]?p.fn.popmake.conditions[o].apply(this,[e]):window.console?(console.warn("Condition "+o+" does not exist."),!0):void 0:(console.warn("Condition type not set."),!1)}}),p.fn.popmake.conditions={}}(jQuery,document),function(c){"use strict";function m(e,o,t){var n,i=new Date;if("undefined"!=typeof document){if(1<arguments.length){switch(typeof(t=c.extend({path:pum_vars.home_url},m.defaults,t)).expires){case"number":i.setMilliseconds(i.getMilliseconds()+864e5*t.expires),t.expires=i;break;case"string":i.setTime(1e3*c.fn.popmake.utilities.strtotime("+"+t.expires)),t.expires=i}try{n=JSON.stringify(o),/^[\{\[]/.test(n)&&(o=n)}catch(e){}return o=d.write?d.write(o,e):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[e,"=",o,t.expires?"; expires="+t.expires.toUTCString():"",t.path?"; path="+t.path:"",t.domain?"; domain="+t.domain:"",t.secure?"; secure":""].join("")}e||(n={});for(var s=document.cookie?document.cookie.split("; "):[],r=/(%[0-9A-Z]{2})+/g,a=0;a<s.length;a++){var p=s[a].split("=");'"'===(l=p.slice(1).join("=")).charAt(0)&&(l=l.slice(1,-1));try{var u=p[0].replace(r,decodeURIComponent),l=d.read?d.read(l,u):d(l,u)||l.replace(r,decodeURIComponent);if(this.json)try{l=JSON.parse(l)}catch(e){}if(e===u){n=l;break}e||(n[u]=l)}catch(e){}}return n}}var d;c.extend(c.fn.popmake,{cookie:(void 0===d&&(d=function(){}),(m.set=m).get=function(e){return m.call(m,e)},m.getJSON=function(){return m.apply({json:!0},[].slice.call(arguments))},m.defaults={},m.remove=function(e,o){m(e,"",c.extend({},o,{expires:-1,path:""})),m(e,"",c.extend({},o,{expires:-1}))},m.process=function(e,o,t,n){return m.apply(m,3<arguments.length&&"object"!=typeof t&&void 0!==o?[e,o,{expires:t,path:n}]:[].slice.call(arguments,[0,2]))},m.withConverter=c.fn.popmake.cookie,m)}),pm_cookie=c.pm_cookie=c.fn.popmake.cookie.process,pm_cookie_json=c.pm_cookie_json=c.fn.popmake.cookie.getJSON,pm_remove_cookie=c.pm_remove_cookie=c.fn.popmake.cookie.remove}(jQuery),function(i,e,n){"use strict";function s(e){i.pm_cookie(e.name,!0,e.session?null:e.time,e.path?pum_vars.home_url||"/":null),pum.hooks.doAction("popmake.setCookie",e)}i.extend(i.fn.popmake.methods,{addCookie:function(e){return pum.hooks.doAction("popmake.addCookie",arguments),i.fn.popmake.cookies[e]?i.fn.popmake.cookies[e].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Cookie type "+e+" does not exist."),this)},setCookie:s,checkCookies:function(e){var o,t=!1;if(e.cookie_name===n||null===e.cookie_name||""===e.cookie_name)return!1;switch(typeof e.cookie_name){case"object":case"array":for(o=0;e.cookie_name.length>o;o+=1)i.pm_cookie(e.cookie_name[o])!==n&&(t=!0);break;case"string":i.pm_cookie(e.cookie_name)!==n&&(t=!0)}return pum.hooks.doAction("popmake.checkCookies",e,t),t}}),i.fn.popmake.cookies=i.fn.popmake.cookies||{},i.extend(i.fn.popmake.cookies,{on_popup_open:function(e){var o=PUM.getPopup(this);o.on("pumAfterOpen",function(){o.popmake("setCookie",e)})},on_popup_close:function(e){var o=PUM.getPopup(this);o.on("pumBeforeClose",function(){o.popmake("setCookie",e)})},form_submission:function(t){var n=PUM.getPopup(this);t=i.extend({form:"",formInstanceId:"",only_in_popup:!1},t),PUM.hooks.addAction("pum.integration.form.success",function(e,o){t.form.length&&PUM.integrations.checkFormKeyMatches(t.form,t.formInstanceId,o)&&(t.only_in_popup&&PUM.getPopup(e).length&&PUM.getPopup(e).is(n)||!t.only_in_popup)&&n.popmake("setCookie",t)})},manual:function(e){var o=PUM.getPopup(this);o.on("pumSetCookie",function(){o.popmake("setCookie",e)})},form_success:function(e){var o=PUM.getPopup(this);o.on("pumFormSuccess",function(){o.popmake("setCookie",e)})},pum_sub_form_success:function(e){var o=PUM.getPopup(this);o.find("form.pum-sub-form").on("success",function(){o.popmake("setCookie",e)})},pum_sub_form_already_subscribed:function(e){var o=PUM.getPopup(this);o.find("form.pum-sub-form").on("success",function(){o.popmake("setCookie",e)})},ninja_form_success:function(e){return i.fn.popmake.cookies.form_success.apply(this,arguments)},cf7_form_success:function(e){return i.fn.popmake.cookies.form_success.apply(this,arguments)},gforms_form_success:function(e){return i.fn.popmake.cookies.form_success.apply(this,arguments)}}),i(e).ready(function(){var e=i(".pum-cookie");e.each(function(){var o=i(this),t=e.index(o),n=o.data("cookie-args");!o.data("only-onscreen")||o.isInViewport()&&o.is(":visible")?s(n):i(window).on("scroll.pum-cookie-"+t,i.fn.popmake.utilities.throttle(function(e){o.isInViewport()&&o.is(":visible")&&(s(n),i(window).off("scroll.pum-cookie-"+t))},100))})}).on("pumInit",".pum",function(){var e,o=PUM.getPopup(this),t=o.popmake("getSettings").cookies||[],n=null;if(t.length)for(e=0;e<t.length;e+=1)n=t[e],o.popmake("addCookie",n.event,n.settings)})}(jQuery,document);var pum_debug,pum_debug_mode=!1;!function(r,e){var a,t,p;e=window.pum_vars||{debug_mode:!1},(pum_debug_mode=void 0!==e.debug_mode&&e.debug_mode)||-1===window.location.href.indexOf("pum_debug")||(pum_debug_mode=!0),pum_debug_mode&&(t=a=!1,p=window.pum_debug_vars||{debug_mode_enabled:"Popup Maker: Debug Mode Enabled",debug_started_at:"Debug started at:",debug_more_info:"For more information on how to use this information visit https://docs.wppopupmaker.com/?utm_medium=js-debug-info&utm_campaign=ContextualHelp&utm_source=browser-console&utm_content=more-info",global_info:"Global Information",localized_vars:"Localized variables",popups_initializing:"Popups Initializing",popups_initialized:"Popups Initialized",single_popup_label:"Popup: #",theme_id:"Theme ID: ",label_method_call:"Method Call:",label_method_args:"Method Arguments:",label_popup_settings:"Settings",label_triggers:"Triggers",label_cookies:"Cookies",label_delay:"Delay:",label_conditions:"Conditions",label_cookie:"Cookie:",label_settings:"Settings:",label_selector:"Selector:",label_mobile_disabled:"Mobile Disabled:",label_tablet_disabled:"Tablet Disabled:",label_event:"Event: %s",triggers:[],cookies:[]},pum_debug={odump:function(e){return r.extend({},e)},logo:function(){console.log(" -------------------------------------------------------------\n| ____ __ __ _ |\n| | _ \\ ___ _ __ _ _ _ __ | \\/ | __ _| | _____ _ __ |\n| | |_) / _ \\| '_ \\| | | | '_ \\ | |\\/| |/ _` | |/ / _ \\ '__| |\n| | __/ (_) | |_) | |_| | |_) | | | | | (_| | < __/ | |\n| |_| \\___/| .__/ \\__,_| .__/ |_| |_|\\__,_|_|\\_\\___|_| |\n| |_| |_| |\n -------------------------------------------------------------")},initialize:function(){a=!0,pum_debug.logo(),console.debug(p.debug_mode_enabled),console.log(p.debug_started_at,new Date),console.info(p.debug_more_info),pum_debug.divider(p.global_info),console.groupCollapsed(p.localized_vars),console.log("pum_vars:",pum_debug.odump(e)),r(document).trigger("pum_debug_initialize_localized_vars"),console.groupEnd(),r(document).trigger("pum_debug_initialize")},popup_event_header:function(e){var o=e.popmake("getSettings");t!==o.id&&(t=o.id,pum_debug.divider(p.single_popup_label+o.id+" - "+o.slug))},divider:function(e){var o=62,t=0,n=" "+new Array(63).join("-")+" ";"string"==typeof e?(o=62-e.length,(t={left:Math.floor(o/2),right:Math.floor(o/2)}).left+t.right===o-1&&t.right++,t.left=new Array(t.left+1).join(" "),t.right=new Array(t.right+1).join(" "),console.log(n+"\n|"+t.left+e+t.right+"|\n"+n)):console.log(n)},click_trigger:function(e,o){var t,n=e.popmake("getSettings"),i=[".popmake-"+n.id,".popmake-"+decodeURIComponent(n.slug),'a[href$="#popmake-'+n.id+'"]'];o.extra_selectors&&""!==o.extra_selectors&&i.push(o.extra_selectors),t=(i=pum.hooks.applyFilters("pum.trigger.click_open.selectors",i,o,e)).join(", "),console.log(p.label_selector,t)},trigger:function(e,o){if("string"==typeof p.triggers[o.type]){switch(console.groupCollapsed(p.triggers[o.type]),o.type){case"auto_open":console.log(p.label_delay,o.settings.delay),console.log(p.label_cookie,o.settings.cookie_name);break;case"click_open":pum_debug.click_trigger(e,o.settings),console.log(p.label_cookie,o.settings.cookie_name)}r(document).trigger("pum_debug_render_trigger",e,o),console.groupEnd()}},cookie:function(e,o){if("string"==typeof p.cookies[o.event]){switch(console.groupCollapsed(p.cookies[o.event]),o.event){case"on_popup_open":case"on_popup_close":case"manual":case"ninja_form_success":console.log(p.label_cookie,pum_debug.odump(o.settings))}r(document).trigger("pum_debug_render_trigger",e,o),console.groupEnd()}}},r(document).on("pumInit",".pum",function(){var e=PUM.getPopup(r(this)),o=e.popmake("getSettings"),t=o.triggers||[],n=o.cookies||[],i=o.conditions||[],s=0;if(a||(pum_debug.initialize(),pum_debug.divider(p.popups_initializing)),console.groupCollapsed(p.single_popup_label+o.id+" - "+o.slug),console.log(p.theme_id,o.theme_id),t.length){for(console.groupCollapsed(p.label_triggers),s=0;s<t.length;s++)pum_debug.trigger(e,t[s]);console.groupEnd()}if(n.length){for(console.groupCollapsed(p.label_cookies),s=0;s<n.length;s+=1)pum_debug.cookie(e,n[s]);console.groupEnd()}i.length&&(console.groupCollapsed(p.label_conditions),console.log(i),console.groupEnd()),console.groupCollapsed(p.label_popup_settings),console.log(p.label_mobile_disabled,!1!==o.disable_on_mobile),console.log(p.label_tablet_disabled,!1!==o.disable_on_tablet),console.log(p.label_display_settings,pum_debug.odump(o)),e.trigger("pum_debug_popup_settings"),console.groupEnd(),console.groupEnd()}).on("pumBeforeOpen",".pum",function(){var e=PUM.getPopup(r(this)),o=r.fn.popmake.last_open_trigger;pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumBeforeOpen"));try{o=(o=r(r.fn.popmake.last_open_trigger)).length?o:r.fn.popmake.last_open_trigger.toString()}catch(e){o=""}finally{console.log(p.label_triggers,[o])}console.groupEnd()}).on("pumOpenPrevented",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumOpenPrevented")),console.groupEnd()}).on("pumAfterOpen",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumAfterOpen")),console.groupEnd()}).on("pumSetupClose",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumSetupClose")),console.groupEnd()}).on("pumClosePrevented",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumClosePrevented")),console.groupEnd()}).on("pumBeforeClose",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumBeforeClose")),console.groupEnd()}).on("pumAfterClose",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumAfterClose")),console.groupEnd()}).on("pumBeforeReposition",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumBeforeReposition")),console.groupEnd()}).on("pumAfterReposition",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumAfterReposition")),console.groupEnd()}).on("pumCheckingCondition",".pum",function(e,o,t){var n=PUM.getPopup(r(this));pum_debug.popup_event_header(n),console.groupCollapsed(p.label_event.replace("%s","pumCheckingCondition")),console.log((t.not_operand?"(!) ":"")+t.target+": "+o,t),console.groupEnd()}))}(jQuery),function(e){"use strict";e.fn.popmake.defaults={id:null,slug:"",theme_id:null,cookies:[],triggers:[],conditions:[],mobile_disabled:null,tablet_disabled:null,custom_height_auto:!1,scrollable_content:!1,position_from_trigger:!1,position_fixed:!1,overlay_disabled:!1,stackable:!1,disable_reposition:!1,close_on_overlay_click:!1,close_on_form_submission:!1,close_on_form_submission_delay:0,close_on_esc_press:!1,close_on_f4_press:!1,disable_on_mobile:!1,disable_on_tablet:!1,size:"medium",responsive_min_width:"0%",responsive_max_width:"100%",custom_width:"640px",custom_height:"380px",animation_type:"fade",animation_speed:"350",animation_origin:"center top",location:"center top",position_top:"100",position_bottom:"0",position_left:"0",position_right:"0",zindex:"1999999999",close_button_delay:"0",meta:{display:{stackable:!1,overlay_disabled:!1,size:"medium",responsive_max_width:"100",responsive_max_width_unit:"%",responsive_min_width:"0",responsive_min_width_unit:"%",custom_width:"640",custom_width_unit:"px",custom_height:"380",custom_height_unit:"px",custom_height_auto:!1,location:"center top",position_top:100,position_left:0,position_bottom:0,position_right:0,position_fixed:!1,animation_type:"fade",animation_speed:350,animation_origin:"center top",scrollable_content:!1,disable_reposition:!1,position_from_trigger:!1,overlay_zindex:!1,zindex:"1999999999"},close:{overlay_click:!1,esc_press:!1,f4_press:!1,text:"",button_delay:0},click_open:[]},container:{active_class:"active",attr:{class:"popmake"}},title:{attr:{class:"popmake-title"}},content:{attr:{class:"popmake-content"}},close:{close_speed:0,attr:{class:"popmake-close"}},overlay:{attr:{id:"popmake-overlay",class:"popmake-overlay"}}}}(jQuery,document),function(s){"use strict";var r={openpopup:!1,openpopup_id:0,closepopup:!1,closedelay:0,redirect_enabled:!1,redirect:"",cookie:!1};window.PUM=window.PUM||{},window.PUM.forms=window.PUM.forms||{},s.extend(window.PUM.forms,{form:{validation:{errors:[]},responseHandler:function(e,o){var t=o.data;o.success?window.PUM.forms.form.success(e,t):window.PUM.forms.form.errors(e,t)},display_errors:function(e,o){window.PUM.forms.messages.add(e,o||this.validation.errors,"error")},beforeAjax:function(e){var o=e.find('[type="submit"]'),t=o.find(".pum-form__loader");window.PUM.forms.messages.clear_all(e),t.length||(t=s('<span class="pum-form__loader"></span>'),""!==o.attr("value")?t.insertAfter(o):o.append(t)),o.prop("disabled",!0),t.show(),e.addClass("pum-form--loading").removeClass("pum-form--errors")},afterAjax:function(e){var o=e.find('[type="submit"]'),t=o.find(".pum-form__loader");o.prop("disabled",!1),t.hide(),e.removeClass("pum-form--loading")},success:function(e,o){void 0!==o.message&&""!==o.message&&window.PUM.forms.messages.add(e,[{message:o.message}]),e.trigger("success",[o]),!e.data("noredirect")&&void 0!==e.data("redirect_enabled")&&o.redirect&&(""!==o.redirect?window.location=o.redirect:window.location.reload(!0))},errors:function(e,o){void 0!==o.errors&&o.errors.length&&(console.log(o.errors),window.PUM.forms.form.display_errors(e,o.errors),window.PUM.forms.messages.scroll_to_first(e),e.addClass("pum-form--errors").trigger("errors",[o]))},submit:function(e){var o=s(this),t=o.pumSerializeObject();e.preventDefault(),e.stopPropagation(),window.PUM.forms.form.beforeAjax(o),s.ajax({type:"POST",dataType:"json",url:pum_vars.ajaxurl,data:{action:"pum_form",values:t}}).always(function(){window.PUM.forms.form.afterAjax(o)}).done(function(e){window.PUM.forms.form.responseHandler(o,e)}).error(function(e,o,t){console.log("Error: type of "+o+" with message of "+t)})}},messages:{add:function(e,o,t){var n=e.find(".pum-form__messages"),i=0;if(t=t||"success",o=o||[],!n.length)switch(n=s('<div class="pum-form__messages">').hide(),pum_vars.message_position){case"bottom":e.append(n.addClass("pum-form__messages--bottom"));break;case"top":e.prepend(n.addClass("pum-form__messages--top"))}if(0<=["bottom","top"].indexOf(pum_vars.message_position))for(;o.length>i;i++)this.add_message(n,o[i].message,t);else for(;o.length>i;i++)void 0!==o[i].field?this.add_field_error(e,o[i]):this.add_message(n,o[i].message,t);n.is(":hidden")&&s(".pum-form__message",n).length&&n.slideDown()},add_message:function(e,o,t){var n=s('<p class="pum-form__message">').html(o);t=t||"success",n.addClass("pum-form__message--"+t),e.append(n),e.is(":visible")&&n.hide().slideDown()},add_field_error:function(e,o){var t=s('[name="'+o.field+'"]',e).parents(".pum-form__field").addClass("pum-form__field--error");this.add_message(t,o.message,"error")},clear_all:function(e,o){var t=e.find(".pum-form__messages"),n=t.find(".pum-form__message"),i=e.find(".pum-form__field.pum-form__field--error");o=o||!1,t.length&&n.slideUp("fast",function(){s(this).remove(),o&&t.hide()}),i.length&&i.removeClass("pum-form__field--error").find("p.pum-form__message").remove()},scroll_to_first:function(e){window.PUM.utilities.scrollTo(s(".pum-form__field.pum-form__field--error",e).eq(0))}},success:function(e,o){var t,n,i;(o=s.extend({},r,o))&&(t=PUM.getPopup(e),n={},i=function(){o.openpopup&&PUM.getPopup(o.openpopup_id).length?PUM.open(o.openpopup_id):o.redirect_enabled&&(""!==o.redirect?window.location=o.redirect:window.location.reload(!0))},t.length&&(t.trigger("pumFormSuccess"),o.cookie&&(n=s.extend({name:"pum-"+PUM.getSetting(t,"id"),expires:"+1 year"},"object"==typeof o.cookie?o.cookie:{}),PUM.setCookie(t,n))),t.length&&o.closepopup?setTimeout(function(){t.popmake("close",i)},1e3*parseInt(o.closedelay)):i())}})}(jQuery),function(e){"use strict";e.pum=e.pum||{},e.pum.hooks=e.pum.hooks||new function(){var t=Array.prototype.slice,i={removeFilter:function(e,o){"string"==typeof e&&n("filters",e,o);return i},applyFilters:function(){var e=t.call(arguments),o=e.shift();return"string"!=typeof o?i:r("filters",o,e)},addFilter:function(e,o,t,n){"string"==typeof e&&"function"==typeof o&&(t=parseInt(t||10,10),s("filters",e,o,t,n));return i},removeAction:function(e,o){"string"==typeof e&&n("actions",e,o);return i},doAction:function(){var e=t.call(arguments),o=e.shift();"string"==typeof o&&r("actions",o,e);return i},addAction:function(e,o,t,n){"string"==typeof e&&"function"==typeof o&&(t=parseInt(t||10,10),s("actions",e,o,t,n));return i}},a={actions:{},filters:{}};function n(e,o,t,n){var i,s,r;if(a[e][o])if(t)if(i=a[e][o],n)for(r=i.length;r--;)(s=i[r]).callback===t&&s.context===n&&i.splice(r,1);else for(r=i.length;r--;)i[r].callback===t&&i.splice(r,1);else a[e][o]=[]}function s(e,o,t,n,i){var s={callback:t,priority:n,context:i},r=(r=a[e][o])?(r.push(s),function(e){for(var o,t,n,i=1,s=e.length;i<s;i++){for(o=e[i],t=i;(n=e[t-1])&&n.priority>o.priority;)e[t]=e[t-1],--t;e[t]=o}return e}(r)):[s];a[e][o]=r}function r(e,o,t){var n,i,s=a[e][o];if(!s)return"filters"===e&&t[0];if(i=s.length,"filters"===e)for(n=0;n<i;n++)t[0]=s[n].callback.apply(s[n].context,t);else for(n=0;n<i;n++)s[n].callback.apply(s[n].context,t);return"filters"!==e||t[0]}return i},e.PUM=e.PUM||{},e.PUM.hooks=e.pum.hooks}(window),function(t){"use strict";function n(e){return e}window.PUM=window.PUM||{},window.PUM.integrations=window.PUM.integrations||{},t.extend(window.PUM.integrations,{init:function(){var e;void 0!==pum_vars.form_submission&&((e=pum_vars.form_submission).ajax=!1,e.popup=0<e.popupId?PUM.getPopup(e.popupId):null,PUM.integrations.formSubmission(null,e))},formSubmission:function(e,o){(o=t.extend({popup:PUM.getPopup(e),formProvider:null,formId:null,formInstanceId:null,formKey:null,ajax:!0,tracked:!1},o)).formKey=o.formKey||[o.formProvider,o.formId,o.formInstanceId].filter(n).join("_"),o.popup&&o.popup.length&&(o.popupId=PUM.getSetting(o.popup,"id")),window.PUM.hooks.doAction("pum.integration.form.success",e,o)},checkFormKeyMatches:function(e,o,t){o=""===o&&o;var n=-1!==["any"===e,"pumsubform"===e&&"pumsubform"===t.formProvider,e===t.formProvider+"_any",!o&&new RegExp("^"+e+"(_[d]*)?").test(t.formKey),!!o&&e+"_"+o===t.formKey].indexOf(!0);return window.PUM.hooks.applyFilters("pum.integration.checkFormKeyMatches",n,{formIdentifier:e,formInstanceId:o,submittedFormArgs:t})}})}(window.jQuery),function(p){"use strict";pum_vars&&void 0!==pum_vars.core_sub_forms_enabled&&!pum_vars.core_sub_forms_enabled||(window.PUM=window.PUM||{},window.PUM.newsletter=window.PUM.newsletter||{},p.extend(window.PUM.newsletter,{form:p.extend({},window.PUM.forms.form,{submit:function(e){var o=p(this),t=o.pumSerializeObject();e.preventDefault(),e.stopPropagation(),window.PUM.newsletter.form.beforeAjax(o),p.ajax({type:"POST",dataType:"json",url:pum_vars.ajaxurl,data:{action:"pum_sub_form",values:t}}).always(function(){window.PUM.newsletter.form.afterAjax(o)}).done(function(e){window.PUM.newsletter.form.responseHandler(o,e)}).error(function(e,o,t){console.log("Error: type of "+o+" with message of "+t)})}})}),p(document).on("submit","form.pum-sub-form",window.PUM.newsletter.form.submit).on("success","form.pum-sub-form",function(e,o){var t=p(e.target),n=t.data("settings")||{},i=t.pumSerializeObject(),s=PUM.getPopup(t),r=PUM.getSetting(s,"id"),a=p("form.pum-sub-form",s).index(t)+1;window.PUM.integrations.formSubmission(t,{formProvider:"pumsubform",formId:r,formInstanceId:a,extras:{data:o,values:i,settings:n}}),t.trigger("pumNewsletterSuccess",[o]).addClass("pum-newsletter-success"),t[0].reset(),window.pum.hooks.doAction("pum-sub-form.success",o,t),"string"==typeof n.redirect&&""!==n.redirect&&(n.redirect=atob(n.redirect)),window.PUM.forms.success(t,n)}).on("error","form.pum-sub-form",function(e,o){var t=p(e.target);t.trigger("pumNewsletterError",[o]),window.pum.hooks.doAction("pum-sub-form.errors",o,t)}))}(jQuery),function(s,r){"use strict";s.extend(s.fn.popmake.methods,{addTrigger:function(e){return s.fn.popmake.triggers[e]?s.fn.popmake.triggers[e].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Trigger type "+e+" does not exist."),this)}}),s.fn.popmake.triggers={auto_open:function(e){var o=PUM.getPopup(this);setTimeout(function(){o.popmake("state","isOpen")||!o.popmake("checkCookies",e)&&o.popmake("checkConditions")&&(s.fn.popmake.last_open_trigger="Auto Open - Delay: "+e.delay,o.popmake("open"))},e.delay)},click_open:function(n){var e,i=PUM.getPopup(this),o=i.popmake("getSettings"),t=[".popmake-"+o.id,".popmake-"+decodeURIComponent(o.slug),'a[href$="#popmake-'+o.id+'"]'];n.extra_selectors&&""!==n.extra_selectors&&t.push(n.extra_selectors),e=(t=pum.hooks.applyFilters("pum.trigger.click_open.selectors",t,n,i)).join(", "),s(e).addClass("pum-trigger").css({cursor:"pointer"}),s(r).on("click.pumTrigger",e,function(e){var o=s(this),t=n.do_default||!1;0<i.has(o).length||i.popmake("state","isOpen")||!i.popmake("checkCookies",n)&&i.popmake("checkConditions")&&(o.data("do-default")?t=o.data("do-default"):(o.hasClass("do-default")||o.hasClass("popmake-do-default")||o.hasClass("pum-do-default"))&&(t=!0),e.ctrlKey||pum.hooks.applyFilters("pum.trigger.click_open.do_default",t,i,o)||(e.preventDefault(),e.stopPropagation()),s.fn.popmake.last_open_trigger=o,i.popmake("open"))})},form_submission:function(t){var n=PUM.getPopup(this);t=s.extend({form:"",formInstanceId:"",delay:0},t);PUM.hooks.addAction("pum.integration.form.success",function(e,o){t.form.length&&PUM.integrations.checkFormKeyMatches(t.form,t.formInstanceId,o)&&setTimeout(function(){n.popmake("state","isOpen")||!n.popmake("checkCookies",t)&&n.popmake("checkConditions")&&(s.fn.popmake.last_open_trigger="Form Submission",n.popmake("open"))},t.delay)})},admin_debug:function(){PUM.getPopup(this).popmake("open")}},s(r).on("pumInit",".pum",function(){var e,o=PUM.getPopup(this),t=o.popmake("getSettings").triggers||[],n=null;if(t.length)for(e=0;e<t.length;e+=1)n=t[e],o.popmake("addTrigger",n.type,n.settings)})}(jQuery,document),function(p){"use strict";var n="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),i="select,textarea".split(","),s=/\[([^\]]*)\]/g;Array.prototype.indexOf||(Array.prototype.indexOf=function(e){if(null==this)throw new TypeError;var o=Object(this),t=o.length>>>0;if(0==t)return-1;var n=0;if(0<arguments.length&&((n=Number(arguments[1]))!=n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(0<n||-1)*Math.floor(Math.abs(n)))),t<=n)return-1;for(var i=0<=n?n:Math.max(t-Math.abs(n),0);i<t;i++)if(i in o&&o[i]===e)return i;return-1}),p.fn.popmake.utilities={scrollTo:function(e,o){var t=p(e)||p();t.length&&p("html, body").animate({scrollTop:t.offset().top-100},1e3,"swing",function(){var e=t.find(':input:not([type="button"]):not([type="hidden"]):not(button)').eq(0);e.hasClass("wp-editor-area")?tinyMCE.execCommand("mceFocus",!1,e.attr("id")):e.focus(),"function"==typeof o&&o()})},inArray:function(e,o){return!!~o.indexOf(e)},convert_hex:function(e,o){return e=e.replace("#",""),"rgba("+parseInt(e.substring(0,2),16)+","+parseInt(e.substring(2,4),16)+","+parseInt(e.substring(4,6),16)+","+o/100+")"},debounce:function(t,n){var i;return function(){var e=this,o=arguments;window.clearTimeout(i),i=window.setTimeout(function(){t.apply(e,o)},n)}},throttle:function(e,o){function t(){n=!1}var n=!1;return function(){n||(e.apply(this,arguments),window.setTimeout(t,o),n=!0)}},getXPath:function(e){var t,n,i,s,r,a=[];return p.each(p(e).parents(),function(e,o){return t=p(o),n=t.attr("id")||"",i=t.attr("class")||"",s=t.get(0).tagName.toLowerCase(),r=t.parent().children(s).index(t),"body"!==s&&(0<i.length&&(i=(i=i.split(" "))[0]),void a.push(s+(0<n.length?"#"+n:0<i.length?"."+i.split(" ").join("."):":eq("+r+")")))}),a.reverse().join(" > ")},strtotime:function(e,o){var t,n,i,s,l,c,m,r,a,p;if(!e)return!1;if((n=(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase()).match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/))&&n[2]===n[4])if(1901<n[1])switch(n[2]){case"-":return 12<n[3]||31<n[5]?!1:new Date(n[1],parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case".":return!1;case"/":return 12<n[3]||31<n[5]?!1:new Date(n[1],parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3}else if(1901<n[5])switch(n[2]){case"-":case".":return 12<n[3]||31<n[1]?!1:new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case"/":return 12<n[1]||31<n[3]?!1:new Date(n[5],parseInt(n[1],10)-1,n[3],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3}else switch(n[2]){case"-":return 12<n[3]||31<n[5]||n[1]<70&&38<n[1]?!1:(s=0<=n[1]&&n[1]<=38?+n[1]+2e3:n[1],new Date(s,parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3);case".":return 70<=n[5]?!(12<n[3]||31<n[1])&&new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3:n[5]<60&&!n[6]&&(!(23<n[1]||59<n[3])&&(i=new Date,new Date(i.getFullYear(),i.getMonth(),i.getDate(),n[1]||0,n[3]||0,n[5]||0,n[9]||0)/1e3));case"/":return 12<n[1]||31<n[3]||n[5]<70&&38<n[5]?!1:(s=0<=n[5]&&n[5]<=38?+n[5]+2e3:n[5],new Date(s,parseInt(n[1],10)-1,n[3],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3);case":":return 23<n[1]||59<n[3]||59<n[5]?!1:(i=new Date,new Date(i.getFullYear(),i.getMonth(),i.getDate(),n[1]||0,n[3]||0,n[5]||0)/1e3)}if("now"===e)return null===o||isNaN(o)?(new Date).getTime()/1e3||0:o||0;if(t=Date.parse(e),!isNaN(t))return t/1e3||0;function u(e){var o,t,n,i,s=e.split(" "),r=s[0],a=s[1].substring(0,3),p=/\d+/.test(r),u=("last"===r?-1:1)*("ago"===s[2]?-1:1);if(p&&(u*=parseInt(r,10)),m.hasOwnProperty(a)&&!s[1].match(/^mon(day|\.)?$/i))return l["set"+m[a]](l["get"+m[a]]()+u);if("wee"===a)return l.setDate(l.getDate()+7*u);if("next"===r||"last"===r)o=r,t=u,void 0!==(i=c[a])&&(0===(n=i-l.getDay())?n=7*t:0<n&&"last"===o?n-=7:n<0&&"next"===o&&(n+=7),l.setDate(l.getDate()+n));else if(!p)return;return 1}if(l=o?new Date(1e3*o):new Date,c={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},m={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},a="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)",!(n=e.match(new RegExp("([+-]?\\d+\\s(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)|(last|next)\\s(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?))(\\sago)?","gi"))))return!1;for(p=0,r=n.length;p<r;p+=1)if(!u(n[p]))return!1;return l.getTime()/1e3},serializeObject:function(e){p.extend({},e);var o={},t=p.extend(!0,{include:[],exclude:[],includeByClass:""},e);return this.find(":input").each(function(){var e;!this.name||this.disabled||window.PUM.utilities.inArray(this.name,t.exclude)||t.include.length&&!window.PUM.utilities.inArray(this.name,t.include)||-1===this.className.indexOf(t.includeByClass)||(e=this.name.replace(s,"[$1").split("["))[0]&&(this.checked||window.PUM.utilities.inArray(this.type,n)||window.PUM.utilities.inArray(this.nodeName.toLowerCase(),i))&&("checkbox"===this.type&&e.push(""),function e(o,t,n){var i=t[0];1<t.length?(o[i]||(o[i]=t[1]?{}:[]),e(o[i],t.slice(1),n)):o[i=i||o.length]=n}(o,e,p(this).val()))}),o}},p.fn.popmake.utilies=p.fn.popmake.utilities,window.PUM=window.PUM||{},window.PUM.utilities=window.PUM.utilities||{},window.PUM.utilities=p.extend(window.PUM.utilities,p.fn.popmake.utilities)}(jQuery,document),function(e){!function(e,m){var d={validate:/^[a-z_][a-z0-9_]*(?:\[(?:\d*|[a-z0-9_]+)\])*$/i,key:/[a-z0-9_]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_]+$/i};function t(n,o){var t={},i={};function s(e,o,t){e[o]=t;return e}function r(e,o){var t=e.match(d.key),n;try{o=JSON.parse(o)}catch(e){}while((n=t.pop())!==undefined){if(d.push.test(n)){var i=a(e.replace(/\[\]$/,""));o=s([],i,o)}else if(d.fixed.test(n)){o=s([],n,o)}else if(d.named.test(n)){o=s({},n,o)}}return o}function a(e){if(i[e]===undefined){i[e]=0}return i[e]++}function p(e){switch(m('[name="'+e.name+'"]',o).attr("type")){case"checkbox":return e.value==="1"?true:e.value;default:return e.value}}function e(e){if(!d.validate.test(e.name))return this;var o=r(e.name,p(e));t=n.extend(true,t,o);return this}function u(e){if(!n.isArray(e)){throw new Error("formSerializer.addPairs expects an Array")}for(var o=0,t=e.length;o<t;o++){this.addPair(e[o])}return this}function l(){return t}function c(){return JSON.stringify(l())}this.addPair=e;this.addPairs=u;this.serialize=l;this.serializeJSON=c}if(t.patterns=d,t.serializeObject=function e(){var o;if(this.is("form")){o=this.serializeArray()}else{o=this.find(":input").serializeArray()}return new t(m,this).addPairs(o).serialize()},t.serializeJSON=function e(){var o;if(this.is("form")){o=this.serializeArray()}else{o=this.find(":input").serializeArray()}return new t(m,this).addPairs(o).serializeJSON()},typeof m.fn!=="undefined"){m.fn.pumSerializeObject=t.serializeObject;m.fn.pumSerializeJSON=t.serializeJSON}e.FormSerializer=t}(e,e.jQuery||e.Zepto||e.ender||e.$)}(this),function(e){("object"!=typeof exports||"undefined"==typeof module)&&"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";function e(o){var t=this.constructor;return this.then(function(e){return t.resolve(o()).then(function(){return e})},function(e){return t.resolve(o()).then(function(){return t.reject(e)})})}var o=setTimeout;function p(e){return Boolean(e&&void 0!==e.length)}function n(){}function s(e){if(!(this instanceof s))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function i(t,n){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,s._immediateFn(function(){var e,o=1===t._state?n.onFulfilled:n.onRejected;if(null!==o){try{e=o(t._value)}catch(e){return void a(n.promise,e)}r(n.promise,e)}else(1===t._state?r:a)(n.promise,t._value)})):t._deferreds.push(n)}function r(o,e){try{if(e===o)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if(e instanceof s)return o._state=3,o._value=e,void u(o);if("function"==typeof t)return void c((n=t,i=e,function(){n.apply(i,arguments)}),o)}o._state=1,o._value=e,u(o)}catch(e){a(o,e)}var n,i}function a(e,o){e._state=2,e._value=o,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&s._immediateFn(function(){e._handled||s._unhandledRejectionFn(e._value)});for(var o=0,t=e._deferreds.length;o<t;o++)i(e,e._deferreds[o]);e._deferreds=null}function l(e,o,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof o?o:null,this.promise=t}function c(e,o){var t=!1;try{e(function(e){t||(t=!0,r(o,e))},function(e){t||(t=!0,a(o,e))})}catch(e){if(t)return;t=!0,a(o,e)}}s.prototype.catch=function(e){return this.then(null,e)},s.prototype.then=function(e,o){var t=new this.constructor(n);return i(this,new l(e,o,t)),t},s.prototype.finally=e,s.all=function(o){return new s(function(i,s){if(!p(o))return s(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(o);if(0===r.length)return i([]);var a=r.length;for(var e=0;e<r.length;e++)!function o(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){o(t,e)},s)}r[t]=e,0==--a&&i(r)}catch(e){s(e)}}(e,r[e])})},s.resolve=function(o){return o&&"object"==typeof o&&o.constructor===s?o:new s(function(e){e(o)})},s.reject=function(t){return new s(function(e,o){o(t)})},s.race=function(i){return new s(function(e,o){if(!p(i))return o(new TypeError("Promise.race accepts an array"));for(var t=0,n=i.length;t<n;t++)s.resolve(i[t]).then(e,o)})},s._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){o(e,0)},s._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var t=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();"Promise"in t?t.Promise.prototype.finally||(t.Promise.prototype.finally=e):t.Promise=s});
classes/Analytics.php CHANGED
@@ -151,9 +151,10 @@ class PUM_Analytics {
151
  $namespace = 'pum/v' . $version;
152
 
153
  register_rest_route( $namespace, 'analytics', apply_filters( 'pum_analytics_rest_route_args', array(
154
- 'methods' => 'GET',
155
- 'callback' => array( __CLASS__, 'analytics_endpoint' ),
156
- 'args' => array(
 
157
  'event' => array(
158
  'required' => true,
159
  'description' => __( 'Event Type', 'popup-maker' ),
151
  $namespace = 'pum/v' . $version;
152
 
153
  register_rest_route( $namespace, 'analytics', apply_filters( 'pum_analytics_rest_route_args', array(
154
+ 'methods' => 'GET',
155
+ 'callback' => array( __CLASS__, 'analytics_endpoint' ),
156
+ 'permission_callback' => '__return_true',
157
+ 'args' => array(
158
  'event' => array(
159
  'required' => true,
160
  'description' => __( 'Event Type', 'popup-maker' ),
classes/Shortcode/PopupClose.php CHANGED
@@ -1,162 +1,162 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- /**
8
- * Class PUM_Shortcode_PopupClose
9
- *
10
- * Registers the popup_close shortcode.
11
- */
12
- class PUM_Shortcode_PopupClose extends PUM_Shortcode {
13
-
14
- public $version = 2;
15
-
16
- public $has_content = true;
17
-
18
- /**
19
- * The shortcode tag.
20
- */
21
- public function tag() {
22
- return 'popup_close';
23
- }
24
-
25
- public function label() {
26
- return __( 'Popup Close Button', 'popup-maker' );
27
- }
28
-
29
- public function description() {
30
- return __( 'Make text or html a close trigger for your popup.', 'popup-maker' );
31
- }
32
-
33
- public function inner_content_labels() {
34
- return array(
35
- 'label' => __( 'Content', 'popup-maker' ),
36
- 'description' => __( 'Can contain other shortcodes, images, text or html content.' ),
37
- );
38
- }
39
-
40
- public function post_types() {
41
- return array( 'popup' );
42
- }
43
-
44
- public function fields() {
45
- return array(
46
- 'general' => array(
47
- 'main' => array(
48
- 'tag' => array(
49
- 'label' => __( 'HTML Tag', 'popup-maker' ),
50
- 'desc' => __( 'The HTML tag used for this element.', 'popup-maker' ),
51
- 'type' => 'select',
52
- 'options' => array(
53
- 'a' => 'a',
54
- 'button' => 'button',
55
- 'div' => 'div',
56
- 'img' => 'img',
57
- 'li' => 'li',
58
- 'p' => 'p',
59
- 'span' => 'span',
60
- ),
61
- 'std' => 'span',
62
- 'required' => true,
63
- ),
64
- 'href' => array(
65
- 'label' => __( 'Value for href', 'popup-maker' ),
66
- 'placeholder' => '#',
67
- 'desc' => __( 'Enter the href value for your link. Leave blank if you do not want this link to take the visitor to a different page.', 'popup-maker' ),
68
- 'type' => 'text',
69
- 'std' => '',
70
- 'dependencies' => array(
71
- 'tag' => array( 'a' ),
72
- ),
73
- ),
74
- 'target' => array(
75
- 'label' => __( 'Target for the element', 'popup-maker' ),
76
- 'placeholder' => '',
77
- 'desc' => __( 'Enter the target value for your link. Can be left blank.', 'popup-maker' ),
78
- 'type' => 'text',
79
- 'std' => '',
80
- 'dependencies' => array(
81
- 'tag' => array( 'a' ),
82
- ),
83
- ),
84
- ),
85
- ),
86
- 'options' => array(
87
- 'main' => array(
88
- 'classes' => array(
89
- 'label' => __( 'CSS Class', 'popup-maker' ),
90
- 'placeholder' => 'my-custom-class',
91
- 'type' => 'text',
92
- 'desc' => __( 'Add additional classes for styling.', 'popup-maker' ),
93
- 'std' => '',
94
- ),
95
- 'do_default' => array(
96
- 'type' => 'checkbox',
97
- 'label' => __( 'Do not prevent the default click functionality.', 'popup-maker' ),
98
- 'desc' => __( 'This prevents us from disabling the browsers default action when a close button is clicked. It can be used to allow a link to a file to both close a popup and still download the file.', 'popup-maker' ),
99
- ),
100
- ),
101
- ),
102
- );
103
- }
104
-
105
- /**
106
- * Process shortcode attributes.
107
- *
108
- * Also remaps and cleans old ones.
109
- *
110
- * @param $atts
111
- *
112
- * @return array
113
- */
114
- public function shortcode_atts( $atts ) {
115
- $atts = parent::shortcode_atts( $atts );
116
-
117
- if ( empty( $atts['tag'] ) ) {
118
- $atts['tag'] = 'span';
119
- }
120
-
121
- if ( empty( $atts['href'] ) ) {
122
- $atts['href'] = '#';
123
- }
124
-
125
- if ( ! empty( $atts['class'] ) ) {
126
- $atts['classes'] .= ' ' . $atts['class'];
127
- unset( $atts['class'] );
128
- }
129
-
130
- return $atts;
131
- }
132
-
133
- /**
134
- * Shortcode handler
135
- *
136
- * @param array $atts shortcode attributes
137
- * @param string $content shortcode content
138
- *
139
- * @return string
140
- */
141
- public function handler( $atts, $content = null ) {
142
- $atts = $this->shortcode_atts( $atts );
143
-
144
- $do_default = $atts['do_default'] ? " data-do-default='" . esc_attr( $atts['do_default'] ) . "'" : '';
145
-
146
- // Sets up our href and target, if the tag is an `a`.
147
- $href = 'a' === $atts['tag'] ? "href='{$atts['href']}'" : '';
148
- $target = 'a' === $atts['tag'] && ! empty( $atts['target'] ) ? "target='{$atts['target']}'" : '';
149
-
150
- $return = "<{$atts['tag']} $href $target class='pum-close popmake-close {$atts['classes']}' {$do_default}>";
151
- $return .= PUM_Helpers::do_shortcode( $content );
152
- $return .= "</{$atts['tag']}>";
153
-
154
- return $return;
155
- }
156
-
157
- public function template() { ?>
158
- <{{{attrs.tag}}} class="pum-close popmake-close <# if (typeof attrs.classes !== 'undefined') print(attrs.classes); #>">{{{attrs._inner_content}}}</{{{attrs.tag}}}><?php
159
- }
160
-
161
- }
162
-
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ /**
8
+ * Class PUM_Shortcode_PopupClose
9
+ *
10
+ * Registers the popup_close shortcode.
11
+ */
12
+ class PUM_Shortcode_PopupClose extends PUM_Shortcode {
13
+
14
+ public $version = 2;
15
+
16
+ public $has_content = true;
17
+
18
+ /**
19
+ * The shortcode tag.
20
+ */
21
+ public function tag() {
22
+ return 'popup_close';
23
+ }
24
+
25
+ public function label() {
26
+ return __( 'Popup Close Button', 'popup-maker' );
27
+ }
28
+
29
+ public function description() {
30
+ return __( 'Make text or html a close trigger for your popup.', 'popup-maker' );
31
+ }
32
+
33
+ public function inner_content_labels() {
34
+ return array(
35
+ 'label' => __( 'Content', 'popup-maker' ),
36
+ 'description' => __( 'Can contain other shortcodes, images, text or html content.' ),
37
+ );
38
+ }
39
+
40
+ public function post_types() {
41
+ return array( 'popup' );
42
+ }
43
+
44
+ public function fields() {
45
+ return array(
46
+ 'general' => array(
47
+ 'main' => array(
48
+ 'tag' => array(
49
+ 'label' => __( 'HTML Tag', 'popup-maker' ),
50
+ 'desc' => __( 'The HTML tag used for this element.', 'popup-maker' ),
51
+ 'type' => 'select',
52
+ 'options' => array(
53
+ 'a' => 'a',
54
+ 'button' => 'button',
55
+ 'div' => 'div',
56
+ 'img' => 'img',
57
+ 'li' => 'li',
58
+ 'p' => 'p',
59
+ 'span' => 'span',
60
+ ),
61
+ 'std' => 'span',
62
+ 'required' => true,
63
+ ),
64
+ 'href' => array(
65
+ 'label' => __( 'Value for href', 'popup-maker' ),
66
+ 'placeholder' => '#',
67
+ 'desc' => __( 'Enter the href value for your link. Leave blank if you do not want this link to take the visitor to a different page.', 'popup-maker' ),
68
+ 'type' => 'text',
69
+ 'std' => '',
70
+ 'dependencies' => array(
71
+ 'tag' => array( 'a' ),
72
+ ),
73
+ ),
74
+ 'target' => array(
75
+ 'label' => __( 'Target for the element', 'popup-maker' ),
76
+ 'placeholder' => '',
77
+ 'desc' => __( 'Enter the target value for your link. Can be left blank.', 'popup-maker' ),
78
+ 'type' => 'text',
79
+ 'std' => '',
80
+ 'dependencies' => array(
81
+ 'tag' => array( 'a' ),
82
+ ),
83
+ ),
84
+ ),
85
+ ),
86
+ 'options' => array(
87
+ 'main' => array(
88
+ 'classes' => array(
89
+ 'label' => __( 'CSS Class', 'popup-maker' ),
90
+ 'placeholder' => 'my-custom-class',
91
+ 'type' => 'text',
92
+ 'desc' => __( 'Add additional classes for styling.', 'popup-maker' ),
93
+ 'std' => '',
94
+ ),
95
+ 'do_default' => array(
96
+ 'type' => 'checkbox',
97
+ 'label' => __( 'Do not prevent the default click functionality.', 'popup-maker' ),
98
+ 'desc' => __( 'This prevents us from disabling the browsers default action when a close button is clicked. It can be used to allow a link to a file to both close a popup and still download the file.', 'popup-maker' ),
99
+ ),
100
+ ),
101
+ ),
102
+ );
103
+ }
104
+
105
+ /**
106
+ * Process shortcode attributes.
107
+ *
108
+ * Also remaps and cleans old ones.
109
+ *
110
+ * @param $atts
111
+ *
112
+ * @return array
113
+ */
114
+ public function shortcode_atts( $atts ) {
115
+ $atts = parent::shortcode_atts( $atts );
116
+
117
+ if ( empty( $atts['tag'] ) ) {
118
+ $atts['tag'] = 'span';
119
+ }
120
+
121
+ if ( empty( $atts['href'] ) ) {
122
+ $atts['href'] = '#';
123
+ }
124
+
125
+ if ( ! empty( $atts['class'] ) ) {
126
+ $atts['classes'] .= ' ' . $atts['class'];
127
+ unset( $atts['class'] );
128
+ }
129
+
130
+ return $atts;
131
+ }
132
+
133
+ /**
134
+ * Shortcode handler
135
+ *
136
+ * @param array $atts shortcode attributes
137
+ * @param string $content shortcode content
138
+ *
139
+ * @return string
140
+ */
141
+ public function handler( $atts, $content = null ) {
142
+ $atts = $this->shortcode_atts( $atts );
143
+
144
+ $do_default = $atts['do_default'] ? " data-do-default='" . esc_attr( $atts['do_default'] ) . "'" : '';
145
+
146
+ // Sets up our href and target, if the tag is an `a`.
147
+ $href = 'a' === $atts['tag'] ? "href='{$atts['href']}'" : '';
148
+ $target = 'a' === $atts['tag'] && ! empty( $atts['target'] ) ? "target='{$atts['target']}'" : '';
149
+
150
+ $return = "<{$atts['tag']} $href $target class='pum-close popmake-close {$atts['classes']}' {$do_default}>";
151
+ $return .= PUM_Helpers::do_shortcode( $content );
152
+ $return .= "</{$atts['tag']}>";
153
+
154
+ return $return;
155
+ }
156
+
157
+ public function template() { ?>
158
+ <{{{attrs.tag}}} class="pum-close popmake-close <# if (typeof attrs.classes !== 'undefined') print(attrs.classes); #>">{{{attrs._inner_content}}}</{{{attrs.tag}}}><?php
159
+ }
160
+
161
+ }
162
+
classes/Site.php CHANGED
@@ -50,14 +50,18 @@ class PUM_Site {
50
  * @sinceWP 5.4
51
  */
52
  if ( version_compare( $wp_version, '5.0.0', '>=' ) ) {
53
- add_filter( 'pum_popup_content', [ __CLASS__, 'do_blocks' ], 9 );
54
  }
55
  add_filter( 'pum_popup_content', 'wptexturize' );
56
  add_filter( 'pum_popup_content', 'convert_smilies', 20 );
57
  add_filter( 'pum_popup_content', 'wpautop' );
58
  add_filter( 'pum_popup_content', 'shortcode_unautop' );
59
  add_filter( 'pum_popup_content', 'prepend_attachment' );
60
- add_filter( 'pum_popup_content', 'wp_make_content_images_responsive' );
 
 
 
 
61
 
62
  /**
63
  * Copied & from wp-includes/default-filters.php:172:178.
@@ -67,7 +71,7 @@ class PUM_Site {
67
  * @since 1.10.0
68
  * @sinceWP 5.4
69
  */
70
- $do_shortcode_handler = pum_get_option( 'disable_shortcode_compatibility_mode' ) ? 'do_shortcode' : ['PUM_Helpers', 'do_shortcode' ];
71
  add_filter( 'pum_popup_content', $do_shortcode_handler, 11 );
72
  }
73
 
@@ -92,7 +96,7 @@ class PUM_Site {
92
  $priority = has_filter( 'pum_popup_content', 'wpautop' );
93
  if ( false !== $priority && doing_filter( 'pum_popup_content' ) && has_blocks( $content ) ) {
94
  remove_filter( 'pum_popup_content', 'wpautop', $priority );
95
- add_filter( 'pum_popup_content', [ __CLASS__, '_restore_wpautop_hook' ], $priority + 1 );
96
  }
97
 
98
  return $output;
@@ -143,4 +147,4 @@ class PUM_Site {
143
 
144
  do_action( 'pum_' . $action, $_REQUEST );
145
  }
146
- }
50
  * @sinceWP 5.4
51
  */
52
  if ( version_compare( $wp_version, '5.0.0', '>=' ) ) {
53
+ add_filter( 'pum_popup_content', array( __CLASS__, 'do_blocks' ), 9 );
54
  }
55
  add_filter( 'pum_popup_content', 'wptexturize' );
56
  add_filter( 'pum_popup_content', 'convert_smilies', 20 );
57
  add_filter( 'pum_popup_content', 'wpautop' );
58
  add_filter( 'pum_popup_content', 'shortcode_unautop' );
59
  add_filter( 'pum_popup_content', 'prepend_attachment' );
60
+ if ( version_compare( $wp_version, '5.5', '>=' ) ) {
61
+ add_filter( 'pum_popup_content', 'wp_filter_content_tags' );
62
+ } else {
63
+ add_filter( 'pum_popup_content', 'wp_make_content_images_responsive' );
64
+ }
65
 
66
  /**
67
  * Copied & from wp-includes/default-filters.php:172:178.
71
  * @since 1.10.0
72
  * @sinceWP 5.4
73
  */
74
+ $do_shortcode_handler = pum_get_option( 'disable_shortcode_compatibility_mode' ) ? 'do_shortcode' : array( 'PUM_Helpers', 'do_shortcode' );
75
  add_filter( 'pum_popup_content', $do_shortcode_handler, 11 );
76
  }
77
 
96
  $priority = has_filter( 'pum_popup_content', 'wpautop' );
97
  if ( false !== $priority && doing_filter( 'pum_popup_content' ) && has_blocks( $content ) ) {
98
  remove_filter( 'pum_popup_content', 'wpautop', $priority );
99
+ add_filter( 'pum_popup_content', array( __CLASS__, '_restore_wpautop_hook' ), $priority + 1 );
100
  }
101
 
102
  return $output;
147
 
148
  do_action( 'pum_' . $action, $_REQUEST );
149
  }
150
+ }
classes/Utils/Alerts.php CHANGED
@@ -1,567 +1,567 @@
1
- <?php
2
- /*******************************************************************************
3
- * Copyright (c) 2019, Code Atlantic LLC
4
- ******************************************************************************/
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
- }
9
-
10
- /**
11
- * Class PUM_Utils_Alerts
12
- */
13
- class PUM_Utils_Alerts {
14
-
15
- /**
16
- *
17
- */
18
- public static function init() {
19
- add_action( 'admin_init', array( __CLASS__, 'hooks' ) );
20
- add_action( 'admin_init', array( __CLASS__, 'php_handler' ) );
21
- add_action( 'wp_ajax_pum_alerts_action', array( __CLASS__, 'ajax_handler' ) );
22
- add_filter( 'pum_alert_list', array( __CLASS__, 'whats_new_alerts' ), 0 );
23
- add_filter( 'pum_alert_list', array( __CLASS__, 'integration_alerts' ), 5 );
24
- add_filter( 'pum_alert_list', array( __CLASS__, 'translation_request' ), 10 );
25
- add_action( 'admin_menu', array( __CLASS__, 'append_alert_count' ), 999 );
26
- }
27
-
28
- /**
29
- * Gets a count of current alerts.
30
- *
31
- * @return int
32
- */
33
- public static function alert_count() {
34
- return count( self::get_alerts() );
35
- }
36
-
37
- /**
38
- * Append alert count to Popup Maker menu item.
39
- */
40
- public static function append_alert_count() {
41
- global $menu;
42
- $count = self::alert_count();
43
- foreach ( $menu as $key => $item ) {
44
- if ( $item[2] == 'edit.php?post_type=popup' ) {
45
- $menu[ $key ][0] .= $count ? ' <span class="update-plugins count-' . $count . '"><span class="plugin-count pum-alert-count" aria-hidden="true">' . $count . '</span></span>' : '';
46
- }
47
- }
48
- }
49
-
50
- /**
51
- * @param array $alerts
52
- *
53
- * @return array
54
- */
55
- public static function translation_request( $alerts = array() ) {
56
-
57
- $version = explode( '.', Popup_Maker::$VER );
58
- // Get only the major.minor version exclude the point releases.
59
- $version = $version[0] . '.' . $version[1];
60
-
61
- $code = 'translation_request_' . $version;
62
-
63
- // Bail Early if they have already dismissed.
64
- if ( self::has_dismissed_alert( $code ) ) {
65
- return $alerts;
66
- }
67
-
68
- // Get locales based on the HTTP accept language header.
69
- $locales_from_header = PUM_Utils_I10n::get_http_locales();
70
-
71
- // Abort early if no locales in header.
72
- if ( empty( $locales_from_header ) ) {
73
- return $alerts;
74
- }
75
-
76
- // Get acceptable non EN WordPress locales based on the HTTP accept language header.
77
- // Used when the current locale is EN only I believe.
78
- $non_en_locales_from_header = PUM_Utils_I10n::get_non_en_accepted_wp_locales_from_header();
79
-
80
- // If no additional languages are supported abort
81
- if ( empty( $non_en_locales_from_header ) ) {
82
- return $alerts;
83
- }
84
-
85
- /**
86
- * Assume all at this point are possible polyglots.
87
- *
88
- * Viewing in English!
89
- * -- Translation available in one additional language!
90
- * ---- Show notice that there other language is available and we need help translating.
91
- * -- Translation available in more than one language!
92
- * ---- Show notice that their other languages are available and need help translating.
93
- * -- Translation not available!
94
- * ---- Show notice that plugin is not translated and we need help.
95
- * Else If translation for their language(s) exists, but isn't up to date!
96
- * -- Show notice that their language is available, but out of date and need help translating.
97
- * Else If translations for their language doesn't exist!
98
- * -- Show notice that plugin is not translated and we need help.
99
- */
100
- $current_locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
101
-
102
- // Get the active language packs of the plugin.
103
- $translation_status = PUM_Utils_I10n::translation_status();
104
- // Retrieve all the WordPress locales in which the plugin is translated.
105
- $locales_with_translations = wp_list_pluck( $translation_status, 'language' );
106
- $locale_translation_versions = wp_list_pluck( $translation_status, 'version' );
107
-
108
- // Suggests existing langpacks
109
- $suggested_locales_with_langpack = array_values( array_intersect( $non_en_locales_from_header, $locales_with_translations ) );
110
- $current_locale_is_suggested = in_array( $current_locale, $suggested_locales_with_langpack );
111
- $current_locale_is_translated = in_array( $current_locale, $locales_with_translations );
112
-
113
- // Last chance to abort early before querying all available languages.
114
- // We abort here if the user is already using a translated language that is up to date!
115
- if ( $current_locale_is_suggested && $current_locale_is_translated && version_compare( $locale_translation_versions[ $current_locale ], Popup_Maker::$VER, '>=' ) ) {
116
- return $alerts;
117
- }
118
-
119
- // Retrieve all the WordPress locales.
120
- $locales_supported_by_wordpress = PUM_Utils_I10n::available_locales();
121
-
122
- // Get the native language names of the locales.
123
- $suggest_translated_locale_names = array();
124
- foreach ( $suggested_locales_with_langpack as $locale ) {
125
- $suggest_translated_locale_names[ $locale ] = $locales_supported_by_wordpress[ $locale ]['native_name'];
126
- }
127
-
128
- $suggest_string = '';
129
-
130
- // If we get this far, they clearly have multiple language available
131
- // If current locale is english but they have others available, they are likely polyglots.
132
- $currently_in_english = strpos( $current_locale, 'en' ) === 0;
133
-
134
- // Currently in English.
135
- if ( $currently_in_english ) {
136
-
137
- // Only one locale suggestion.
138
- if ( 1 === count( $suggest_translated_locale_names ) ) {
139
- $language = current( $suggest_translated_locale_names );
140
-
141
- $suggest_string = sprintf( /* translators: %s: native language name. */
142
- __( 'This plugin is also available in %1$s. <a href="%2$s" target="_blank">Help improve the translation!</a>', 'popup-maker' ), $language, esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' ) );
143
-
144
- // Multiple locale suggestions.
145
- } elseif ( ! empty( $suggest_translated_locale_names ) ) {
146
- $primary_language = current( $suggest_translated_locale_names );
147
- array_shift( $suggest_translated_locale_names );
148
-
149
- $other_suggest = '';
150
- foreach ( $suggest_translated_locale_names as $language ) {
151
- $other_suggest .= $language . ', ';
152
- }
153
-
154
- $suggest_string = sprintf( /* translators: 1: native language name, 2: other native language names, comma separated */
155
- __( 'This plugin is also available in %1$s (also: %2$s). <a href="%3$s" target="_blank">Help improve the translation!</a>', 'popup-maker' ), $primary_language, trim( $other_suggest, ' ,' ), esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' ) );
156
-
157
- // Non-English locale in header, no translations.
158
- } elseif ( ! empty( $non_en_locales_from_header ) ) {
159
-
160
- if ( 1 === count( $non_en_locales_from_header ) ) {
161
- $locale = reset( $non_en_locales_from_header );
162
-
163
- $suggest_string = sprintf( /* translators: 1: native language name, 2: URL to translate.wordpress.org */
164
- __( 'This plugin is not translated into %1$s yet. <a href="%2$s" target="_blank">Help translate it!</a>', 'popup-maker' ), $locales_supported_by_wordpress[ $locale ]['native_name'], esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' ) );
165
- } else {
166
- $primary_locale = reset( $non_en_locales_from_header );
167
- $primary_language = $locales_supported_by_wordpress[ $primary_locale ]['native_name'];
168
- array_shift( $non_en_locales_from_header );
169
-
170
- $other_suggest = '';
171
- foreach ( $non_en_locales_from_header as $locale ) {
172
- $other_suggest .= $locales_supported_by_wordpress[ $locale ]['native_name'] . ', ';
173
- }
174
-
175
- $suggest_string = sprintf( /* translators: 1: native language name, 2: other native language names, comma separated */
176
- __( 'This plugin is also available in %1$s (also: %2$s). <a href="%3$s" target="_blank">Help improve the translation!</a>', 'popup-maker' ), $primary_language, trim( $other_suggest, ' ,' ), esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' ) );
177
- }
178
- }
179
-
180
- // The plugin has no translation for the current locale.
181
- } elseif ( ! $current_locale_is_suggested && ! $current_locale_is_translated ) {
182
- $suggest_string = sprintf( __( 'This plugin is not translated into %1$s yet. <a href="%2$s" target="_blank">Help translate it!</a>', 'popup-maker' ), $locales_supported_by_wordpress[ $current_locale ]['native_name'], esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' ) );
183
- // The plugin has translations for current locale, but they are out of date.
184
- } elseif ( $current_locale_is_suggested && $current_locale_is_translated && version_compare( $locale_translation_versions[ $current_locale ], Popup_Maker::$VER, '<' ) ) {
185
- $suggest_string = sprintf( /* translators: %s: native language name. */
186
- __( 'This plugin\'s translation for %1$s is out of date. <a href="%2$s" target="_blank">Help improve the translation!</a>', 'popup-maker' ), $locales_supported_by_wordpress[ $current_locale ]['native_name'], esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' ) );
187
- }
188
-
189
-
190
- if ( ! empty( $suggest_string ) ) {
191
- $alerts[] = array(
192
- 'code' => $code,
193
- 'message' => $suggest_string,
194
- 'type' => 'info',
195
- );
196
- }
197
-
198
- return $alerts;
199
- }
200
-
201
- /**
202
- * @param array $alerts
203
- *
204
- * @return array
205
- */
206
- public static function whats_new_alerts( $alerts = array() ) {
207
-
208
- $upgraded_from = PUM_Utils_Upgrades::$upgraded_from;
209
-
210
- if ( version_compare( $upgraded_from, '0.0.0', '>' ) ) {
211
-
212
- if ( version_compare( $upgraded_from, '1.8.0', '<' ) ) {
213
- $alerts[] = array(
214
- 'code' => 'whats_new_1_8_0',
215
- 'type' => 'success',
216
- 'message' => sprintf( '<strong>' . __( 'See whats new in v%s - (%sview all changes%s)', 'popup-maker' ) . '</strong>', '1.8.0', '<a href="' . add_query_arg( array(
217
- 'tab' => 'plugin-information',
218
- 'plugin' => 'popup-maker',
219
- 'section' => 'changelog',
220
- 'TB_iframe' => true,
221
- 'width' => 722,
222
- 'height' => 949,
223
- ), admin_url( 'plugin-install.php' ) ) . '" target="_blank">', '</a>' ),
224
- 'html' => "<ul class='ul-disc'>" . "<li>" . 'New UX for the Popup Theme editor.' . "</li>" . "<li>" . 'New close button positions: top center, bottom center, middle left & middle right.' . "</li>" . "<li>" . 'New option to position close button outside of popup.' . "</li>" . "</ul>",
225
- 'priority' => 100,
226
- );
227
- }
228
-
229
- }
230
-
231
- return $alerts;
232
- }
233
-
234
- /**
235
- * @param array $alerts
236
- *
237
- * @return array
238
- */
239
- public static function integration_alerts( $alerts = array() ) {
240
-
241
- $integrations = array(
242
- 'buddypress' => array(
243
- 'label' => __( 'BuddyPress', 'buddypress' ),
244
- 'learn_more_url' => 'https://wppopupmaker.com/works-with/buddypress/',
245
- 'conditions' => ! class_exists( 'PUM_BuddyPress' ) && ( function_exists( 'buddypress' ) || class_exists( 'BuddyPress' ) ),
246
- 'slug' => 'popup-maker-buddypress-integration',
247
- 'name' => 'Popup Maker - BuddyPress Integration',
248
- 'free' => true,
249
- ),
250
- );
251
-
252
- foreach ( $integrations as $key => $integration ) {
253
-
254
- if ( $integration['conditions'] ) {
255
-
256
- $path = "{$integration['slug']}/{$integration['slug']}.php";
257
- $plugin_data = file_exists( WP_PLUGIN_DIR . '/' . $path ) ? get_plugin_data( WP_PLUGIN_DIR . '/' . $path, false, false ) : false;
258
-
259
- $installed = $plugin_data && ! empty( $plugin_data['Name'] ) && $plugin_data['Name'] === $integration['name'];
260
-
261
- $text = $installed ? __( 'activate it now', 'popup-maker' ) : __( 'install it now', 'popup-maker' );
262
- $url = $installed ? esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $path ), 'activate-plugin_' . $path ) ) : esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=popup-maker-buddypress-integration' ), 'install-plugin_popup-maker-buddypress-integration' ) );
263
-
264
- $alerts[] = array(
265
- 'code' => $key . '_integration_available',
266
- 'message' => sprintf( __( '%sDid you know:%s Popup Maker has custom integrations with %s, %slearn more%s or %s%s%s!', 'popup-maker' ), '<strong>', '</strong>', $integration['label'], '<a href="' . $integration['learn_more_url'] . '" target="_blank">', '</a>', '<a href="' . $url . '">', $text, '</a>' ),
267
- 'dismissible' => true,
268
- 'global' => false,
269
- 'type' => $installed ? 'warning' : 'info',
270
- );
271
-
272
- }
273
-
274
- }
275
-
276
- return $alerts;
277
- }
278
-
279
- /**
280
- * Hook into relevant WP actions.
281
- */
282
- public static function hooks() {
283
- if ( is_admin() && current_user_can( 'edit_posts' ) ) {
284
- add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) );
285
- add_action( 'network_admin_notices', array( __CLASS__, 'admin_notices' ) );
286
- add_action( 'user_admin_notices', array( __CLASS__, 'admin_notices' ) );
287
- }
288
- }
289
-
290
- /**
291
- * @return bool
292
- */
293
- public static function should_show_alerts() {
294
- return in_array( true, array(
295
- pum_is_admin_page(),
296
- count( self::get_global_alerts() ) > 0,
297
- ) );
298
- }
299
-
300
- /**
301
- * Render admin alerts if available.
302
- */
303
- public static function admin_notices() {
304
- if ( ! self::should_show_alerts() ) {
305
- return;
306
- }
307
-
308
- $global_only = ! pum_is_admin_page();
309
-
310
- $alerts = $global_only ? self::get_global_alerts() : self::get_alerts();
311
-
312
- $count = count( $alerts );
313
-
314
- if ( ! $count ) {
315
- return;
316
- }
317
-
318
- wp_enqueue_script( 'pum-admin-general' );
319
- wp_enqueue_style( 'pum-admin-general' );
320
-
321
- $nonce = wp_create_nonce( 'pum_alerts_action' );
322
- ?>
323
-
324
- <script type="text/javascript">
325
- window.pum_alerts_nonce = '<?php echo $nonce ?>';
326
- </script>
327
-
328
- <div class="pum-alerts">
329
-
330
- <h3>
331
- <img alt="" class="logo" width="30" src="<?php echo Popup_Maker::$URL; ?>assets/images/logo.png" /> <?php printf( '%s%s (%s)', ( $global_only ? __( 'Popup Maker', 'popup-maker' ) . ' ' : '' ), __( 'Notifications', 'popup-maker' ), '<span class="pum-alert-count">' . $count . '</span>' ); ?>
332
- </h3>
333
-
334
- <p><?php __( 'Check out the following notifications from Popup Maker.', 'popup-maker' ); ?></p>
335
-
336
- <?php foreach ( $alerts as $alert ) {
337
- $expires = 1 == $alert['dismissible'] ? '' : $alert['dismissible'];
338
- $dismiss_url = add_query_arg( array(
339
- 'nonce' => $nonce,
340
- 'code' => $alert['code'],
341
- 'pum_dismiss_alert' => 'dismiss',
342
- 'expires' => $expires,
343
- ));
344
- ?>
345
-
346
- <div class="pum-alert-holder" data-code="<?php echo $alert['code']; ?>" class="<?php echo $alert['dismissible'] ? 'is-dismissible' : ''; ?>" data-dismissible="<?php echo esc_attr( $alert['dismissible'] ); ?>">
347
-
348
- <div class="pum-alert <?php echo $alert['type'] != '' ? 'pum-alert__' . $alert['type'] : ''; ?>">
349
-
350
- <?php if ( ! empty( $alert['message'] ) ) : ?>
351
- <p><?php echo $alert['message']; ?></p>
352
- <?php endif; ?>
353
-
354
- <?php if ( ! empty( $alert['html'] ) ) : ?>
355
- <?php echo function_exists( 'wp_encode_emoji' ) ? wp_encode_emoji( $alert['html'] ) : $alert['html']; ?>
356
- <?php endif; ?>
357
-
358
- <?php if ( ! empty( $alert['actions'] ) && is_array( $alert['actions'] ) ) : ?>
359
- <ul>
360
- <?php foreach ( $alert['actions'] as $action ) {
361
- $link_text = ! empty( $action['primary'] ) && true === $action['primary'] ? '<strong>' . esc_html($action['text']) . '</strong>' : esc_html($action['text']);
362
- if ( 'link' === $action['type'] ) {
363
- $url = $action['href'];
364
- $attributes = 'target="_blank" rel="noreferrer noopener"';
365
- } else {
366
- $url = add_query_arg( array(
367
- 'nonce' => $nonce,
368
- 'code' => $alert['code'],
369
- 'pum_dismiss_alert' => $action['action'],
370
- 'expires' => $expires,
371
- ));
372
- $attributes = 'class="pum-dismiss"';
373
- }
374
- ?>
375
- <li><a data-action="<?php echo esc_attr($action['action']); ?>" href="<?php echo esc_url($url); ?>" <?php echo $attributes; ?> ><?php echo $link_text; ?></a></li>
376
- <?php } ?>
377
- </ul>
378
- <?php endif; ?>
379
-
380
- </div>
381
-
382
- <?php if ( $alert['dismissible'] ) : ?>
383
-
384
- <a href="<?php echo esc_url( $dismiss_url ); ?>" data-action="dismiss" class="button dismiss pum-dismiss">
385
- <span class="screen-reader-text"><?php _e( 'Dismiss this item.', 'popup-maker' ); ?></span> <span class="dashicons dashicons-no-alt"></span>
386
- </a>
387
-
388
- <?php endif; ?>
389
-
390
- </div>
391
-
392
- <?php } ?>
393
-
394
- </div>
395
-
396
- <?php
397
- }
398
-
399
- /**
400
- * @return array
401
- */
402
- public static function get_global_alerts() {
403
- $alerts = self::get_alerts();
404
-
405
- $global_alerts = array();
406
-
407
- foreach ( $alerts as $alert ) {
408
- if ( $alert['global'] ) {
409
- $global_alerts[] = $alert;
410
- }
411
- }
412
-
413
- return $global_alerts;
414
- }
415
-
416
- /**
417
- * @return array
418
- */
419
- public static function get_alerts() {
420
-
421
- static $alert_list;
422
-
423
- if ( ! isset( $alert_list ) ) {
424
- $alert_list = apply_filters( 'pum_alert_list', array() );
425
- }
426
-
427
- $alerts = array();
428
-
429
- foreach ( $alert_list as $alert ) {
430
-
431
- // Ignore dismissed alerts.
432
- if ( self::has_dismissed_alert( $alert['code'] ) ) {
433
- continue;
434
- }
435
-
436
- $alerts[] = wp_parse_args( $alert, array(
437
- 'code' => 'default',
438
- 'priority' => 10,
439
- 'message' => '',
440
- 'type' => 'info',
441
- 'html' => '',
442
- 'dismissible' => true,
443
- 'global' => false,
444
- ) );
445
-
446
- }
447
-
448
- // Sort alerts by priority, highest to lowest.
449
- $alerts = PUM_Utils_Array::sort( $alerts, 'priority', true );
450
-
451
- return $alerts;
452
- }
453
-
454
-
455
- /**
456
- * Handles if alert was dismissed AJAX
457
- */
458
- public static function ajax_handler() {
459
- $args = wp_parse_args( $_REQUEST, array(
460
- 'code' => '',
461
- 'expires' => '',
462
- 'pum_dismiss_alert' => '',
463
- ));
464
-
465
- if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'pum_alerts_action' ) ) {
466
- wp_send_json_error();
467
- }
468
-
469
- $results = self::action_handler( $args['code'], $args['pum_dismiss_alert'], $args['expires'] );
470
- if ( true === $results ) {
471
- wp_send_json_success();
472
- } else {
473
- wp_send_json_error();
474
- }
475
- }
476
-
477
- /**
478
- * Handles if alert was dismissed by page reload instead of AJAX
479
- *
480
- * @since 1.11.0
481
- */
482
- public static function php_handler() {
483
- if ( ! isset( $_REQUEST['pum_dismiss_alert'] ) ) {
484
- return;
485
- }
486
-
487
- if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'pum_alerts_action' ) ) {
488
- return;
489
- }
490
-
491
- $args = wp_parse_args( $_REQUEST, array(
492
- 'code' => '',
493
- 'expires' => '',
494
- 'pum_dismiss_alert' => '',
495
- ));
496
-
497
- self::action_handler( $args['code'], $args['pum_dismiss_alert'], $args['expires'] );
498
- }
499
-
500
- /**
501
- * Handles the action taken on the alert.
502
- *
503
- * @param string $code The specific alert.
504
- * @param string $action Which action was taken
505
- * @param string $expires When the dismissal expires, if any.
506
- *
507
- * @return bool
508
- * @uses PUM_Utils_Logging::instance
509
- * @uses PUM_Utils_Logging::log
510
- * @since 1.11.0
511
- */
512
- public static function action_handler( $code, $action, $expires ) {
513
- if ( empty( $action ) || 'dismiss' === $action ) {
514
- try {
515
- $dismissed_alerts = self::dismissed_alerts();
516
- $dismissed_alerts[ $code ] = ! empty( $expires ) ? strtotime( '+' . $expires ) : true;
517
-
518
- $user_id = get_current_user_id();
519
- update_user_meta( $user_id, '_pum_dismissed_alerts', $dismissed_alerts );
520
- return true;
521
-
522
- } catch ( Exception $e ) {
523
- PUM_Utils_Logging::instance()->log( 'Error dismissing alert. Exception: ' . $e->getMessage() );
524
- return false;
525
- }
526
- }
527
-
528
- do_action( 'pum_alert_dismissed', $code, $action );
529
- }
530
-
531
- /**
532
- * @param string $code
533
- *
534
- * @return bool
535
- */
536
- public static function has_dismissed_alert( $code = '' ) {
537
- $dimissed_alerts = self::dismissed_alerts();
538
-
539
- $alert_dismissed = array_key_exists( $code, $dimissed_alerts );
540
-
541
- // If the alert was dismissed and has a non true type value, it is an expiry time.
542
- if ( $alert_dismissed && true !== $dimissed_alerts[ $code ] ) {
543
- return strtotime( 'now' ) < $dimissed_alerts[ $code ];
544
- }
545
-
546
- return $alert_dismissed;
547
- }
548
-
549
- /**
550
- * Returns an array of dismissed alert groups.
551
- *
552
- * @return array
553
- */
554
- public static function dismissed_alerts() {
555
- $user_id = get_current_user_id();
556
-
557
- $dismissed_alerts = get_user_meta( $user_id, '_pum_dismissed_alerts', true );
558
-
559
- if ( ! is_array( $dismissed_alerts ) ) {
560
- $dismissed_alerts = array();
561
- update_user_meta( $user_id, '_pum_dismissed_alerts', $dismissed_alerts );
562
- }
563
-
564
- return $dismissed_alerts;
565
- }
566
-
567
- }
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright (c) 2019, Code Atlantic LLC
4
+ ******************************************************************************/
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ }
9
+
10
+ /**
11
+ * Class PUM_Utils_Alerts
12
+ */
13
+ class PUM_Utils_Alerts {
14
+
15
+ /**
16
+ *
17
+ */
18
+ public static function init() {
19
+ add_action( 'admin_init', array( __CLASS__, 'hooks' ) );
20
+ add_action( 'admin_init', array( __CLASS__, 'php_handler' ) );
21
+ add_action( 'wp_ajax_pum_alerts_action', array( __CLASS__, 'ajax_handler' ) );
22
+ add_filter( 'pum_alert_list', array( __CLASS__, 'whats_new_alerts' ), 0 );
23
+ add_filter( 'pum_alert_list', array( __CLASS__, 'integration_alerts' ), 5 );
24
+ add_filter( 'pum_alert_list', array( __CLASS__, 'translation_request' ), 10 );
25
+ add_action( 'admin_menu', array( __CLASS__, 'append_alert_count' ), 999 );
26
+ }
27
+
28
+ /**
29
+ * Gets a count of current alerts.
30
+ *
31
+ * @return int
32
+ */
33
+ public static function alert_count() {
34
+ return count( self::get_alerts() );
35
+ }
36
+
37
+ /**
38
+ * Append alert count to Popup Maker menu item.
39
+ */
40
+ public static function append_alert_count() {
41
+ global $menu;
42
+ $count = self::alert_count();
43
+ foreach ( $menu as $key => $item ) {
44
+ if ( $item[2] == 'edit.php?post_type=popup' ) {
45
+ $menu[ $key ][0] .= $count ? ' <span class="update-plugins count-' . $count . '"><span class="plugin-count pum-alert-count" aria-hidden="true">' . $count . '</span></span>' : '';
46
+ }
47
+ }
48
+ }
49
+
50
+ /**
51
+ * @param array $alerts
52
+ *
53
+ * @return array
54
+ */
55
+ public static function translation_request( $alerts = array() ) {
56
+
57
+ $version = explode( '.', Popup_Maker::$VER );
58
+ // Get only the major.minor version exclude the point releases.
59
+ $version = $version[0] . '.' . $version[1];
60
+
61
+ $code = 'translation_request_' . $version;
62
+
63
+ // Bail Early if they have already dismissed.
64
+ if ( self::has_dismissed_alert( $code ) ) {
65
+ return $alerts;
66
+ }
67
+
68
+ // Get locales based on the HTTP accept language header.
69
+ $locales_from_header = PUM_Utils_I10n::get_http_locales();
70
+
71
+ // Abort early if no locales in header.
72
+ if ( empty( $locales_from_header ) ) {
73
+ return $alerts;
74
+ }
75
+
76
+ // Get acceptable non EN WordPress locales based on the HTTP accept language header.
77
+ // Used when the current locale is EN only I believe.
78
+ $non_en_locales_from_header = PUM_Utils_I10n::get_non_en_accepted_wp_locales_from_header();
79
+
80
+ // If no additional languages are supported abort
81
+ if ( empty( $non_en_locales_from_header ) ) {
82
+ return $alerts;
83
+ }
84
+
85
+ /**
86
+ * Assume all at this point are possible polyglots.
87
+ *
88
+ * Viewing in English!
89
+ * -- Translation available in one additional language!
90
+ * ---- Show notice that there other language is available and we need help translating.
91
+ * -- Translation available in more than one language!
92
+ * ---- Show notice that their other languages are available and need help translating.
93
+ * -- Translation not available!
94
+ * ---- Show notice that plugin is not translated and we need help.
95
+ * Else If translation for their language(s) exists, but isn't up to date!
96
+ * -- Show notice that their language is available, but out of date and need help translating.
97
+ * Else If translations for their language doesn't exist!
98
+ * -- Show notice that plugin is not translated and we need help.
99
+ */
100
+ $current_locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
101
+
102
+ // Get the active language packs of the plugin.
103
+ $translation_status = PUM_Utils_I10n::translation_status();
104
+ // Retrieve all the WordPress locales in which the plugin is translated.
105
+ $locales_with_translations = wp_list_pluck( $translation_status, 'language' );
106
+ $locale_translation_versions = wp_list_pluck( $translation_status, 'version' );
107
+
108
+ // Suggests existing langpacks
109
+ $suggested_locales_with_langpack = array_values( array_intersect( $non_en_locales_from_header, $locales_with_translations ) );
110
+ $current_locale_is_suggested = in_array( $current_locale, $suggested_locales_with_langpack );
111
+ $current_locale_is_translated = in_array( $current_locale, $locales_with_translations );
112
+
113
+ // Last chance to abort early before querying all available languages.
114
+ // We abort here if the user is already using a translated language that is up to date!
115
+ if ( $current_locale_is_suggested && $current_locale_is_translated && version_compare( $locale_translation_versions[ $current_locale ], Popup_Maker::$VER, '>=' ) ) {
116
+ return $alerts;
117
+ }
118
+
119
+ // Retrieve all the WordPress locales.
120
+ $locales_supported_by_wordpress = PUM_Utils_I10n::available_locales();
121
+
122
+ // Get the native language names of the locales.
123
+ $suggest_translated_locale_names = array();
124
+ foreach ( $suggested_locales_with_langpack as $locale ) {
125
+ $suggest_translated_locale_names[ $locale ] = $locales_supported_by_wordpress[ $locale ]['native_name'];
126
+ }
127
+
128
+ $suggest_string = '';
129
+
130
+ // If we get this far, they clearly have multiple language available
131
+ // If current locale is english but they have others available, they are likely polyglots.
132
+ $currently_in_english = strpos( $current_locale, 'en' ) === 0;
133
+
134
+ // Currently in English.
135
+ if ( $currently_in_english ) {
136
+
137
+ // Only one locale suggestion.
138
+ if ( 1 === count( $suggest_translated_locale_names ) ) {
139
+ $language = current( $suggest_translated_locale_names );
140
+
141
+ $suggest_string = sprintf( /* translators: %s: native language name. */
142
+ __( 'This plugin is also available in %1$s. <a href="%2$s" target="_blank">Help improve the translation!</a>', 'popup-maker' ), $language, esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' ) );
143
+
144
+ // Multiple locale suggestions.
145
+ } elseif ( ! empty( $suggest_translated_locale_names ) ) {
146
+ $primary_language = current( $suggest_translated_locale_names );
147
+ array_shift( $suggest_translated_locale_names );
148
+
149
+ $other_suggest = '';
150
+ foreach ( $suggest_translated_locale_names as $language ) {
151
+ $other_suggest .= $language . ', ';
152
+ }
153
+
154
+ $suggest_string = sprintf( /* translators: 1: native language name, 2: other native language names, comma separated */
155
+ __( 'This plugin is also available in %1$s (also: %2$s). <a href="%3$s" target="_blank">Help improve the translation!</a>', 'popup-maker' ), $primary_language, trim( $other_suggest, ' ,' ), esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' ) );
156
+
157
+ // Non-English locale in header, no translations.
158
+ } elseif ( ! empty( $non_en_locales_from_header ) ) {
159
+
160
+ if ( 1 === count( $non_en_locales_from_header ) ) {
161
+ $locale = reset( $non_en_locales_from_header );
162
+
163
+ $suggest_string = sprintf( /* translators: 1: native language name, 2: URL to translate.wordpress.org */
164
+ __( 'This plugin is not translated into %1$s yet. <a href="%2$s" target="_blank">Help translate it!</a>', 'popup-maker' ), $locales_supported_by_wordpress[ $locale ]['native_name'], esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' ) );
165
+ } else {
166
+ $primary_locale = reset( $non_en_locales_from_header );
167
+ $primary_language = $locales_supported_by_wordpress[ $primary_locale ]['native_name'];
168
+ array_shift( $non_en_locales_from_header );
169
+
170
+ $other_suggest = '';
171
+ foreach ( $non_en_locales_from_header as $locale ) {
172
+ $other_suggest .= $locales_supported_by_wordpress[ $locale ]['native_name'] . ', ';
173
+ }
174
+
175
+ $suggest_string = sprintf( /* translators: 1: native language name, 2: other native language names, comma separated */
176
+ __( 'This plugin is also available in %1$s (also: %2$s). <a href="%3$s" target="_blank">Help improve the translation!</a>', 'popup-maker' ), $primary_language, trim( $other_suggest, ' ,' ), esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' ) );
177
+ }
178
+ }
179
+
180
+ // The plugin has no translation for the current locale.
181
+ } elseif ( ! $current_locale_is_suggested && ! $current_locale_is_translated ) {
182
+ $suggest_string = sprintf( __( 'This plugin is not translated into %1$s yet. <a href="%2$s" target="_blank">Help translate it!</a>', 'popup-maker' ), $locales_supported_by_wordpress[ $current_locale ]['native_name'], esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' ) );
183
+ // The plugin has translations for current locale, but they are out of date.
184
+ } elseif ( $current_locale_is_suggested && $current_locale_is_translated && version_compare( $locale_translation_versions[ $current_locale ], Popup_Maker::$VER, '<' ) ) {
185
+ $suggest_string = sprintf( /* translators: %s: native language name. */
186
+ __( 'This plugin\'s translation for %1$s is out of date. <a href="%2$s" target="_blank">Help improve the translation!</a>', 'popup-maker' ), $locales_supported_by_wordpress[ $current_locale ]['native_name'], esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' ) );
187
+ }
188
+
189
+
190
+ if ( ! empty( $suggest_string ) ) {
191
+ $alerts[] = array(
192
+ 'code' => $code,
193
+ 'message' => $suggest_string,
194
+ 'type' => 'info',
195
+ );
196
+ }
197
+
198
+ return $alerts;
199
+ }
200
+
201
+ /**
202
+ * @param array $alerts
203
+ *
204
+ * @return array
205
+ */
206
+ public static function whats_new_alerts( $alerts = array() ) {
207
+
208
+ $upgraded_from = PUM_Utils_Upgrades::$upgraded_from;
209
+
210
+ if ( version_compare( $upgraded_from, '0.0.0', '>' ) ) {
211
+
212
+ if ( version_compare( $upgraded_from, '1.8.0', '<' ) ) {
213
+ $alerts[] = array(
214
+ 'code' => 'whats_new_1_8_0',
215
+ 'type' => 'success',
216
+ 'message' => sprintf( '<strong>' . __( 'See whats new in v%s - (%sview all changes%s)', 'popup-maker' ) . '</strong>', '1.8.0', '<a href="' . add_query_arg( array(
217
+ 'tab' => 'plugin-information',
218
+ 'plugin' => 'popup-maker',
219
+ 'section' => 'changelog',
220
+ 'TB_iframe' => true,
221
+ 'width' => 722,
222
+ 'height' => 949,
223
+ ), admin_url( 'plugin-install.php' ) ) . '" target="_blank">', '</a>' ),
224
+ 'html' => "<ul class='ul-disc'>" . "<li>" . 'New UX for the Popup Theme editor.' . "</li>" . "<li>" . 'New close button positions: top center, bottom center, middle left & middle right.' . "</li>" . "<li>" . 'New option to position close button outside of popup.' . "</li>" . "</ul>",
225
+ 'priority' => 100,
226
+ );
227
+ }
228
+
229
+ }
230
+
231
+ return $alerts;
232
+ }
233
+
234
+ /**
235
+ * @param array $alerts
236
+ *
237
+ * @return array
238
+ */
239
+ public static function integration_alerts( $alerts = array() ) {
240
+
241
+ $integrations = array(
242
+ 'buddypress' => array(
243
+ 'label' => __( 'BuddyPress', 'buddypress' ),
244
+ 'learn_more_url' => 'https://wppopupmaker.com/works-with/buddypress/',
245
+ 'conditions' => ! class_exists( 'PUM_BuddyPress' ) && ( function_exists( 'buddypress' ) || class_exists( 'BuddyPress' ) ),
246
+ 'slug' => 'popup-maker-buddypress-integration',
247
+ 'name' => 'Popup Maker - BuddyPress Integration',
248
+ 'free' => true,
249
+ ),
250
+ );
251
+
252
+ foreach ( $integrations as $key => $integration ) {
253
+
254
+ if ( $integration['conditions'] ) {
255
+
256
+ $path = "{$integration['slug']}/{$integration['slug']}.php";
257
+ $plugin_data = file_exists( WP_PLUGIN_DIR . '/' . $path ) ? get_plugin_data( WP_PLUGIN_DIR . '/' . $path, false, false ) : false;
258
+
259
+ $installed = $plugin_data && ! empty( $plugin_data['Name'] ) && $plugin_data['Name'] === $integration['name'];
260
+
261
+ $text = $installed ? __( 'activate it now', 'popup-maker' ) : __( 'install it now', 'popup-maker' );
262
+ $url = $installed ? esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $path ), 'activate-plugin_' . $path ) ) : esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=popup-maker-buddypress-integration' ), 'install-plugin_popup-maker-buddypress-integration' ) );
263
+
264
+ $alerts[] = array(
265
+ 'code' => $key . '_integration_available',
266
+ 'message' => sprintf( __( '%sDid you know:%s Popup Maker has custom integrations with %s, %slearn more%s or %s%s%s!', 'popup-maker' ), '<strong>', '</strong>', $integration['label'], '<a href="' . $integration['learn_more_url'] . '" target="_blank">', '</a>', '<a href="' . $url . '">', $text, '</a>' ),
267
+ 'dismissible' => true,
268
+ 'global' => false,
269
+ 'type' => $installed ? 'warning' : 'info',
270
+ );
271
+
272
+ }
273
+
274
+ }
275
+
276
+ return $alerts;
277
+ }
278
+
279
+ /**
280
+ * Hook into relevant WP actions.
281
+ */
282
+ public static function hooks() {
283
+ if ( is_admin() && current_user_can( 'edit_posts' ) ) {
284
+ add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) );
285
+ add_action( 'network_admin_notices', array( __CLASS__, 'admin_notices' ) );
286
+ add_action( 'user_admin_notices', array( __CLASS__, 'admin_notices' ) );
287
+ }
288
+ }
289
+
290
+ /**
291
+ * @return bool
292
+ */
293
+ public static function should_show_alerts() {
294
+ return in_array( true, array(
295
+ pum_is_admin_page(),
296
+ count( self::get_global_alerts() ) > 0,
297
+ ) );
298
+ }
299
+
300
+ /**
301
+ * Render admin alerts if available.
302
+ */
303
+ public static function admin_notices() {
304
+ if ( ! self::should_show_alerts() ) {
305
+ return;
306
+ }
307
+
308
+ $global_only = ! pum_is_admin_page();
309
+
310
+ $alerts = $global_only ? self::get_global_alerts() : self::get_alerts();
311
+
312
+ $count = count( $alerts );
313
+
314
+ if ( ! $count ) {
315
+ return;
316
+ }
317
+
318
+ wp_enqueue_script( 'pum-admin-general' );
319
+ wp_enqueue_style( 'pum-admin-general' );
320
+
321
+ $nonce = wp_create_nonce( 'pum_alerts_action' );
322
+ ?>
323
+
324
+ <script type="text/javascript">
325
+ window.pum_alerts_nonce = '<?php echo $nonce ?>';
326
+ </script>
327
+
328
+ <div class="pum-alerts">
329
+
330
+ <h3>
331
+ <img alt="" class="logo" width="30" src="<?php echo Popup_Maker::$URL; ?>assets/images/logo.png" /> <?php printf( '%s%s (%s)', ( $global_only ? __( 'Popup Maker', 'popup-maker' ) . ' ' : '' ), __( 'Notifications', 'popup-maker' ), '<span class="pum-alert-count">' . $count . '</span>' ); ?>
332
+ </h3>
333
+
334
+ <p><?php __( 'Check out the following notifications from Popup Maker.', 'popup-maker' ); ?></p>
335
+
336
+ <?php foreach ( $alerts as $alert ) {
337
+ $expires = 1 == $alert['dismissible'] ? '' : $alert['dismissible'];
338
+ $dismiss_url = add_query_arg( array(
339
+ 'nonce' => $nonce,
340
+ 'code' => $alert['code'],
341
+ 'pum_dismiss_alert' => 'dismiss',
342
+ 'expires' => $expires,
343
+ ));
344
+ ?>
345
+
346
+ <div class="pum-alert-holder" data-code="<?php echo $alert['code']; ?>" class="<?php echo $alert['dismissible'] ? 'is-dismissible' : ''; ?>" data-dismissible="<?php echo esc_attr( $alert['dismissible'] ); ?>">
347
+
348
+ <div class="pum-alert <?php echo $alert['type'] != '' ? 'pum-alert__' . $alert['type'] : ''; ?>">
349
+
350
+ <?php if ( ! empty( $alert['message'] ) ) : ?>
351
+ <p><?php echo $alert['message']; ?></p>
352
+ <?php endif; ?>
353
+
354
+ <?php if ( ! empty( $alert['html'] ) ) : ?>
355
+ <?php echo function_exists( 'wp_encode_emoji' ) ? wp_encode_emoji( $alert['html'] ) : $alert['html']; ?>
356
+ <?php endif; ?>
357
+
358
+ <?php if ( ! empty( $alert['actions'] ) && is_array( $alert['actions'] ) ) : ?>
359
+ <ul>
360
+ <?php foreach ( $alert['actions'] as $action ) {
361
+ $link_text = ! empty( $action['primary'] ) && true === $action['primary'] ? '<strong>' . esc_html($action['text']) . '</strong>' : esc_html($action['text']);
362
+ if ( 'link' === $action['type'] ) {
363
+ $url = $action['href'];
364
+ $attributes = 'target="_blank" rel="noreferrer noopener"';
365
+ } else {
366
+ $url = add_query_arg( array(
367
+ 'nonce' => $nonce,
368
+ 'code' => $alert['code'],
369
+ 'pum_dismiss_alert' => $action['action'],
370
+ 'expires' => $expires,
371
+ ));
372
+ $attributes = 'class="pum-dismiss"';
373
+ }
374
+ ?>
375
+ <li><a data-action="<?php echo esc_attr($action['action']); ?>" href="<?php echo esc_url($url); ?>" <?php echo $attributes; ?> ><?php echo $link_text; ?></a></li>
376
+ <?php } ?>
377
+ </ul>
378
+ <?php endif; ?>
379
+
380
+ </div>
381
+
382
+ <?php if ( $alert['dismissible'] ) : ?>
383
+
384
+ <a href="<?php echo esc_url( $dismiss_url ); ?>" data-action="dismiss" class="button dismiss pum-dismiss">
385
+ <span class="screen-reader-text"><?php _e( 'Dismiss this item.', 'popup-maker' ); ?></span> <span class="dashicons dashicons-no-alt"></span>
386
+ </a>
387
+
388
+ <?php endif; ?>
389
+
390
+ </div>
391
+
392
+ <?php } ?>
393
+
394
+ </div>
395
+
396
+ <?php
397
+ }
398
+
399
+ /**
400
+ * @return array
401
+ */
402
+ public static function get_global_alerts() {
403
+ $alerts = self::get_alerts();
404
+
405
+ $global_alerts = array();
406
+
407
+ foreach ( $alerts as $alert ) {
408
+ if ( $alert['global'] ) {
409
+ $global_alerts[] = $alert;
410
+ }
411
+ }
412
+
413
+ return $global_alerts;
414
+ }
415
+
416
+ /**
417
+ * @return array
418
+ */
419
+ public static function get_alerts() {
420
+
421
+ static $alert_list;
422
+
423
+ if ( ! isset( $alert_list ) ) {
424
+ $alert_list = apply_filters( 'pum_alert_list', array() );
425
+ }
426
+
427
+ $alerts = array();
428
+
429
+ foreach ( $alert_list as $alert ) {
430
+
431
+ // Ignore dismissed alerts.
432
+ if ( self::has_dismissed_alert( $alert['code'] ) ) {
433
+ continue;
434
+ }
435
+
436
+ $alerts[] = wp_parse_args( $alert, array(
437
+ 'code' => 'default',
438
+ 'priority' => 10,
439
+ 'message' => '',
440
+ 'type' => 'info',
441
+ 'html' => '',
442
+ 'dismissible' => true,
443
+ 'global' => false,
444
+ ) );
445
+
446
+ }
447
+
448
+ // Sort alerts by priority, highest to lowest.
449
+ $alerts = PUM_Utils_Array::sort( $alerts, 'priority', true );
450
+
451
+ return $alerts;
452
+ }
453
+
454
+
455
+ /**
456
+ * Handles if alert was dismissed AJAX
457
+ */
458
+ public static function ajax_handler() {
459
+ $args = wp_parse_args( $_REQUEST, array(
460
+ 'code' => '',
461
+ 'expires' => '',
462
+ 'pum_dismiss_alert' => '',
463
+ ));
464
+
465
+ if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'pum_alerts_action' ) ) {
466
+ wp_send_json_error();
467
+ }
468
+
469
+ $results = self::action_handler( $args['code'], $args['pum_dismiss_alert'], $args['expires'] );
470
+ if ( true === $results ) {
471
+ wp_send_json_success();
472
+ } else {
473
+ wp_send_json_error();
474
+ }
475
+ }
476
+
477
+ /**
478
+ * Handles if alert was dismissed by page reload instead of AJAX
479
+ *
480
+ * @since 1.11.0
481
+ */
482
+ public static function php_handler() {
483
+ if ( ! isset( $_REQUEST['pum_dismiss_alert'] ) ) {
484
+ return;
485
+ }
486
+
487
+ if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'pum_alerts_action' ) ) {
488
+ return;
489
+ }
490
+
491
+ $args = wp_parse_args( $_REQUEST, array(
492
+ 'code' => '',
493
+ 'expires' => '',
494
+ 'pum_dismiss_alert' => '',
495
+ ));
496
+
497
+ self::action_handler( $args['code'], $args['pum_dismiss_alert'], $args['expires'] );
498
+ }
499
+
500
+ /**
501
+ * Handles the action taken on the alert.
502
+ *
503
+ * @param string $code The specific alert.
504
+ * @param string $action Which action was taken
505
+ * @param string $expires When the dismissal expires, if any.
506
+ *
507
+ * @return bool
508
+ * @uses PUM_Utils_Logging::instance
509
+ * @uses PUM_Utils_Logging::log
510
+ * @since 1.11.0
511
+ */
512
+ public static function action_handler( $code, $action, $expires ) {
513
+ if ( empty( $action ) || 'dismiss' === $action ) {
514
+ try {
515
+ $dismissed_alerts = self::dismissed_alerts();
516
+ $dismissed_alerts[ $code ] = ! empty( $expires ) ? strtotime( '+' . $expires ) : true;
517
+
518
+ $user_id = get_current_user_id();
519
+ update_user_meta( $user_id, '_pum_dismissed_alerts', $dismissed_alerts );
520
+ return true;
521
+
522
+ } catch ( Exception $e ) {
523
+ PUM_Utils_Logging::instance()->log( 'Error dismissing alert. Exception: ' . $e->getMessage() );
524
+ return false;
525
+ }
526
+ }
527
+
528
+ do_action( 'pum_alert_dismissed', $code, $action );
529
+ }
530
+
531
+ /**
532
+ * @param string $code
533
+ *
534
+ * @return bool
535
+ */
536
+ public static function has_dismissed_alert( $code = '' ) {
537
+ $dimissed_alerts = self::dismissed_alerts();
538
+
539
+ $alert_dismissed = array_key_exists( $code, $dimissed_alerts );
540
+
541
+ // If the alert was dismissed and has a non true type value, it is an expiry time.
542
+ if ( $alert_dismissed && true !== $dimissed_alerts[ $code ] ) {
543
+ return strtotime( 'now' ) < $dimissed_alerts[ $code ];
544
+ }
545
+
546
+ return $alert_dismissed;
547
+ }
548
+
549
+ /**
550
+ * Returns an array of dismissed alert groups.
551
+ *
552
+ * @return array
553
+ */
554
+ public static function dismissed_alerts() {
555
+ $user_id = get_current_user_id();
556
+
557
+ $dismissed_alerts = get_user_meta( $user_id, '_pum_dismissed_alerts', true );
558
+
559
+ if ( ! is_array( $dismissed_alerts ) ) {
560
+ $dismissed_alerts = array();
561
+ update_user_meta( $user_id, '_pum_dismissed_alerts', $dismissed_alerts );
562
+ }
563
+
564
+ return $dismissed_alerts;
565
+ }
566
+
567
+ }
languages/popup-maker.pot CHANGED
@@ -1787,11 +1787,11 @@ msgstr ""
1787
  msgid "Get updates for pre-release versions of %s"
1788
  msgstr ""
1789
 
1790
- #: classes/Analytics.php:159
1791
  msgid "Event Type"
1792
  msgstr ""
1793
 
1794
- #: classes/Analytics.php:164, classes/Shortcode/Subscribe.php:410, includes/integrations/ninja-forms/Actions/OpenPopup.php:42
1795
  msgid "Popup ID"
1796
  msgstr ""
1797
 
1787
  msgid "Get updates for pre-release versions of %s"
1788
  msgstr ""
1789
 
1790
+ #: classes/Analytics.php:160
1791
  msgid "Event Type"
1792
  msgstr ""
1793
 
1794
+ #: classes/Analytics.php:165, classes/Shortcode/Subscribe.php:410, includes/integrations/ninja-forms/Actions/OpenPopup.php:42
1795
  msgid "Popup ID"
1796
  msgstr ""
1797
 
popup-maker.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Popup Maker
4
  * Plugin URI: https://wppopupmaker.com/?utm_campaign=PluginInfo&utm_source=plugin-header&utm_medium=plugin-uri
5
  * Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
6
- * Version: 1.11.1
7
  * Author: Popup Maker
8
  * Author URI: https://wppopupmaker.com/?utm_campaign=PluginInfo&utm_source=plugin-header&utm_medium=author-uri
9
  * License: GPL2 or later
@@ -93,7 +93,7 @@ class Popup_Maker {
93
  /**
94
  * @var string Plugin Version
95
  */
96
- public static $VER = '1.11.1';
97
 
98
  /**
99
  * @var int DB Version
3
  * Plugin Name: Popup Maker
4
  * Plugin URI: https://wppopupmaker.com/?utm_campaign=PluginInfo&utm_source=plugin-header&utm_medium=plugin-uri
5
  * Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
6
+ * Version: 1.11.2
7
  * Author: Popup Maker
8
  * Author URI: https://wppopupmaker.com/?utm_campaign=PluginInfo&utm_source=plugin-header&utm_medium=author-uri
9
  * License: GPL2 or later
93
  /**
94
  * @var string Plugin Version
95
  */
96
+ public static $VER = '1.11.2';
97
 
98
  /**
99
  * @var int DB Version
readme.txt CHANGED
@@ -5,9 +5,9 @@ Plugin URI: https://wppopupmaker.com/?utm_capmaign=Readme&utm_source=readme-head
5
  Donate link:
6
  Tags: marketing, popup, popups, optin, advertising, conversion, responsive popups, promotion, popover, pop-up, pop over, lightbox, conversion, modal
7
  Requires at least: 4.1
8
- Tested up to: 5.4
9
  Requires PHP: 5.6
10
- Stable tag: 1.11.1
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -136,6 +136,11 @@ There are several common causes for this, check [this guide for help](https://do
136
 
137
  View our [complete changelog](https://github.com/PopupMaker/Popup-Maker/blob/master/CHANGELOG.md) for up-to-date information on what has been going on with the development of Popup Maker.
138
 
 
 
 
 
 
139
  = v1.11.1 - 07/22/2020 =
140
  * Fix: Form submission cookies no longer set with Contact Form 7 5.2
141
 
5
  Donate link:
6
  Tags: marketing, popup, popups, optin, advertising, conversion, responsive popups, promotion, popover, pop-up, pop over, lightbox, conversion, modal
7
  Requires at least: 4.1
8
+ Tested up to: 5.5
9
  Requires PHP: 5.6
10
+ Stable tag: 1.11.2
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
136
 
137
  View our [complete changelog](https://github.com/PopupMaker/Popup-Maker/blob/master/CHANGELOG.md) for up-to-date information on what has been going on with the development of Popup Maker.
138
 
139
+ = v1.11.2 - 08/17/2020 =
140
+ * Fix: `wp_make_content_images_responsive` is deprecated, use `wp_filter_content_tags()` instead
141
+ * Fix: IE 11 does not support JS Promises
142
+ * Fix: Missing permission_callback on REST endpoint
143
+
144
  = v1.11.1 - 07/22/2020 =
145
  * Fix: Form submission cookies no longer set with Contact Form 7 5.2
146