Boxzilla - Version 3.2.12

Version Description

Download this release

Release Info

Developer DvanKooten
Plugin Icon 128x128 Boxzilla
Version 3.2.12
Comparing to
See all releases

Code changes from version 3.2.11 to 3.2.12

assets/browserify/script.js CHANGED
@@ -66,8 +66,10 @@
66
  // add custom css to box
67
  css(box.element, boxOpts.css);
68
 
69
- box.element.firstChild.firstChild.className += " first-child";
70
- box.element.firstChild.lastChild.className += " last-child";
 
 
71
 
72
  // maybe show box right away
73
  if( box.fits() && locationHashRefersBox(box) ) {
66
  // add custom css to box
67
  css(box.element, boxOpts.css);
68
 
69
+ try {
70
+ box.element.firstChild.firstChild.className += " first-child";
71
+ box.element.firstChild.lastChild.className += " last-child";
72
+ } catch(e) {}
73
 
74
  // maybe show box right away
75
  if( box.fits() && locationHashRefersBox(box) ) {
assets/js/admin-script.js CHANGED
@@ -353,9 +353,9 @@ module.exports = Option;
353
 
354
  },{}],5:[function(require,module,exports){
355
  /*!
356
- * EventEmitter v5.2.5 - git.io/ee
357
  * Unlicense - http://unlicense.org/
358
- * Oliver Caldwell - http://oli.me.uk/
359
  * @preserve
360
  */
361
 
353
 
354
  },{}],5:[function(require,module,exports){
355
  /*!
356
+ * EventEmitter v5.2.6 - git.io/ee
357
  * Unlicense - http://unlicense.org/
358
+ * Oliver Caldwell - https://oli.me.uk/
359
  * @preserve
360
  */
361
 
assets/js/admin-script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var s=void 0;!function i(l,s,a){function u(t,e){if(!s[t]){if(!l[t]){var n=!1;if(!e&&n)return n(t,!0);if(c)return c(t,!0);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}var r=s[t]={exports:{}};l[t][0].call(r.exports,function(e){return u(l[t][1][e]||e)},r,r.exports,i,l,s,a)}return s[t].exports}for(var c=!1,e=0;e<a.length;e++)u(a[e]);return u}({1:[function(e,t,n){"use strict";window.Boxzilla_Admin=e("./admin/_admin.js")},{"./admin/_admin.js":2}],2:[function(d,f,e){"use strict";!function(){var l=window.jQuery,e=d("./_option.js"),n=document.getElementById("boxzilla-box-options-controls"),t=l(n),s=document.createTextNode(" logged in");if(0!==t.length){var o=new(d("wolfy87-eventemitter")),r=d("./_designer.js")(l,e,o),i=wp.template("rule-row-template"),a=boxzilla_i18n,u=document.getElementById("boxzilla-rule-comparison"),c=document.getElementById("boxzilla-box-rules");t.on("click",".boxzilla-add-rule",function(){var e={key:n.querySelectorAll(".boxzilla-rule-row").length,andor:"any"===u.value?a.or:a.and},t=i(e);return l(c).append(t),!1}),t.on("click",".boxzilla-remove-rule",function(){var e=l(this).parents("tr");e.prev().remove(),e.remove()}),t.on("change",".boxzilla-rule-condition",p),t.find(".boxzilla-auto-show-trigger").on("change",function(){t.find(".boxzilla-trigger-options").toggle(""!==this.value)}),l(u).change(function(){var e="any"===u.value?a.or:a.and;l(".boxzilla-andor").text(e)}),l(window).load(function(){void 0===window.tinyMCE&&(document.getElementById("notice-notinymce").style.display="")}),l(".boxzilla-rule-row").each(p),f.exports={Designer:r,Option:e,events:o}}function p(){var e="tr"===this.tagName.toLowerCase()?this:l(this).parents("tr").get(0),t=e.querySelector(".boxzilla-rule-condition").value,n=e.querySelector(".boxzilla-rule-value"),o=e.querySelector(".boxzilla-rule-qualifier"),r=n.cloneNode(!0),i=l(r);switch(l(e.querySelectorAll(".boxzilla-helper")).remove(),r.removeAttribute("name"),r.className=r.className+" boxzilla-helper",n.parentNode.insertBefore(r,n.nextSibling),i.change(function(){n.value=this.value}),r.style.display="",n.style.display="none",o.style.display="",o.querySelector('option[value="not_contains"]').style.display="none",o.querySelector('option[value="contains"]').style.display="none",s.parentNode&&s.parentNode.removeChild(s),t){default:r.placeholder=a.enterCommaSeparatedValues;break;case"":case"everywhere":o.value="1",n.value="",r.style.display="none",o.style.display="none";break;case"is_single":case"is_post":r.placeholder=a.enterCommaSeparatedPosts,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post",{multiple:!0,multipleSep:","});break;case"is_page":r.placeholder=a.enterCommaSeparatedPages,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=page",{multiple:!0,multipleSep:","});break;case"is_post_type":r.placeholder=a.enterCommaSeparatedPostTypes,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_type",{multiple:!0,multipleSep:","});break;case"is_url":o.querySelector('option[value="contains"]').style.display="",o.querySelector('option[value="not_contains"]').style.display="",r.placeholder=a.enterCommaSeparatedRelativeUrls;break;case"is_post_in_category":i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=category",{multiple:!0,multipleSep:","});break;case"is_post_with_tag":i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_tag",{multiple:!0,multipleSep:","});break;case"is_user_logged_in":r.style.display="none",n.parentNode.insertBefore(s,n.nextSibling);break;case"is_referer":o.querySelector('option[value="contains"]').style.display="",o.querySelector('option[value="not_contains"]').style.display=""}}}()},{"./_designer.js":3,"./_option.js":4,"wolfy87-eventemitter":5}],3:[function(e,t,n){"use strict";function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t.exports=function(e,t,n){var o,r,i,l=document.getElementById("post_ID").value||0,s={},a=!1,u=e("#boxzilla-box-appearance-controls");function c(){return!!a&&(window.setTimeout(function(){i.css({"border-color":s.borderColor.getColorValue(),"border-width":s.borderWidth.getPxValue(),"border-style":s.borderStyle.getValue(),"background-color":s.backgroundColor.getColorValue(),width:s.width.getPxValue(),color:s.color.getColorValue()}),n.trigger("editor.styles.apply")},10),!0)}return s.borderColor=new t("border-color"),s.borderWidth=new t("border-width"),s.borderStyle=new t("border-style"),s.backgroundColor=new t("background-color"),s.width=new t("width"),s.color=new t("color"),u.find("input.boxzilla-color-field").wpColorPicker({change:c,clear:c}),u.find(":input").not(".boxzilla-color-field").change(c),n.on("editor.init",c),{init:function(){"object"===p(window.tinyMCE)&&null!==tinyMCE.get("content")&&(r=e("#content_ifr"),(o=r.contents().find("html")).css({background:"white"}),(i=o.find("#tinymce")).addClass("boxzilla boxzilla-"+l),i.css({margin:0,background:"white",display:"inline-block",width:"auto","min-width":"240px",position:"relative"}),i.get(0).style.cssText+=";padding: 25px !important;",a=!0,n.trigger("editor.init"))},resetStyles:function(){for(var e in s)"theme"!==e.substring(0,5)&&s[e].clear();c(),n.trigger("editor.styles.reset")},options:s}}},{}],4:[function(e,t,n){"use strict";var o=window.jQuery,r=function(e){"string"==typeof e&&(e=document.getElementById("boxzilla-"+e)),e||console.error("Unable to find option element."),this.element=e};r.prototype.getColorValue=function(){return 0<this.element.value.length?o(this.element).hasClass("wp-color-field")?o(this.element).wpColorPicker("color"):this.element.value:""},r.prototype.getPxValue=function(e){return 0<this.element.value.length?parseInt(this.element.value)+"px":e||""},r.prototype.getValue=function(e){return 0<this.element.value.length?this.element.value:e||""},r.prototype.clear=function(){this.element.value=""},r.prototype.setValue=function(e){this.element.value=e},t.exports=r},{}],5:[function(e,l,t){!function(e){"use strict";function t(){}var n=t.prototype,o=e.EventEmitter;function i(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function r(e){return function(){return this[e].apply(this,arguments)}}n.getListeners=function(e){var t,n,o=this._getEvents();if(e instanceof RegExp)for(n in t={},o)o.hasOwnProperty(n)&&e.test(n)&&(t[n]=o[n]);else t=o[e]||(o[e]=[]);return t},n.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},n.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},n.addListener=function(e,t){if(!function e(t){return"function"==typeof t||t instanceof RegExp||!(!t||"object"!=typeof t)&&e(t.listener)}(t))throw new TypeError("listener must be a function");var n,o=this.getListenersAsObject(e),r="object"==typeof t;for(n in o)o.hasOwnProperty(n)&&-1===i(o[n],t)&&o[n].push(r?t:{listener:t,once:!1});return this},n.on=r("addListener"),n.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},n.once=r("addOnceListener"),n.defineEvent=function(e){return this.getListeners(e),this},n.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},n.removeListener=function(e,t){var n,o,r=this.getListenersAsObject(e);for(o in r)r.hasOwnProperty(o)&&-1!==(n=i(r[o],t))&&r[o].splice(n,1);return this},n.off=r("removeListener"),n.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},n.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},n.manipulateListeners=function(e,t,n){var o,r,i=e?this.removeListener:this.addListener,l=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(o=n.length;o--;)i.call(this,t,n[o]);else for(o in t)t.hasOwnProperty(o)&&(r=t[o])&&("function"==typeof r?i.call(this,o,r):l.call(this,o,r));return this},n.removeEvent=function(e){var t,n=typeof e,o=this._getEvents();if("string"===n)delete o[e];else if(e instanceof RegExp)for(t in o)o.hasOwnProperty(t)&&e.test(t)&&delete o[t];else delete this._events;return this},n.removeAllListeners=r("removeEvent"),n.emitEvent=function(e,t){var n,o,r,i,l=this.getListenersAsObject(e);for(i in l)if(l.hasOwnProperty(i))for(n=l[i].slice(0),r=0;r<n.length;r++)!0===(o=n[r]).once&&this.removeListener(e,o.listener),o.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,o.listener);return this},n.trigger=r("emitEvent"),n.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},n.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},n._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},n._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return e.EventEmitter=o,t},"function"==typeof s&&s.amd?s(function(){return t}):"object"==typeof l&&l.exports?l.exports=t:e.EventEmitter=t}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=admin-script.min.js.map
1
+ !function(){var s=void 0;!function i(l,s,a){function u(t,e){if(!s[t]){if(!l[t]){var n=!1;if(!e&&n)return n(t,!0);if(c)return c(t,!0);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}var r=s[t]={exports:{}};l[t][0].call(r.exports,function(e){return u(l[t][1][e]||e)},r,r.exports,i,l,s,a)}return s[t].exports}for(var c=!1,e=0;e<a.length;e++)u(a[e]);return u}({1:[function(e,t,n){"use strict";window.Boxzilla_Admin=e("./admin/_admin.js")},{"./admin/_admin.js":2}],2:[function(d,f,e){"use strict";!function(){var l=window.jQuery,e=d("./_option.js"),n=document.getElementById("boxzilla-box-options-controls"),t=l(n),s=document.createTextNode(" logged in");if(0!==t.length){var o=new(d("wolfy87-eventemitter")),r=d("./_designer.js")(l,e,o),i=wp.template("rule-row-template"),a=boxzilla_i18n,u=document.getElementById("boxzilla-rule-comparison"),c=document.getElementById("boxzilla-box-rules");t.on("click",".boxzilla-add-rule",function(){var e={key:n.querySelectorAll(".boxzilla-rule-row").length,andor:"any"===u.value?a.or:a.and},t=i(e);return l(c).append(t),!1}),t.on("click",".boxzilla-remove-rule",function(){var e=l(this).parents("tr");e.prev().remove(),e.remove()}),t.on("change",".boxzilla-rule-condition",p),t.find(".boxzilla-auto-show-trigger").on("change",function(){t.find(".boxzilla-trigger-options").toggle(""!==this.value)}),l(u).change(function(){var e="any"===u.value?a.or:a.and;l(".boxzilla-andor").text(e)}),l(window).load(function(){void 0===window.tinyMCE&&(document.getElementById("notice-notinymce").style.display="")}),l(".boxzilla-rule-row").each(p),f.exports={Designer:r,Option:e,events:o}}function p(){var e="tr"===this.tagName.toLowerCase()?this:l(this).parents("tr").get(0),t=e.querySelector(".boxzilla-rule-condition").value,n=e.querySelector(".boxzilla-rule-value"),o=e.querySelector(".boxzilla-rule-qualifier"),r=n.cloneNode(!0),i=l(r);switch(l(e.querySelectorAll(".boxzilla-helper")).remove(),r.removeAttribute("name"),r.className=r.className+" boxzilla-helper",n.parentNode.insertBefore(r,n.nextSibling),i.change(function(){n.value=this.value}),r.style.display="",n.style.display="none",o.style.display="",o.querySelector('option[value="not_contains"]').style.display="none",o.querySelector('option[value="contains"]').style.display="none",s.parentNode&&s.parentNode.removeChild(s),t){default:r.placeholder=a.enterCommaSeparatedValues;break;case"":case"everywhere":o.value="1",n.value="",r.style.display="none",o.style.display="none";break;case"is_single":case"is_post":r.placeholder=a.enterCommaSeparatedPosts,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post",{multiple:!0,multipleSep:","});break;case"is_page":r.placeholder=a.enterCommaSeparatedPages,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=page",{multiple:!0,multipleSep:","});break;case"is_post_type":r.placeholder=a.enterCommaSeparatedPostTypes,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_type",{multiple:!0,multipleSep:","});break;case"is_url":o.querySelector('option[value="contains"]').style.display="",o.querySelector('option[value="not_contains"]').style.display="",r.placeholder=a.enterCommaSeparatedRelativeUrls;break;case"is_post_in_category":i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=category",{multiple:!0,multipleSep:","});break;case"is_post_with_tag":i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_tag",{multiple:!0,multipleSep:","});break;case"is_user_logged_in":r.style.display="none",n.parentNode.insertBefore(s,n.nextSibling);break;case"is_referer":o.querySelector('option[value="contains"]').style.display="",o.querySelector('option[value="not_contains"]').style.display=""}}}()},{"./_designer.js":3,"./_option.js":4,"wolfy87-eventemitter":5}],3:[function(e,t,n){"use strict";function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t.exports=function(e,t,n){var o,r,i,l=document.getElementById("post_ID").value||0,s={},a=!1,u=e("#boxzilla-box-appearance-controls");function c(){return!!a&&(window.setTimeout(function(){i.css({"border-color":s.borderColor.getColorValue(),"border-width":s.borderWidth.getPxValue(),"border-style":s.borderStyle.getValue(),"background-color":s.backgroundColor.getColorValue(),width:s.width.getPxValue(),color:s.color.getColorValue()}),n.trigger("editor.styles.apply")},10),!0)}return s.borderColor=new t("border-color"),s.borderWidth=new t("border-width"),s.borderStyle=new t("border-style"),s.backgroundColor=new t("background-color"),s.width=new t("width"),s.color=new t("color"),u.find("input.boxzilla-color-field").wpColorPicker({change:c,clear:c}),u.find(":input").not(".boxzilla-color-field").change(c),n.on("editor.init",c),{init:function(){"object"===p(window.tinyMCE)&&null!==tinyMCE.get("content")&&(r=e("#content_ifr"),(o=r.contents().find("html")).css({background:"white"}),(i=o.find("#tinymce")).addClass("boxzilla boxzilla-"+l),i.css({margin:0,background:"white",display:"inline-block",width:"auto","min-width":"240px",position:"relative"}),i.get(0).style.cssText+=";padding: 25px !important;",a=!0,n.trigger("editor.init"))},resetStyles:function(){for(var e in s)"theme"!==e.substring(0,5)&&s[e].clear();c(),n.trigger("editor.styles.reset")},options:s}}},{}],4:[function(e,t,n){"use strict";function o(e){"string"==typeof e&&(e=document.getElementById("boxzilla-"+e)),e||console.error("Unable to find option element."),this.element=e}var r=window.jQuery;o.prototype.getColorValue=function(){return 0<this.element.value.length?r(this.element).hasClass("wp-color-field")?r(this.element).wpColorPicker("color"):this.element.value:""},o.prototype.getPxValue=function(e){return 0<this.element.value.length?parseInt(this.element.value)+"px":e||""},o.prototype.getValue=function(e){return 0<this.element.value.length?this.element.value:e||""},o.prototype.clear=function(){this.element.value=""},o.prototype.setValue=function(e){this.element.value=e},t.exports=o},{}],5:[function(e,l,t){!function(e){"use strict";function t(){}var n=t.prototype,o=e.EventEmitter;function i(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function r(e){return function(){return this[e].apply(this,arguments)}}n.getListeners=function(e){var t,n,o=this._getEvents();if(e instanceof RegExp)for(n in t={},o)o.hasOwnProperty(n)&&e.test(n)&&(t[n]=o[n]);else t=o[e]||(o[e]=[]);return t},n.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},n.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},n.addListener=function(e,t){if(!function e(t){return"function"==typeof t||t instanceof RegExp||!(!t||"object"!=typeof t)&&e(t.listener)}(t))throw new TypeError("listener must be a function");var n,o=this.getListenersAsObject(e),r="object"==typeof t;for(n in o)o.hasOwnProperty(n)&&-1===i(o[n],t)&&o[n].push(r?t:{listener:t,once:!1});return this},n.on=r("addListener"),n.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},n.once=r("addOnceListener"),n.defineEvent=function(e){return this.getListeners(e),this},n.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},n.removeListener=function(e,t){var n,o,r=this.getListenersAsObject(e);for(o in r)r.hasOwnProperty(o)&&-1!==(n=i(r[o],t))&&r[o].splice(n,1);return this},n.off=r("removeListener"),n.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},n.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},n.manipulateListeners=function(e,t,n){var o,r,i=e?this.removeListener:this.addListener,l=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(o=n.length;o--;)i.call(this,t,n[o]);else for(o in t)t.hasOwnProperty(o)&&(r=t[o])&&("function"==typeof r?i.call(this,o,r):l.call(this,o,r));return this},n.removeEvent=function(e){var t,n=typeof e,o=this._getEvents();if("string"==n)delete o[e];else if(e instanceof RegExp)for(t in o)o.hasOwnProperty(t)&&e.test(t)&&delete o[t];else delete this._events;return this},n.removeAllListeners=r("removeEvent"),n.emitEvent=function(e,t){var n,o,r,i,l=this.getListenersAsObject(e);for(i in l)if(l.hasOwnProperty(i))for(n=l[i].slice(0),r=0;r<n.length;r++)!0===(o=n[r]).once&&this.removeListener(e,o.listener),o.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,o.listener);return this},n.trigger=r("emitEvent"),n.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},n.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},n._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},n._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return e.EventEmitter=o,t},"function"==typeof s&&s.amd?s(function(){return t}):"object"==typeof l&&l.exports?l.exports=t:e.EventEmitter=t}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=admin-script.min.js.map
assets/js/admin-script.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["admin-script.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","window","Boxzilla_Admin","./admin/_admin.js","2","$","jQuery","Option","optionControls","document","getElementById","$optionControls","tnLoggedIn","createTextNode","events","Designer","rowTemplate","wp","template","i18n","boxzilla_i18n","ruleComparisonEl","rulesContainerEl","on","data","key","querySelectorAll","andor","value","or","and","html","append","row","this","parents","prev","remove","setContextualHelpers","find","toggle","change","newText","text","load","tinyMCE","style","display","each","context","tagName","toLowerCase","get","condition","querySelector","valueInput","qualifierInput","betterInput","cloneNode","$betterInput","removeAttribute","className","parentNode","insertBefore","nextSibling","removeChild","placeholder","enterCommaSeparatedValues","enterCommaSeparatedPosts","suggest","ajaxurl","multiple","multipleSep","enterCommaSeparatedPages","enterCommaSeparatedPostTypes","enterCommaSeparatedRelativeUrls","./_designer.js","./_option.js","wolfy87-eventemitter","3","_typeof","obj","Symbol","iterator","constructor","prototype","$editor","$editorFrame","$innerEditor","boxId","options","visualEditorInitialised","$appearanceControls","applyStyles","setTimeout","css","border-color","borderColor","getColorValue","border-width","borderWidth","getPxValue","border-style","borderStyle","getValue","background-color","backgroundColor","width","color","trigger","wpColorPicker","clear","not","init","contents","background","addClass","margin","min-width","position","cssText","resetStyles","substring","4","element","console","error","hasClass","fallbackValue","parseInt","setValue","5","EventEmitter","proto","originalGlobalValue","indexOfListener","listeners","listener","alias","name","apply","arguments","getListeners","evt","response","_getEvents","RegExp","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","isValidListener","TypeError","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","single","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA8EA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,GAAG,CAACQ,QAAQ,IAAIZ,EAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGQ,QAAQ,IAAI,IAAIL,GAAE,EAAoCH,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAA7b,CAA4c,CAACY,EAAE,CAAC,SAASC,EAAQC,EAAOL,GACzlB,aAEAM,OAAOC,eAAiBH,EAAQ,sBAE9B,CAACI,oBAAoB,IAAIC,EAAE,CAAC,SAASL,EAAQC,EAAOL,GACtD,cAEA,WAGE,IAAIU,EAAIJ,OAAOK,OAEXC,EAASR,EAAQ,gBAEjBS,EAAiBC,SAASC,eAAe,iCACzCC,EAAkBN,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EAAaxJ,GAAKyJ,MAAM,GAE/B/L,EAAI,EAAGA,EAAIqJ,EAAU3I,OAAQV,KAKR,KAFtBsJ,EAAWD,EAAUrJ,IAER2K,MACT5H,KAAKiI,eAAepB,EAAKN,EAASA,UAG3BA,EAASA,SAASG,MAAM1G,KAAM8I,GAAQ,MAEhC9I,KAAKiJ,uBAClBjJ,KAAKiI,eAAepB,EAAKN,EAASA,UAMlD,OAAOvG,MAMXmG,EAAMxB,QAAU6B,EAAM,aAUtBL,EAAM+C,KAAO,SAAcrC,GACvB,IAAIiC,EAAOvB,MAAMpE,UAAU6F,MAAMtL,KAAKiJ,UAAW,GACjD,OAAO3G,KAAK6I,UAAUhC,EAAKiC,IAW/B3C,EAAMgD,mBAAqB,SAA4BzJ,GAEnD,OADAM,KAAKoJ,iBAAmB1J,EACjBM,MAWXmG,EAAM8C,oBAAsB,WACxB,OAAIjJ,KAAKiH,eAAe,qBACbjH,KAAKoJ,kBAapBjD,EAAMY,WAAa,WACf,OAAO/G,KAAK2I,UAAY3I,KAAK2I,QAAU,KAQ3CzC,EAAamD,WAAa,WAEtB,OADA5L,EAAQyI,aAAeE,EAChBF,GAIW,mBAAXxJ,GAAyBA,EAAO4M,IACvC5M,EAAO,WACH,OAAOwJ,IAGY,iBAAXpI,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAUyI,EAGjBzI,EAAQyI,aAAeA,EA5d9B,CA8dmB,oBAAXnI,OAAyBA,OAASiC,MAAQ,KAEjD,KAAK,GAAG,CAAC,IAz0BX","file":"admin-script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\nwindow.Boxzilla_Admin = require('./admin/_admin.js');\n\n},{\"./admin/_admin.js\":2}],2:[function(require,module,exports){\n\"use strict\";\n\n(function () {\n 'use strict';\n\n var $ = window.jQuery;\n\n var Option = require('./_option.js');\n\n var optionControls = document.getElementById('boxzilla-box-options-controls');\n var $optionControls = $(optionControls);\n var tnLoggedIn = document.createTextNode(' logged in'); // sanity check, are we on the correct page?\n\n if ($optionControls.length === 0) {\n return;\n }\n\n var EventEmitter = require('wolfy87-eventemitter');\n\n var events = new EventEmitter();\n\n var Designer = require('./_designer.js')($, Option, events);\n\n var rowTemplate = wp.template('rule-row-template');\n var i18n = boxzilla_i18n;\n var ruleComparisonEl = document.getElementById('boxzilla-rule-comparison');\n var rulesContainerEl = document.getElementById('boxzilla-box-rules'); // events\n\n $optionControls.on('click', \".boxzilla-add-rule\", addRuleFields);\n $optionControls.on('click', \".boxzilla-remove-rule\", removeRule);\n $optionControls.on('change', \".boxzilla-rule-condition\", setContextualHelpers);\n $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);\n $(ruleComparisonEl).change(toggleAndOrTexts);\n $(window).load(function () {\n if (typeof window.tinyMCE === \"undefined\") {\n document.getElementById('notice-notinymce').style.display = '';\n }\n }); // call contextual helper method for each row\n\n $('.boxzilla-rule-row').each(setContextualHelpers);\n\n function toggleAndOrTexts() {\n var newText = ruleComparisonEl.value === 'any' ? i18n.or : i18n.and;\n $('.boxzilla-andor').text(newText);\n }\n\n function toggleTriggerOptions() {\n $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');\n }\n\n function removeRule() {\n var row = $(this).parents('tr'); // delete andor row\n\n row.prev().remove(); // delete rule row\n\n row.remove();\n }\n\n function setContextualHelpers() {\n var context = this.tagName.toLowerCase() === \"tr\" ? this : $(this).parents('tr').get(0);\n var condition = context.querySelector('.boxzilla-rule-condition').value;\n var valueInput = context.querySelector('.boxzilla-rule-value');\n var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n var betterInput = valueInput.cloneNode(true);\n var $betterInput = $(betterInput); // remove previously added helpers\n\n $(context.querySelectorAll('.boxzilla-helper')).remove(); // prepare better input\n\n betterInput.removeAttribute('name');\n betterInput.className = betterInput.className + ' boxzilla-helper';\n valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);\n $betterInput.change(function () {\n valueInput.value = this.value;\n });\n betterInput.style.display = '';\n valueInput.style.display = 'none';\n qualifierInput.style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = 'none';\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = 'none';\n\n if (tnLoggedIn.parentNode) {\n tnLoggedIn.parentNode.removeChild(tnLoggedIn);\n } // change placeholder for textual help\n\n\n switch (condition) {\n default:\n betterInput.placeholder = i18n.enterCommaSeparatedValues;\n break;\n\n case '':\n case 'everywhere':\n qualifierInput.value = '1';\n valueInput.value = '';\n betterInput.style.display = 'none';\n qualifierInput.style.display = 'none';\n break;\n\n case 'is_single':\n case 'is_post':\n betterInput.placeholder = i18n.enterCommaSeparatedPosts;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_page':\n betterInput.placeholder = i18n.enterCommaSeparatedPages;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_type':\n betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_url':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n break;\n\n case 'is_post_in_category':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_with_tag':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_user_logged_in':\n betterInput.style.display = 'none';\n valueInput.parentNode.insertBefore(tnLoggedIn, valueInput.nextSibling);\n break;\n\n case 'is_referer':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n break;\n }\n }\n\n function addRuleFields() {\n var data = {\n 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length,\n 'andor': ruleComparisonEl.value === 'any' ? i18n.or : i18n.and\n };\n var html = rowTemplate(data);\n $(rulesContainerEl).append(html);\n return false;\n }\n\n module.exports = {\n 'Designer': Designer,\n 'Option': Option,\n 'events': events\n };\n})();\n\n},{\"./_designer.js\":3,\"./_option.js\":4,\"wolfy87-eventemitter\":5}],3:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Designer = function Designer($, Option, events) {\n // vars\n var boxId = document.getElementById('post_ID').value || 0,\n $editor,\n $editorFrame,\n $innerEditor,\n options = {},\n visualEditorInitialised = false;\n var $appearanceControls = $(\"#boxzilla-box-appearance-controls\"); // create Option objects\n\n options.borderColor = new Option('border-color');\n options.borderWidth = new Option('border-width');\n options.borderStyle = new Option('border-style');\n options.backgroundColor = new Option('background-color');\n options.width = new Option('width');\n options.color = new Option('color'); // functions\n\n function init() {\n // Only run if TinyMCE has actually inited\n if (_typeof(window.tinyMCE) !== \"object\" || tinyMCE.get('content') === null) {\n return;\n } // add classes to TinyMCE <html>\n\n\n $editorFrame = $(\"#content_ifr\");\n $editor = $editorFrame.contents().find('html');\n $editor.css({\n 'background': 'white'\n }); // add content class and padding to TinyMCE <body>\n\n $innerEditor = $editor.find('#tinymce');\n $innerEditor.addClass('boxzilla boxzilla-' + boxId);\n $innerEditor.css({\n 'margin': 0,\n 'background': 'white',\n 'display': 'inline-block',\n 'width': 'auto',\n 'min-width': '240px',\n 'position': 'relative'\n });\n $innerEditor.get(0).style.cssText += ';padding: 25px !important;';\n visualEditorInitialised = true;\n /* @since 2.0.3 */\n\n events.trigger('editor.init');\n }\n /**\n * Applies the styles from the options to the TinyMCE Editor\n *\n * @return bool\n */\n\n\n function applyStyles() {\n if (!visualEditorInitialised) {\n return false;\n } // Apply styles from CSS editor. \n // Use short timeout to make sure color values are updated.\n\n\n window.setTimeout(function () {\n $innerEditor.css({\n 'border-color': options.borderColor.getColorValue(),\n //getColorValue( 'borderColor', '' ),\n 'border-width': options.borderWidth.getPxValue(),\n //getPxValue( 'borderWidth', '' ),\n 'border-style': options.borderStyle.getValue(),\n //getValue('borderStyle', '' ),\n 'background-color': options.backgroundColor.getColorValue(),\n //getColorValue( 'backgroundColor', ''),\n 'width': options.width.getPxValue(),\n //getPxValue( 'width', 'auto' ),\n 'color': options.color.getColorValue() // getColorValue( 'color', '' )\n\n });\n /* @since 2.0.3 */\n\n events.trigger('editor.styles.apply');\n }, 10);\n return true;\n }\n\n function resetStyles() {\n for (var key in options) {\n if (key.substring(0, 5) === 'theme') {\n continue;\n }\n\n options[key].clear();\n }\n\n applyStyles();\n /* @since 2.0.3 */\n\n events.trigger('editor.styles.reset');\n } // event binders\n\n\n $appearanceControls.find('input.boxzilla-color-field').wpColorPicker({\n change: applyStyles,\n clear: applyStyles\n });\n $appearanceControls.find(\":input\").not(\".boxzilla-color-field\").change(applyStyles);\n events.on('editor.init', applyStyles); // public methods\n\n return {\n 'init': init,\n 'resetStyles': resetStyles,\n 'options': options\n };\n};\n\nmodule.exports = Designer;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\n\nvar Option = function Option(element) {\n // find corresponding element\n if (typeof element == \"string\") {\n element = document.getElementById('boxzilla-' + element);\n }\n\n if (!element) {\n console.error(\"Unable to find option element.\");\n }\n\n this.element = element;\n};\n\nOption.prototype.getColorValue = function () {\n if (this.element.value.length > 0) {\n if ($(this.element).hasClass('wp-color-field')) {\n return $(this.element).wpColorPicker('color');\n } else {\n return this.element.value;\n }\n }\n\n return '';\n};\n\nOption.prototype.getPxValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return parseInt(this.element.value) + \"px\";\n }\n\n return fallbackValue || '';\n};\n\nOption.prototype.getValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return this.element.value;\n }\n\n return fallbackValue || '';\n};\n\nOption.prototype.clear = function () {\n this.element.value = '';\n};\n\nOption.prototype.setValue = function (value) {\n this.element.value = value;\n};\n\nmodule.exports = Option;\n\n},{}],5:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.5 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n; })();"]}
1
+ {"version":3,"sources":["admin-script.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","window","Boxzilla_Admin","./admin/_admin.js","2","$","jQuery","Option","optionControls","document","getElementById","$optionControls","tnLoggedIn","createTextNode","events","Designer","rowTemplate","wp","template","i18n","boxzilla_i18n","ruleComparisonEl","rulesContainerEl","on","data","key","querySelectorAll","andor","value","or","and","html","append","row","this","parents","prev","remove","setContextualHelpers","find","toggle","change","newText","text","load","tinyMCE","style","display","each","context","tagName","toLowerCase","get","condition","querySelector","valueInput","qualifierInput","betterInput","cloneNode","$betterInput","removeAttribute","className","parentNode","insertBefore","nextSibling","removeChild","placeholder","enterCommaSeparatedValues","enterCommaSeparatedPosts","suggest","ajaxurl","multiple","multipleSep","enterCommaSeparatedPages","enterCommaSeparatedPostTypes","enterCommaSeparatedRelativeUrls","./_designer.js","./_option.js","wolfy87-eventemitter","3","_typeof","obj","Symbol","iterator","constructor","prototype","$editor","$editorFrame","$innerEditor","boxId","options","visualEditorInitialised","$appearanceControls","applyStyles","setTimeout","css","border-color","borderColor","getColorValue","border-width","borderWidth","getPxValue","border-style","borderStyle","getValue","background-color","backgroundColor","width","color","trigger","wpColorPicker","clear","not","init","contents","background","addClass","margin","min-width","position","cssText","resetStyles","substring","4","element","console","error","hasClass","fallbackValue","parseInt","setValue","5","EventEmitter","proto","originalGlobalValue","indexOfListener","listeners","listener","alias","name","apply","arguments","getListeners","evt","response","_getEvents","RegExp","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","isValidListener","TypeError","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","single","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA8EA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,GAAG,CAACQ,QAAQ,IAAIZ,EAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGQ,QAAQ,IAAI,IAAIL,GAAE,EAAoCH,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,IAAID,EAAED,EAAEE,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esContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\nwindow.Boxzilla_Admin = require('./admin/_admin.js');\n\n},{\"./admin/_admin.js\":2}],2:[function(require,module,exports){\n\"use strict\";\n\n(function () {\n 'use strict';\n\n var $ = window.jQuery;\n\n var Option = require('./_option.js');\n\n var optionControls = document.getElementById('boxzilla-box-options-controls');\n var $optionControls = $(optionControls);\n var tnLoggedIn = document.createTextNode(' logged in'); // sanity check, are we on the correct page?\n\n if ($optionControls.length === 0) {\n return;\n }\n\n var EventEmitter = require('wolfy87-eventemitter');\n\n var events = new EventEmitter();\n\n var Designer = require('./_designer.js')($, Option, events);\n\n var rowTemplate = wp.template('rule-row-template');\n var i18n = boxzilla_i18n;\n var ruleComparisonEl = document.getElementById('boxzilla-rule-comparison');\n var rulesContainerEl = document.getElementById('boxzilla-box-rules'); // events\n\n $optionControls.on('click', \".boxzilla-add-rule\", addRuleFields);\n $optionControls.on('click', \".boxzilla-remove-rule\", removeRule);\n $optionControls.on('change', \".boxzilla-rule-condition\", setContextualHelpers);\n $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);\n $(ruleComparisonEl).change(toggleAndOrTexts);\n $(window).load(function () {\n if (typeof window.tinyMCE === \"undefined\") {\n document.getElementById('notice-notinymce').style.display = '';\n }\n }); // call contextual helper method for each row\n\n $('.boxzilla-rule-row').each(setContextualHelpers);\n\n function toggleAndOrTexts() {\n var newText = ruleComparisonEl.value === 'any' ? i18n.or : i18n.and;\n $('.boxzilla-andor').text(newText);\n }\n\n function toggleTriggerOptions() {\n $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');\n }\n\n function removeRule() {\n var row = $(this).parents('tr'); // delete andor row\n\n row.prev().remove(); // delete rule row\n\n row.remove();\n }\n\n function setContextualHelpers() {\n var context = this.tagName.toLowerCase() === \"tr\" ? this : $(this).parents('tr').get(0);\n var condition = context.querySelector('.boxzilla-rule-condition').value;\n var valueInput = context.querySelector('.boxzilla-rule-value');\n var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n var betterInput = valueInput.cloneNode(true);\n var $betterInput = $(betterInput); // remove previously added helpers\n\n $(context.querySelectorAll('.boxzilla-helper')).remove(); // prepare better input\n\n betterInput.removeAttribute('name');\n betterInput.className = betterInput.className + ' boxzilla-helper';\n valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);\n $betterInput.change(function () {\n valueInput.value = this.value;\n });\n betterInput.style.display = '';\n valueInput.style.display = 'none';\n qualifierInput.style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = 'none';\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = 'none';\n\n if (tnLoggedIn.parentNode) {\n tnLoggedIn.parentNode.removeChild(tnLoggedIn);\n } // change placeholder for textual help\n\n\n switch (condition) {\n default:\n betterInput.placeholder = i18n.enterCommaSeparatedValues;\n break;\n\n case '':\n case 'everywhere':\n qualifierInput.value = '1';\n valueInput.value = '';\n betterInput.style.display = 'none';\n qualifierInput.style.display = 'none';\n break;\n\n case 'is_single':\n case 'is_post':\n betterInput.placeholder = i18n.enterCommaSeparatedPosts;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_page':\n betterInput.placeholder = i18n.enterCommaSeparatedPages;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_type':\n betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_url':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n break;\n\n case 'is_post_in_category':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_with_tag':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_user_logged_in':\n betterInput.style.display = 'none';\n valueInput.parentNode.insertBefore(tnLoggedIn, valueInput.nextSibling);\n break;\n\n case 'is_referer':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n break;\n }\n }\n\n function addRuleFields() {\n var data = {\n 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length,\n 'andor': ruleComparisonEl.value === 'any' ? i18n.or : i18n.and\n };\n var html = rowTemplate(data);\n $(rulesContainerEl).append(html);\n return false;\n }\n\n module.exports = {\n 'Designer': Designer,\n 'Option': Option,\n 'events': events\n };\n})();\n\n},{\"./_designer.js\":3,\"./_option.js\":4,\"wolfy87-eventemitter\":5}],3:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Designer = function Designer($, Option, events) {\n // vars\n var boxId = document.getElementById('post_ID').value || 0,\n $editor,\n $editorFrame,\n $innerEditor,\n options = {},\n visualEditorInitialised = false;\n var $appearanceControls = $(\"#boxzilla-box-appearance-controls\"); // create Option objects\n\n options.borderColor = new Option('border-color');\n options.borderWidth = new Option('border-width');\n options.borderStyle = new Option('border-style');\n options.backgroundColor = new Option('background-color');\n options.width = new Option('width');\n options.color = new Option('color'); // functions\n\n function init() {\n // Only run if TinyMCE has actually inited\n if (_typeof(window.tinyMCE) !== \"object\" || tinyMCE.get('content') === null) {\n return;\n } // add classes to TinyMCE <html>\n\n\n $editorFrame = $(\"#content_ifr\");\n $editor = $editorFrame.contents().find('html');\n $editor.css({\n 'background': 'white'\n }); // add content class and padding to TinyMCE <body>\n\n $innerEditor = $editor.find('#tinymce');\n $innerEditor.addClass('boxzilla boxzilla-' + boxId);\n $innerEditor.css({\n 'margin': 0,\n 'background': 'white',\n 'display': 'inline-block',\n 'width': 'auto',\n 'min-width': '240px',\n 'position': 'relative'\n });\n $innerEditor.get(0).style.cssText += ';padding: 25px !important;';\n visualEditorInitialised = true;\n /* @since 2.0.3 */\n\n events.trigger('editor.init');\n }\n /**\n * Applies the styles from the options to the TinyMCE Editor\n *\n * @return bool\n */\n\n\n function applyStyles() {\n if (!visualEditorInitialised) {\n return false;\n } // Apply styles from CSS editor. \n // Use short timeout to make sure color values are updated.\n\n\n window.setTimeout(function () {\n $innerEditor.css({\n 'border-color': options.borderColor.getColorValue(),\n //getColorValue( 'borderColor', '' ),\n 'border-width': options.borderWidth.getPxValue(),\n //getPxValue( 'borderWidth', '' ),\n 'border-style': options.borderStyle.getValue(),\n //getValue('borderStyle', '' ),\n 'background-color': options.backgroundColor.getColorValue(),\n //getColorValue( 'backgroundColor', ''),\n 'width': options.width.getPxValue(),\n //getPxValue( 'width', 'auto' ),\n 'color': options.color.getColorValue() // getColorValue( 'color', '' )\n\n });\n /* @since 2.0.3 */\n\n events.trigger('editor.styles.apply');\n }, 10);\n return true;\n }\n\n function resetStyles() {\n for (var key in options) {\n if (key.substring(0, 5) === 'theme') {\n continue;\n }\n\n options[key].clear();\n }\n\n applyStyles();\n /* @since 2.0.3 */\n\n events.trigger('editor.styles.reset');\n } // event binders\n\n\n $appearanceControls.find('input.boxzilla-color-field').wpColorPicker({\n change: applyStyles,\n clear: applyStyles\n });\n $appearanceControls.find(\":input\").not(\".boxzilla-color-field\").change(applyStyles);\n events.on('editor.init', applyStyles); // public methods\n\n return {\n 'init': init,\n 'resetStyles': resetStyles,\n 'options': options\n };\n};\n\nmodule.exports = Designer;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\n\nvar Option = function Option(element) {\n // find corresponding element\n if (typeof element == \"string\") {\n element = document.getElementById('boxzilla-' + element);\n }\n\n if (!element) {\n console.error(\"Unable to find option element.\");\n }\n\n this.element = element;\n};\n\nOption.prototype.getColorValue = function () {\n if (this.element.value.length > 0) {\n if ($(this.element).hasClass('wp-color-field')) {\n return $(this.element).wpColorPicker('color');\n } else {\n return this.element.value;\n }\n }\n\n return '';\n};\n\nOption.prototype.getPxValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return parseInt(this.element.value) + \"px\";\n }\n\n return fallbackValue || '';\n};\n\nOption.prototype.getValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return this.element.value;\n }\n\n return fallbackValue || '';\n};\n\nOption.prototype.clear = function () {\n this.element.value = '';\n};\n\nOption.prototype.setValue = function (value) {\n this.element.value = value;\n};\n\nmodule.exports = Option;\n\n},{}],5:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.6 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - https://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n; })();"]}
assets/js/script.js CHANGED
@@ -1,492 +1,148 @@
1
  (function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2
- /*!
3
- * EventEmitter v5.2.5 - git.io/ee
4
- * Unlicense - http://unlicense.org/
5
- * Oliver Caldwell - http://oli.me.uk/
6
- * @preserve
7
- */
8
 
9
- ;(function (exports) {
10
- 'use strict';
11
 
12
- /**
13
- * Class for managing events.
14
- * Can be extended to provide event functionality in other classes.
15
- *
16
- * @class EventEmitter Manages event registering and emitting.
17
- */
18
- function EventEmitter() {}
19
 
20
- // Shortcuts to improve speed and size
21
- var proto = EventEmitter.prototype;
22
- var originalGlobalValue = exports.EventEmitter;
23
 
24
- /**
25
- * Finds the index of the listener for the event in its storage array.
26
- *
27
- * @param {Function[]} listeners Array of listeners to search through.
28
- * @param {Function} listener Method to look for.
29
- * @return {Number} Index of the specified listener, -1 if not found
30
- * @api private
31
- */
32
- function indexOfListener(listeners, listener) {
33
- var i = listeners.length;
34
- while (i--) {
35
- if (listeners[i].listener === listener) {
36
- return i;
37
- }
38
- }
39
 
40
- return -1;
 
 
 
 
41
  }
42
 
43
- /**
44
- * Alias a method while keeping the context correct, to allow for overwriting of target method.
45
- *
46
- * @param {String} name The name of the target method.
47
- * @return {Function} The aliased method
48
- * @api private
49
- */
50
- function alias(name) {
51
- return function aliasClosure() {
52
- return this[name].apply(this, arguments);
53
- };
54
  }
55
 
56
- /**
57
- * Returns the listener array for the specified event.
58
- * Will initialise the event object and listener arrays if required.
59
- * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
60
- * Each property in the object response is an array of listener functions.
61
- *
62
- * @param {String|RegExp} evt Name of the event to return the listeners from.
63
- * @return {Function[]|Object} All listener functions for the event.
64
- */
65
- proto.getListeners = function getListeners(evt) {
66
- var events = this._getEvents();
67
- var response;
68
- var key;
69
 
70
- // Return a concatenated array of all matching events if
71
- // the selector is a regular expression.
72
- if (evt instanceof RegExp) {
73
- response = {};
74
- for (key in events) {
75
- if (events.hasOwnProperty(key) && evt.test(key)) {
76
- response[key] = events[key];
77
- }
78
- }
79
- }
80
- else {
81
- response = events[evt] || (events[evt] = []);
82
- }
83
 
84
- return response;
85
- };
 
86
 
87
- /**
88
- * Takes a list of listener objects and flattens it into a list of listener functions.
89
- *
90
- * @param {Object[]} listeners Raw listener objects.
91
- * @return {Function[]} Just the listener functions.
92
- */
93
- proto.flattenListeners = function flattenListeners(listeners) {
94
- var flatListeners = [];
95
- var i;
96
 
97
- for (i = 0; i < listeners.length; i += 1) {
98
- flatListeners.push(listeners[i].listener);
99
- }
 
 
100
 
101
- return flatListeners;
102
- };
103
 
104
- /**
105
- * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
106
- *
107
- * @param {String|RegExp} evt Name of the event to return the listeners from.
108
- * @return {Object} All listener functions for an event in an object.
109
- */
110
- proto.getListenersAsObject = function getListenersAsObject(evt) {
111
- var listeners = this.getListeners(evt);
112
- var response;
113
 
114
- if (listeners instanceof Array) {
115
- response = {};
116
- response[evt] = listeners;
117
- }
118
 
119
- return response || listeners;
120
- };
 
121
 
122
- function isValidListener (listener) {
123
- if (typeof listener === 'function' || listener instanceof RegExp) {
124
- return true
125
- } else if (listener && typeof listener === 'object') {
126
- return isValidListener(listener.listener)
127
- } else {
128
- return false
129
- }
130
- }
131
 
132
- /**
133
- * Adds a listener function to the specified event.
134
- * The listener will not be added if it is a duplicate.
135
- * If the listener returns true then it will be removed after it is called.
136
- * If you pass a regular expression as the event name then the listener will be added to all events that match it.
137
- *
138
- * @param {String|RegExp} evt Name of the event to attach the listener to.
139
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
140
- * @return {Object} Current instance of EventEmitter for chaining.
141
- */
142
- proto.addListener = function addListener(evt, listener) {
143
- if (!isValidListener(listener)) {
144
- throw new TypeError('listener must be a function');
145
- }
146
 
147
- var listeners = this.getListenersAsObject(evt);
148
- var listenerIsWrapped = typeof listener === 'object';
149
- var key;
150
 
151
- for (key in listeners) {
152
- if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
153
- listeners[key].push(listenerIsWrapped ? listener : {
154
- listener: listener,
155
- once: false
156
- });
157
- }
158
- }
159
 
160
- return this;
161
- };
162
 
163
- /**
164
- * Alias of addListener
165
- */
166
- proto.on = alias('addListener');
167
 
168
- /**
169
- * Semi-alias of addListener. It will add a listener that will be
170
- * automatically removed after its first execution.
171
- *
172
- * @param {String|RegExp} evt Name of the event to attach the listener to.
173
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
174
- * @return {Object} Current instance of EventEmitter for chaining.
175
- */
176
- proto.addOnceListener = function addOnceListener(evt, listener) {
177
- return this.addListener(evt, {
178
- listener: listener,
179
- once: true
180
- });
181
- };
182
 
183
- /**
184
- * Alias of addOnceListener.
185
- */
186
- proto.once = alias('addOnceListener');
187
 
188
- /**
189
- * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
190
- * You need to tell it what event names should be matched by a regex.
191
- *
192
- * @param {String} evt Name of the event to create.
193
- * @return {Object} Current instance of EventEmitter for chaining.
194
- */
195
- proto.defineEvent = function defineEvent(evt) {
196
- this.getListeners(evt);
197
- return this;
198
- };
199
 
200
- /**
201
- * Uses defineEvent to define multiple events.
202
- *
203
- * @param {String[]} evts An array of event names to define.
204
- * @return {Object} Current instance of EventEmitter for chaining.
205
- */
206
- proto.defineEvents = function defineEvents(evts) {
207
- for (var i = 0; i < evts.length; i += 1) {
208
- this.defineEvent(evts[i]);
209
- }
210
- return this;
211
- };
212
 
213
- /**
214
- * Removes a listener function from the specified event.
215
- * When passed a regular expression as the event name, it will remove the listener from all events that match it.
216
- *
217
- * @param {String|RegExp} evt Name of the event to remove the listener from.
218
- * @param {Function} listener Method to remove from the event.
219
- * @return {Object} Current instance of EventEmitter for chaining.
220
- */
221
- proto.removeListener = function removeListener(evt, listener) {
222
- var listeners = this.getListenersAsObject(evt);
223
- var index;
224
- var key;
225
 
226
- for (key in listeners) {
227
- if (listeners.hasOwnProperty(key)) {
228
- index = indexOfListener(listeners[key], listener);
229
 
230
- if (index !== -1) {
231
- listeners[key].splice(index, 1);
232
- }
233
- }
234
- }
235
 
236
- return this;
237
- };
238
-
239
- /**
240
- * Alias of removeListener
241
- */
242
- proto.off = alias('removeListener');
243
 
244
- /**
245
- * Adds listeners in bulk using the manipulateListeners method.
246
- * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
247
- * You can also pass it a regular expression to add the array of listeners to all events that match it.
248
- * Yeah, this function does quite a bit. That's probably a bad thing.
249
- *
250
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
251
- * @param {Function[]} [listeners] An optional array of listener functions to add.
252
- * @return {Object} Current instance of EventEmitter for chaining.
253
- */
254
- proto.addListeners = function addListeners(evt, listeners) {
255
- // Pass through to manipulateListeners
256
- return this.manipulateListeners(false, evt, listeners);
257
- };
258
-
259
- /**
260
- * Removes listeners in bulk using the manipulateListeners method.
261
- * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
262
- * You can also pass it an event name and an array of listeners to be removed.
263
- * You can also pass it a regular expression to remove the listeners from all events that match it.
264
- *
265
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
266
- * @param {Function[]} [listeners] An optional array of listener functions to remove.
267
- * @return {Object} Current instance of EventEmitter for chaining.
268
- */
269
- proto.removeListeners = function removeListeners(evt, listeners) {
270
- // Pass through to manipulateListeners
271
- return this.manipulateListeners(true, evt, listeners);
272
- };
273
-
274
- /**
275
- * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
276
- * The first argument will determine if the listeners are removed (true) or added (false).
277
- * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
278
- * You can also pass it an event name and an array of listeners to be added/removed.
279
- * You can also pass it a regular expression to manipulate the listeners of all events that match it.
280
- *
281
- * @param {Boolean} remove True if you want to remove listeners, false if you want to add.
282
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
283
- * @param {Function[]} [listeners] An optional array of listener functions to add/remove.
284
- * @return {Object} Current instance of EventEmitter for chaining.
285
- */
286
- proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
287
- var i;
288
- var value;
289
- var single = remove ? this.removeListener : this.addListener;
290
- var multiple = remove ? this.removeListeners : this.addListeners;
291
-
292
- // If evt is an object then pass each of its properties to this method
293
- if (typeof evt === 'object' && !(evt instanceof RegExp)) {
294
- for (i in evt) {
295
- if (evt.hasOwnProperty(i) && (value = evt[i])) {
296
- // Pass the single listener straight through to the singular method
297
- if (typeof value === 'function') {
298
- single.call(this, i, value);
299
- }
300
- else {
301
- // Otherwise pass back to the multiple function
302
- multiple.call(this, i, value);
303
- }
304
- }
305
- }
306
- }
307
- else {
308
- // So evt must be a string
309
- // And listeners must be an array of listeners
310
- // Loop over it and pass each one to the multiple method
311
- i = listeners.length;
312
- while (i--) {
313
- single.call(this, evt, listeners[i]);
314
- }
315
- }
316
-
317
- return this;
318
- };
319
-
320
- /**
321
- * Removes all listeners from a specified event.
322
- * If you do not specify an event then all listeners will be removed.
323
- * That means every event will be emptied.
324
- * You can also pass a regex to remove all events that match it.
325
- *
326
- * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
327
- * @return {Object} Current instance of EventEmitter for chaining.
328
- */
329
- proto.removeEvent = function removeEvent(evt) {
330
- var type = typeof evt;
331
- var events = this._getEvents();
332
- var key;
333
-
334
- // Remove different things depending on the state of evt
335
- if (type === 'string') {
336
- // Remove all listeners for the specified event
337
- delete events[evt];
338
- }
339
- else if (evt instanceof RegExp) {
340
- // Remove all events matching the regex.
341
- for (key in events) {
342
- if (events.hasOwnProperty(key) && evt.test(key)) {
343
- delete events[key];
344
- }
345
- }
346
- }
347
- else {
348
- // Remove all listeners in all events
349
- delete this._events;
350
- }
351
-
352
- return this;
353
- };
354
 
355
- /**
356
- * Alias of removeEvent.
357
- *
358
- * Added to mirror the node API.
359
- */
360
- proto.removeAllListeners = alias('removeEvent');
361
 
362
- /**
363
- * Emits an event of your choice.
364
- * When emitted, every listener attached to that event will be executed.
365
- * If you pass the optional argument array then those arguments will be passed to every listener upon execution.
366
- * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
367
- * So they will not arrive within the array on the other side, they will be separate.
368
- * You can also pass a regular expression to emit to all events that match it.
369
- *
370
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
371
- * @param {Array} [args] Optional array of arguments to be passed to each listener.
372
- * @return {Object} Current instance of EventEmitter for chaining.
373
- */
374
- proto.emitEvent = function emitEvent(evt, args) {
375
- var listenersMap = this.getListenersAsObject(evt);
376
- var listeners;
377
- var listener;
378
- var i;
379
- var key;
380
- var response;
381
 
382
- for (key in listenersMap) {
383
- if (listenersMap.hasOwnProperty(key)) {
384
- listeners = listenersMap[key].slice(0);
 
 
385
 
386
- for (i = 0; i < listeners.length; i++) {
387
- // If the listener returns true then it shall be removed from the event
388
- // The function is executed either with a basic call or an apply if there is an args array
389
- listener = listeners[i];
390
 
391
- if (listener.once === true) {
392
- this.removeListener(evt, listener.listener);
393
- }
 
394
 
395
- response = listener.listener.apply(this, args || []);
 
396
 
397
- if (response === this._getOnceReturnValue()) {
398
- this.removeListener(evt, listener.listener);
399
- }
400
- }
401
- }
402
- }
403
 
404
- return this;
405
- };
406
 
407
- /**
408
- * Alias of emitEvent
409
- */
410
- proto.trigger = alias('emitEvent');
 
 
411
 
412
- /**
413
- * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
414
- * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
415
- *
416
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
417
- * @param {...*} Optional additional arguments to be passed to each listener.
418
- * @return {Object} Current instance of EventEmitter for chaining.
419
- */
420
- proto.emit = function emit(evt) {
421
- var args = Array.prototype.slice.call(arguments, 1);
422
- return this.emitEvent(evt, args);
423
- };
424
 
425
- /**
426
- * Sets the current value to check against when executing listeners. If a
427
- * listeners return value matches the one set here then it will be removed
428
- * after execution. This value defaults to true.
429
- *
430
- * @param {*} value The new value to check for when executing listeners.
431
- * @return {Object} Current instance of EventEmitter for chaining.
432
- */
433
- proto.setOnceReturnValue = function setOnceReturnValue(value) {
434
- this._onceReturnValue = value;
435
- return this;
436
- };
437
 
438
- /**
439
- * Fetches the current value to check against when executing listeners. If
440
- * the listeners return value matches this one then it should be removed
441
- * automatically. It will return true by default.
442
- *
443
- * @return {*|Boolean} The current value to check for or the default, true.
444
- * @api private
445
- */
446
- proto._getOnceReturnValue = function _getOnceReturnValue() {
447
- if (this.hasOwnProperty('_onceReturnValue')) {
448
- return this._onceReturnValue;
449
- }
450
- else {
451
- return true;
452
- }
453
- };
454
 
455
- /**
456
- * Fetches the events object and creates one if required.
457
- *
458
- * @return {Object} The events storage object.
459
- * @api private
460
- */
461
- proto._getEvents = function _getEvents() {
462
- return this._events || (this._events = {});
463
- };
464
 
465
- /**
466
- * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
467
- *
468
- * @return {Function} Non conflicting EventEmitter class.
469
- */
470
- EventEmitter.noConflict = function noConflict() {
471
- exports.EventEmitter = originalGlobalValue;
472
- return EventEmitter;
473
- };
474
 
475
- // Expose the class either via AMD, CommonJS or the global object
476
- if (typeof define === 'function' && define.amd) {
477
- define(function () {
478
- return EventEmitter;
479
- });
480
- }
481
- else if (typeof module === 'object' && module.exports){
482
- module.exports = EventEmitter;
483
- }
484
- else {
485
- exports.EventEmitter = EventEmitter;
486
- }
487
- }(typeof window !== 'undefined' ? window : this || {}));
488
 
489
- },{}],2:[function(require,module,exports){
490
  "use strict";
491
 
492
  var duration = 320;
@@ -739,7 +395,10 @@ Box.prototype.events = function () {
739
  var box = this; // attach event to "close" icon inside box
740
 
741
  if (this.closeIcon) {
742
- this.closeIcon.addEventListener('click', this.dismiss.bind(this));
 
 
 
743
  }
744
 
745
  this.element.addEventListener('click', function (e) {
@@ -816,12 +475,9 @@ Box.prototype.setCustomBoxStyling = function () {
816
  }; // toggle visibility of the box
817
 
818
 
819
- Box.prototype.toggle = function (show) {
820
- // revert visibility if no explicit argument is given
821
- if (typeof show === "undefined") {
822
- show = !this.visible;
823
- } // is box already at desired visibility?
824
-
825
 
826
  if (show === this.visible) {
827
  return false;
@@ -846,27 +502,37 @@ Box.prototype.toggle = function (show) {
846
 
847
  if (this.config.position === 'center') {
848
  this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');
849
- Animator.toggle(this.overlay, "fade");
850
- }
851
 
852
- Animator.toggle(this.element, this.config.animation, function () {
853
- if (this.visible) {
854
- return;
 
855
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
856
 
857
- this.contentElement.innerHTML = this.contentElement.innerHTML;
858
- }.bind(this));
859
  return true;
860
  }; // show the box
861
 
862
 
863
- Box.prototype.show = function () {
864
- return this.toggle(true);
865
  }; // hide the box
866
 
867
 
868
- Box.prototype.hide = function () {
869
- return this.toggle(false);
870
  }; // calculate trigger height
871
 
872
 
@@ -978,16 +644,14 @@ Box.prototype.trigger = function () {
978
  */
979
 
980
 
981
- Box.prototype.dismiss = function (e) {
982
- // prevent default action
983
- e && e.preventDefault(); // only dismiss box if it's currently open.
984
-
985
  if (!this.visible) {
986
  return false;
987
  } // hide box element
988
 
989
 
990
- this.hide(); // set cookie
991
 
992
  if (this.config.cookie && this.config.cookie.dismissed) {
993
  this.setCookie(this.config.cookie.dismissed);
@@ -1288,44 +952,44 @@ Boxzilla.get = function (id) {
1288
  }; // dismiss a single box (or all by omitting id param)
1289
 
1290
 
1291
- Boxzilla.dismiss = function (id) {
1292
  // if no id given, dismiss all current open boxes
1293
- if (typeof id === "undefined") {
 
 
1294
  boxes.forEach(function (box) {
1295
- box.dismiss();
1296
  });
1297
- } else {
1298
- Boxzilla.get(id).dismiss();
1299
  }
1300
  };
1301
 
1302
- Boxzilla.hide = function (id) {
1303
- if (typeof id === "undefined") {
 
 
1304
  boxes.forEach(function (box) {
1305
- box.hide();
1306
  });
1307
- } else {
1308
- Boxzilla.get(id).hide();
1309
  }
1310
  };
1311
 
1312
- Boxzilla.show = function (id) {
1313
- if (typeof id === "undefined") {
 
 
1314
  boxes.forEach(function (box) {
1315
- box.show();
1316
  });
1317
- } else {
1318
- Boxzilla.get(id).show();
1319
  }
1320
  };
1321
 
1322
- Boxzilla.toggle = function (id) {
1323
- if (typeof id === "undefined") {
 
 
1324
  boxes.forEach(function (box) {
1325
- box.toggle();
1326
  });
1327
- } else {
1328
- Boxzilla.get(id).toggle();
1329
  }
1330
  }; // expose each individual box.
1331
 
@@ -1338,7 +1002,7 @@ if (typeof module !== 'undefined' && module.exports) {
1338
  module.exports = Boxzilla;
1339
  }
1340
 
1341
- },{"./box.js":3,"./styles.js":5,"./timer.js":6,"./triggers/exit-intent.js":7,"wolfy87-eventemitter":1}],5:[function(require,module,exports){
1342
  "use strict";
1343
 
1344
  var styles = "#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}";
@@ -1392,201 +1056,549 @@ module.exports = function (callback) {
1392
  return;
1393
  }
1394
 
1395
- window.clearTimeout(timeout);
1396
- timeout = null;
1397
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1398
 
1399
- function onMouseEnter(evt) {
1400
- clearTimeout();
1401
- }
1402
 
1403
- function onMouseLeave(evt) {
1404
- clearTimeout(); // did mouse leave at top of window?
1405
- // add small exception space in the top-right corner
 
 
 
 
 
 
1406
 
1407
- if (evt.clientY <= 0 && evt.clientX < 0.80 * window.innerWidth) {
1408
- timeout = window.setTimeout(triggerCallback, 400);
1409
- }
1410
- }
1411
 
1412
- function onTouchStart(evt) {
1413
- clearTimeout();
1414
- touchStart = {
1415
- timestamp: performance.now(),
1416
- scrollY: window.scrollY,
1417
- windowHeight: window.innerHeight
1418
  };
1419
- }
1420
 
1421
- function onTouchEnd(evt) {
1422
- clearTimeout(); // did address bar appear?
 
 
 
 
 
 
 
1423
 
1424
- if (window.innerHeight > touchStart.windowHeight) {
1425
- return;
1426
- } // allow a tiny tiny margin for error, to not fire on clicks
 
1427
 
 
 
1428
 
1429
- if (window.scrollY + 20 >= touchStart.scrollY) {
1430
- return;
 
 
 
 
 
 
1431
  }
1432
 
1433
- if (performance.now() - touchStart.timestamp > 300) {
1434
- return;
1435
- }
 
 
 
 
 
 
 
 
 
 
 
1436
 
1437
- if (['A', 'INPUT', 'BUTTON'].indexOf(evt.target.tagName) > -1) {
1438
- return;
1439
- }
1440
 
1441
- timeout = window.setTimeout(triggerCallback, 800);
1442
- }
 
 
 
 
 
 
1443
 
1444
- window.addEventListener('touchstart', onTouchStart);
1445
- window.addEventListener('touchend', onTouchEnd);
1446
- document.documentElement.addEventListener('mouseenter', onMouseEnter);
1447
- document.documentElement.addEventListener('mouseleave', onMouseLeave);
1448
- document.documentElement.addEventListener('click', clearTimeout);
1449
- };
1450
 
1451
- },{}],8:[function(require,module,exports){
1452
- "use strict";
 
 
1453
 
1454
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
 
 
 
 
 
 
 
 
 
 
 
 
 
1455
 
1456
- (function () {
1457
- 'use strict';
 
 
1458
 
1459
- var Boxzilla = require('boxzilla');
 
 
 
 
 
 
 
 
 
 
1460
 
1461
- var options = window.boxzilla_options; // expose Boxzilla object to window
 
 
 
 
 
 
 
 
 
 
 
1462
 
1463
- window.Boxzilla = Boxzilla; // helper function for setting CSS styles
 
 
 
 
 
 
 
 
 
 
 
1464
 
1465
- function css(element, styles) {
1466
- if (styles.background_color) {
1467
- element.style.background = styles.background_color;
1468
- }
1469
 
1470
- if (styles.color) {
1471
- element.style.color = styles.color;
1472
- }
 
 
1473
 
1474
- if (styles.border_color) {
1475
- element.style.borderColor = styles.border_color;
1476
- }
1477
 
1478
- if (styles.border_width) {
1479
- element.style.borderWidth = parseInt(styles.border_width) + "px";
1480
- }
 
1481
 
1482
- if (styles.border_style) {
1483
- element.style.borderStyle = styles.border_style;
1484
- }
 
 
 
 
 
 
 
 
 
 
 
1485
 
1486
- if (styles.width) {
1487
- element.style.maxWidth = parseInt(styles.width) + "px";
1488
- }
1489
- }
 
 
 
 
 
 
 
 
 
 
1490
 
1491
- function createBoxesFromConfig() {
1492
- // failsafe against including script twice.
1493
- if (options.inited) {
1494
- return;
1495
- } // create boxes from options
 
 
 
 
 
 
 
 
 
 
 
 
1496
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1497
 
1498
- for (var key in options.boxes) {
1499
- // get opts
1500
- var boxOpts = options.boxes[key];
1501
- boxOpts.testMode = isLoggedIn && options.testMode; // find box content element, bail if not found
1502
 
1503
- var boxContentElement = document.getElementById('boxzilla-box-' + boxOpts.id + '-content');
 
 
 
 
 
 
 
 
 
 
 
 
1504
 
1505
- if (!boxContentElement) {
1506
- continue;
1507
- } // use element as content option
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1508
 
 
 
1509
 
1510
- boxOpts.content = boxContentElement; // create box
 
 
 
 
 
1511
 
1512
- var box = Boxzilla.create(boxOpts.id, boxOpts); // add box slug to box element as classname
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1513
 
1514
- box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug; // add custom css to box
 
 
1515
 
1516
- css(box.element, boxOpts.css);
1517
- box.element.firstChild.firstChild.className += " first-child";
1518
- box.element.firstChild.lastChild.className += " last-child"; // maybe show box right away
 
1519
 
1520
- if (box.fits() && locationHashRefersBox(box)) {
1521
- box.show();
1522
- }
1523
- } // set flag to prevent initialising twice
1524
 
 
1525
 
1526
- options.inited = true; // trigger "done" event.
 
 
 
 
 
1527
 
1528
- Boxzilla.trigger('done'); // maybe open box with MC4WP form in it
 
1529
 
1530
- maybeOpenMailChimpForWordPressBox();
1531
- }
 
 
1532
 
1533
- function locationHashRefersBox(box) {
1534
- if (!window.location.hash || 0 === window.location.hash.length) {
1535
- return false;
1536
- } // parse "boxzilla-{id}" from location hash
 
 
 
 
 
 
 
 
1537
 
 
 
 
 
 
 
 
 
 
 
 
 
1538
 
1539
- var match = window.location.hash.match(/[#&](boxzilla-\d+)/);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1540
 
1541
- if (!match || _typeof(match) !== "object" || match.length < 2) {
1542
- return false;
1543
- }
 
 
 
 
 
 
1544
 
1545
- var elementId = match[1];
 
 
 
 
 
 
 
 
1546
 
1547
- if (elementId === box.element.id) {
1548
- return true;
1549
- } else if (box.element.querySelector('#' + elementId)) {
1550
- return true;
 
1551
  }
1552
-
1553
- return false;
1554
- }
1555
-
1556
- function maybeOpenMailChimpForWordPressBox() {
1557
- if (_typeof(window.mc4wp_forms_config) !== "object" || !window.mc4wp_forms_config.submitted_form) {
1558
- return;
1559
  }
1560
-
1561
- var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;
1562
- var boxes = Boxzilla.boxes;
1563
-
1564
- for (var boxId in boxes) {
1565
- if (!boxes.hasOwnProperty(boxId)) {
1566
- continue;
1567
- }
1568
-
1569
- var box = boxes[boxId];
1570
-
1571
- if (box.element.querySelector(selector)) {
1572
- box.show();
1573
- return;
1574
- }
1575
  }
1576
- } // print message when test mode is enabled
1577
-
1578
-
1579
- var isLoggedIn = document.body.className.indexOf('logged-in') > -1;
1580
-
1581
- if (isLoggedIn && options.testMode) {
1582
- console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\'re done testing.');
1583
- } // init boxzilla
1584
-
1585
-
1586
- Boxzilla.init(); // on window.load, create DOM elements for boxes
1587
-
1588
- window.addEventListener('load', createBoxesFromConfig);
1589
- })();
1590
 
1591
- },{"boxzilla":4}]},{},[8]);
1592
  ; })();
1
  (function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2
+ "use strict";
 
 
 
 
 
3
 
4
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
 
5
 
6
+ (function () {
7
+ 'use strict';
 
 
 
 
 
8
 
9
+ var Boxzilla = require('boxzilla');
 
 
10
 
11
+ var options = window.boxzilla_options; // expose Boxzilla object to window
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
+ window.Boxzilla = Boxzilla; // helper function for setting CSS styles
14
+
15
+ function css(element, styles) {
16
+ if (styles.background_color) {
17
+ element.style.background = styles.background_color;
18
  }
19
 
20
+ if (styles.color) {
21
+ element.style.color = styles.color;
 
 
 
 
 
 
 
 
 
22
  }
23
 
24
+ if (styles.border_color) {
25
+ element.style.borderColor = styles.border_color;
26
+ }
 
 
 
 
 
 
 
 
 
 
27
 
28
+ if (styles.border_width) {
29
+ element.style.borderWidth = parseInt(styles.border_width) + "px";
30
+ }
 
 
 
 
 
 
 
 
 
 
31
 
32
+ if (styles.border_style) {
33
+ element.style.borderStyle = styles.border_style;
34
+ }
35
 
36
+ if (styles.width) {
37
+ element.style.maxWidth = parseInt(styles.width) + "px";
38
+ }
39
+ }
 
 
 
 
 
40
 
41
+ function createBoxesFromConfig() {
42
+ // failsafe against including script twice.
43
+ if (options.inited) {
44
+ return;
45
+ } // create boxes from options
46
 
 
 
47
 
48
+ for (var key in options.boxes) {
49
+ // get opts
50
+ var boxOpts = options.boxes[key];
51
+ boxOpts.testMode = isLoggedIn && options.testMode; // find box content element, bail if not found
 
 
 
 
 
52
 
53
+ var boxContentElement = document.getElementById('boxzilla-box-' + boxOpts.id + '-content');
 
 
 
54
 
55
+ if (!boxContentElement) {
56
+ continue;
57
+ } // use element as content option
58
 
 
 
 
 
 
 
 
 
 
59
 
60
+ boxOpts.content = boxContentElement; // create box
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
+ var box = Boxzilla.create(boxOpts.id, boxOpts); // add box slug to box element as classname
 
 
63
 
64
+ box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug; // add custom css to box
 
 
 
 
 
 
 
65
 
66
+ css(box.element, boxOpts.css);
 
67
 
68
+ try {
69
+ box.element.firstChild.firstChild.className += " first-child";
70
+ box.element.firstChild.lastChild.className += " last-child";
71
+ } catch (e) {} // maybe show box right away
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
+ if (box.fits() && locationHashRefersBox(box)) {
75
+ box.show();
76
+ }
77
+ } // set flag to prevent initialising twice
78
 
 
 
 
 
 
 
 
 
 
 
 
79
 
80
+ options.inited = true; // trigger "done" event.
 
 
 
 
 
 
 
 
 
 
 
81
 
82
+ Boxzilla.trigger('done'); // maybe open box with MC4WP form in it
 
 
 
 
 
 
 
 
 
 
 
83
 
84
+ maybeOpenMailChimpForWordPressBox();
85
+ }
 
86
 
87
+ function locationHashRefersBox(box) {
88
+ if (!window.location.hash || 0 === window.location.hash.length) {
89
+ return false;
90
+ } // parse "boxzilla-{id}" from location hash
 
91
 
 
 
 
 
 
 
 
92
 
93
+ var match = window.location.hash.match(/[#&](boxzilla-\d+)/);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
 
95
+ if (!match || _typeof(match) !== "object" || match.length < 2) {
96
+ return false;
97
+ }
 
 
 
98
 
99
+ var elementId = match[1];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
+ if (elementId === box.element.id) {
102
+ return true;
103
+ } else if (box.element.querySelector('#' + elementId)) {
104
+ return true;
105
+ }
106
 
107
+ return false;
108
+ }
 
 
109
 
110
+ function maybeOpenMailChimpForWordPressBox() {
111
+ if (_typeof(window.mc4wp_forms_config) !== "object" || !window.mc4wp_forms_config.submitted_form) {
112
+ return;
113
+ }
114
 
115
+ var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;
116
+ var boxes = Boxzilla.boxes;
117
 
118
+ for (var boxId in boxes) {
119
+ if (!boxes.hasOwnProperty(boxId)) {
120
+ continue;
121
+ }
 
 
122
 
123
+ var box = boxes[boxId];
 
124
 
125
+ if (box.element.querySelector(selector)) {
126
+ box.show();
127
+ return;
128
+ }
129
+ }
130
+ } // print message when test mode is enabled
131
 
 
 
 
 
 
 
 
 
 
 
 
 
132
 
133
+ var isLoggedIn = document.body.className.indexOf('logged-in') > -1;
 
 
 
 
 
 
 
 
 
 
 
134
 
135
+ if (isLoggedIn && options.testMode) {
136
+ console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\'re done testing.');
137
+ } // init boxzilla
 
 
 
 
 
 
 
 
 
 
 
 
 
138
 
 
 
 
 
 
 
 
 
 
139
 
140
+ Boxzilla.init(); // on window.load, create DOM elements for boxes
 
 
 
 
 
 
 
 
141
 
142
+ window.addEventListener('load', createBoxesFromConfig);
143
+ })();
 
 
 
 
 
 
 
 
 
 
 
144
 
145
+ },{"boxzilla":4}],2:[function(require,module,exports){
146
  "use strict";
147
 
148
  var duration = 320;
395
  var box = this; // attach event to "close" icon inside box
396
 
397
  if (this.closeIcon) {
398
+ this.closeIcon.addEventListener('click', function (e) {
399
+ e.preventDefault();
400
+ box.dismiss();
401
+ });
402
  }
403
 
404
  this.element.addEventListener('click', function (e) {
475
  }; // toggle visibility of the box
476
 
477
 
478
+ Box.prototype.toggle = function (show, animate) {
479
+ show = typeof show === "undefined" ? !this.visible : show;
480
+ animate = typeof animate === "undefined" ? true : animate; // is box already at desired visibility?
 
 
 
481
 
482
  if (show === this.visible) {
483
  return false;
502
 
503
  if (this.config.position === 'center') {
504
  this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');
 
 
505
 
506
+ if (animate) {
507
+ Animator.toggle(this.overlay, "fade");
508
+ } else {
509
+ this.overlay.style.display = show ? '' : 'none';
510
  }
511
+ }
512
+
513
+ if (animate) {
514
+ Animator.toggle(this.element, this.config.animation, function () {
515
+ if (this.visible) {
516
+ return;
517
+ }
518
+
519
+ this.contentElement.innerHTML = this.contentElement.innerHTML;
520
+ }.bind(this));
521
+ } else {
522
+ this.element.style.display = show ? '' : 'none';
523
+ }
524
 
 
 
525
  return true;
526
  }; // show the box
527
 
528
 
529
+ Box.prototype.show = function (animate) {
530
+ return this.toggle(true, animate);
531
  }; // hide the box
532
 
533
 
534
+ Box.prototype.hide = function (animate) {
535
+ return this.toggle(false, animate);
536
  }; // calculate trigger height
537
 
538
 
644
  */
645
 
646
 
647
+ Box.prototype.dismiss = function (animate) {
648
+ // only dismiss box if it's currently open.
 
 
649
  if (!this.visible) {
650
  return false;
651
  } // hide box element
652
 
653
 
654
+ this.hide(animate); // set cookie
655
 
656
  if (this.config.cookie && this.config.cookie.dismissed) {
657
  this.setCookie(this.config.cookie.dismissed);
952
  }; // dismiss a single box (or all by omitting id param)
953
 
954
 
955
+ Boxzilla.dismiss = function (id, animate) {
956
  // if no id given, dismiss all current open boxes
957
+ if (id) {
958
+ Boxzilla.get(id).dismiss(animate);
959
+ } else {
960
  boxes.forEach(function (box) {
961
+ box.dismiss(animate);
962
  });
 
 
963
  }
964
  };
965
 
966
+ Boxzilla.hide = function (id, animate) {
967
+ if (id) {
968
+ Boxzilla.get(id).hide(animate);
969
+ } else {
970
  boxes.forEach(function (box) {
971
+ box.hide(animate);
972
  });
 
 
973
  }
974
  };
975
 
976
+ Boxzilla.show = function (id, animate) {
977
+ if (id) {
978
+ Boxzilla.get(id).show(animate);
979
+ } else {
980
  boxes.forEach(function (box) {
981
+ box.show(animate);
982
  });
 
 
983
  }
984
  };
985
 
986
+ Boxzilla.toggle = function (id, animate) {
987
+ if (id) {
988
+ Boxzilla.get(id).toggle(animate);
989
+ } else {
990
  boxes.forEach(function (box) {
991
+ box.toggle(animate);
992
  });
 
 
993
  }
994
  }; // expose each individual box.
995
 
1002
  module.exports = Boxzilla;
1003
  }
1004
 
1005
+ },{"./box.js":3,"./styles.js":5,"./timer.js":6,"./triggers/exit-intent.js":7,"wolfy87-eventemitter":8}],5:[function(require,module,exports){
1006
  "use strict";
1007
 
1008
  var styles = "#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}";
1056
  return;
1057
  }
1058
 
1059
+ window.clearTimeout(timeout);
1060
+ timeout = null;
1061
+ }
1062
+
1063
+ function onMouseEnter(evt) {
1064
+ clearTimeout();
1065
+ }
1066
+
1067
+ function onMouseLeave(evt) {
1068
+ clearTimeout(); // did mouse leave at top of window?
1069
+ // add small exception space in the top-right corner
1070
+
1071
+ if (evt.clientY <= 0 && evt.clientX < 0.80 * window.innerWidth) {
1072
+ timeout = window.setTimeout(triggerCallback, 400);
1073
+ }
1074
+ }
1075
+
1076
+ function onTouchStart(evt) {
1077
+ clearTimeout();
1078
+ touchStart = {
1079
+ timestamp: performance.now(),
1080
+ scrollY: window.scrollY,
1081
+ windowHeight: window.innerHeight
1082
+ };
1083
+ }
1084
+
1085
+ function onTouchEnd(evt) {
1086
+ clearTimeout(); // did address bar appear?
1087
+
1088
+ if (window.innerHeight > touchStart.windowHeight) {
1089
+ return;
1090
+ } // allow a tiny tiny margin for error, to not fire on clicks
1091
+
1092
+
1093
+ if (window.scrollY + 20 >= touchStart.scrollY) {
1094
+ return;
1095
+ }
1096
+
1097
+ if (performance.now() - touchStart.timestamp > 300) {
1098
+ return;
1099
+ }
1100
+
1101
+ if (['A', 'INPUT', 'BUTTON'].indexOf(evt.target.tagName) > -1) {
1102
+ return;
1103
+ }
1104
+
1105
+ timeout = window.setTimeout(triggerCallback, 800);
1106
+ }
1107
+
1108
+ window.addEventListener('touchstart', onTouchStart);
1109
+ window.addEventListener('touchend', onTouchEnd);
1110
+ document.documentElement.addEventListener('mouseenter', onMouseEnter);
1111
+ document.documentElement.addEventListener('mouseleave', onMouseLeave);
1112
+ document.documentElement.addEventListener('click', clearTimeout);
1113
+ };
1114
+
1115
+ },{}],8:[function(require,module,exports){
1116
+ /*!
1117
+ * EventEmitter v5.2.6 - git.io/ee
1118
+ * Unlicense - http://unlicense.org/
1119
+ * Oliver Caldwell - https://oli.me.uk/
1120
+ * @preserve
1121
+ */
1122
+
1123
+ ;(function (exports) {
1124
+ 'use strict';
1125
+
1126
+ /**
1127
+ * Class for managing events.
1128
+ * Can be extended to provide event functionality in other classes.
1129
+ *
1130
+ * @class EventEmitter Manages event registering and emitting.
1131
+ */
1132
+ function EventEmitter() {}
1133
+
1134
+ // Shortcuts to improve speed and size
1135
+ var proto = EventEmitter.prototype;
1136
+ var originalGlobalValue = exports.EventEmitter;
1137
+
1138
+ /**
1139
+ * Finds the index of the listener for the event in its storage array.
1140
+ *
1141
+ * @param {Function[]} listeners Array of listeners to search through.
1142
+ * @param {Function} listener Method to look for.
1143
+ * @return {Number} Index of the specified listener, -1 if not found
1144
+ * @api private
1145
+ */
1146
+ function indexOfListener(listeners, listener) {
1147
+ var i = listeners.length;
1148
+ while (i--) {
1149
+ if (listeners[i].listener === listener) {
1150
+ return i;
1151
+ }
1152
+ }
1153
+
1154
+ return -1;
1155
+ }
1156
+
1157
+ /**
1158
+ * Alias a method while keeping the context correct, to allow for overwriting of target method.
1159
+ *
1160
+ * @param {String} name The name of the target method.
1161
+ * @return {Function} The aliased method
1162
+ * @api private
1163
+ */
1164
+ function alias(name) {
1165
+ return function aliasClosure() {
1166
+ return this[name].apply(this, arguments);
1167
+ };
1168
+ }
1169
+
1170
+ /**
1171
+ * Returns the listener array for the specified event.
1172
+ * Will initialise the event object and listener arrays if required.
1173
+ * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
1174
+ * Each property in the object response is an array of listener functions.
1175
+ *
1176
+ * @param {String|RegExp} evt Name of the event to return the listeners from.
1177
+ * @return {Function[]|Object} All listener functions for the event.
1178
+ */
1179
+ proto.getListeners = function getListeners(evt) {
1180
+ var events = this._getEvents();
1181
+ var response;
1182
+ var key;
1183
+
1184
+ // Return a concatenated array of all matching events if
1185
+ // the selector is a regular expression.
1186
+ if (evt instanceof RegExp) {
1187
+ response = {};
1188
+ for (key in events) {
1189
+ if (events.hasOwnProperty(key) && evt.test(key)) {
1190
+ response[key] = events[key];
1191
+ }
1192
+ }
1193
+ }
1194
+ else {
1195
+ response = events[evt] || (events[evt] = []);
1196
+ }
1197
 
1198
+ return response;
1199
+ };
 
1200
 
1201
+ /**
1202
+ * Takes a list of listener objects and flattens it into a list of listener functions.
1203
+ *
1204
+ * @param {Object[]} listeners Raw listener objects.
1205
+ * @return {Function[]} Just the listener functions.
1206
+ */
1207
+ proto.flattenListeners = function flattenListeners(listeners) {
1208
+ var flatListeners = [];
1209
+ var i;
1210
 
1211
+ for (i = 0; i < listeners.length; i += 1) {
1212
+ flatListeners.push(listeners[i].listener);
1213
+ }
 
1214
 
1215
+ return flatListeners;
 
 
 
 
 
1216
  };
 
1217
 
1218
+ /**
1219
+ * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
1220
+ *
1221
+ * @param {String|RegExp} evt Name of the event to return the listeners from.
1222
+ * @return {Object} All listener functions for an event in an object.
1223
+ */
1224
+ proto.getListenersAsObject = function getListenersAsObject(evt) {
1225
+ var listeners = this.getListeners(evt);
1226
+ var response;
1227
 
1228
+ if (listeners instanceof Array) {
1229
+ response = {};
1230
+ response[evt] = listeners;
1231
+ }
1232
 
1233
+ return response || listeners;
1234
+ };
1235
 
1236
+ function isValidListener (listener) {
1237
+ if (typeof listener === 'function' || listener instanceof RegExp) {
1238
+ return true
1239
+ } else if (listener && typeof listener === 'object') {
1240
+ return isValidListener(listener.listener)
1241
+ } else {
1242
+ return false
1243
+ }
1244
  }
1245
 
1246
+ /**
1247
+ * Adds a listener function to the specified event.
1248
+ * The listener will not be added if it is a duplicate.
1249
+ * If the listener returns true then it will be removed after it is called.
1250
+ * If you pass a regular expression as the event name then the listener will be added to all events that match it.
1251
+ *
1252
+ * @param {String|RegExp} evt Name of the event to attach the listener to.
1253
+ * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
1254
+ * @return {Object} Current instance of EventEmitter for chaining.
1255
+ */
1256
+ proto.addListener = function addListener(evt, listener) {
1257
+ if (!isValidListener(listener)) {
1258
+ throw new TypeError('listener must be a function');
1259
+ }
1260
 
1261
+ var listeners = this.getListenersAsObject(evt);
1262
+ var listenerIsWrapped = typeof listener === 'object';
1263
+ var key;
1264
 
1265
+ for (key in listeners) {
1266
+ if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
1267
+ listeners[key].push(listenerIsWrapped ? listener : {
1268
+ listener: listener,
1269
+ once: false
1270
+ });
1271
+ }
1272
+ }
1273
 
1274
+ return this;
1275
+ };
 
 
 
 
1276
 
1277
+ /**
1278
+ * Alias of addListener
1279
+ */
1280
+ proto.on = alias('addListener');
1281
 
1282
+ /**
1283
+ * Semi-alias of addListener. It will add a listener that will be
1284
+ * automatically removed after its first execution.
1285
+ *
1286
+ * @param {String|RegExp} evt Name of the event to attach the listener to.
1287
+ * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
1288
+ * @return {Object} Current instance of EventEmitter for chaining.
1289
+ */
1290
+ proto.addOnceListener = function addOnceListener(evt, listener) {
1291
+ return this.addListener(evt, {
1292
+ listener: listener,
1293
+ once: true
1294
+ });
1295
+ };
1296
 
1297
+ /**
1298
+ * Alias of addOnceListener.
1299
+ */
1300
+ proto.once = alias('addOnceListener');
1301
 
1302
+ /**
1303
+ * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
1304
+ * You need to tell it what event names should be matched by a regex.
1305
+ *
1306
+ * @param {String} evt Name of the event to create.
1307
+ * @return {Object} Current instance of EventEmitter for chaining.
1308
+ */
1309
+ proto.defineEvent = function defineEvent(evt) {
1310
+ this.getListeners(evt);
1311
+ return this;
1312
+ };
1313
 
1314
+ /**
1315
+ * Uses defineEvent to define multiple events.
1316
+ *
1317
+ * @param {String[]} evts An array of event names to define.
1318
+ * @return {Object} Current instance of EventEmitter for chaining.
1319
+ */
1320
+ proto.defineEvents = function defineEvents(evts) {
1321
+ for (var i = 0; i < evts.length; i += 1) {
1322
+ this.defineEvent(evts[i]);
1323
+ }
1324
+ return this;
1325
+ };
1326
 
1327
+ /**
1328
+ * Removes a listener function from the specified event.
1329
+ * When passed a regular expression as the event name, it will remove the listener from all events that match it.
1330
+ *
1331
+ * @param {String|RegExp} evt Name of the event to remove the listener from.
1332
+ * @param {Function} listener Method to remove from the event.
1333
+ * @return {Object} Current instance of EventEmitter for chaining.
1334
+ */
1335
+ proto.removeListener = function removeListener(evt, listener) {
1336
+ var listeners = this.getListenersAsObject(evt);
1337
+ var index;
1338
+ var key;
1339
 
1340
+ for (key in listeners) {
1341
+ if (listeners.hasOwnProperty(key)) {
1342
+ index = indexOfListener(listeners[key], listener);
 
1343
 
1344
+ if (index !== -1) {
1345
+ listeners[key].splice(index, 1);
1346
+ }
1347
+ }
1348
+ }
1349
 
1350
+ return this;
1351
+ };
 
1352
 
1353
+ /**
1354
+ * Alias of removeListener
1355
+ */
1356
+ proto.off = alias('removeListener');
1357
 
1358
+ /**
1359
+ * Adds listeners in bulk using the manipulateListeners method.
1360
+ * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
1361
+ * You can also pass it a regular expression to add the array of listeners to all events that match it.
1362
+ * Yeah, this function does quite a bit. That's probably a bad thing.
1363
+ *
1364
+ * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
1365
+ * @param {Function[]} [listeners] An optional array of listener functions to add.
1366
+ * @return {Object} Current instance of EventEmitter for chaining.
1367
+ */
1368
+ proto.addListeners = function addListeners(evt, listeners) {
1369
+ // Pass through to manipulateListeners
1370
+ return this.manipulateListeners(false, evt, listeners);
1371
+ };
1372
 
1373
+ /**
1374
+ * Removes listeners in bulk using the manipulateListeners method.
1375
+ * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
1376
+ * You can also pass it an event name and an array of listeners to be removed.
1377
+ * You can also pass it a regular expression to remove the listeners from all events that match it.
1378
+ *
1379
+ * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
1380
+ * @param {Function[]} [listeners] An optional array of listener functions to remove.
1381
+ * @return {Object} Current instance of EventEmitter for chaining.
1382
+ */
1383
+ proto.removeListeners = function removeListeners(evt, listeners) {
1384
+ // Pass through to manipulateListeners
1385
+ return this.manipulateListeners(true, evt, listeners);
1386
+ };
1387
 
1388
+ /**
1389
+ * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
1390
+ * The first argument will determine if the listeners are removed (true) or added (false).
1391
+ * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
1392
+ * You can also pass it an event name and an array of listeners to be added/removed.
1393
+ * You can also pass it a regular expression to manipulate the listeners of all events that match it.
1394
+ *
1395
+ * @param {Boolean} remove True if you want to remove listeners, false if you want to add.
1396
+ * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
1397
+ * @param {Function[]} [listeners] An optional array of listener functions to add/remove.
1398
+ * @return {Object} Current instance of EventEmitter for chaining.
1399
+ */
1400
+ proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
1401
+ var i;
1402
+ var value;
1403
+ var single = remove ? this.removeListener : this.addListener;
1404
+ var multiple = remove ? this.removeListeners : this.addListeners;
1405
 
1406
+ // If evt is an object then pass each of its properties to this method
1407
+ if (typeof evt === 'object' && !(evt instanceof RegExp)) {
1408
+ for (i in evt) {
1409
+ if (evt.hasOwnProperty(i) && (value = evt[i])) {
1410
+ // Pass the single listener straight through to the singular method
1411
+ if (typeof value === 'function') {
1412
+ single.call(this, i, value);
1413
+ }
1414
+ else {
1415
+ // Otherwise pass back to the multiple function
1416
+ multiple.call(this, i, value);
1417
+ }
1418
+ }
1419
+ }
1420
+ }
1421
+ else {
1422
+ // So evt must be a string
1423
+ // And listeners must be an array of listeners
1424
+ // Loop over it and pass each one to the multiple method
1425
+ i = listeners.length;
1426
+ while (i--) {
1427
+ single.call(this, evt, listeners[i]);
1428
+ }
1429
+ }
1430
 
1431
+ return this;
1432
+ };
 
 
1433
 
1434
+ /**
1435
+ * Removes all listeners from a specified event.
1436
+ * If you do not specify an event then all listeners will be removed.
1437
+ * That means every event will be emptied.
1438
+ * You can also pass a regex to remove all events that match it.
1439
+ *
1440
+ * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
1441
+ * @return {Object} Current instance of EventEmitter for chaining.
1442
+ */
1443
+ proto.removeEvent = function removeEvent(evt) {
1444
+ var type = typeof evt;
1445
+ var events = this._getEvents();
1446
+ var key;
1447
 
1448
+ // Remove different things depending on the state of evt
1449
+ if (type === 'string') {
1450
+ // Remove all listeners for the specified event
1451
+ delete events[evt];
1452
+ }
1453
+ else if (evt instanceof RegExp) {
1454
+ // Remove all events matching the regex.
1455
+ for (key in events) {
1456
+ if (events.hasOwnProperty(key) && evt.test(key)) {
1457
+ delete events[key];
1458
+ }
1459
+ }
1460
+ }
1461
+ else {
1462
+ // Remove all listeners in all events
1463
+ delete this._events;
1464
+ }
1465
 
1466
+ return this;
1467
+ };
1468
 
1469
+ /**
1470
+ * Alias of removeEvent.
1471
+ *
1472
+ * Added to mirror the node API.
1473
+ */
1474
+ proto.removeAllListeners = alias('removeEvent');
1475
 
1476
+ /**
1477
+ * Emits an event of your choice.
1478
+ * When emitted, every listener attached to that event will be executed.
1479
+ * If you pass the optional argument array then those arguments will be passed to every listener upon execution.
1480
+ * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
1481
+ * So they will not arrive within the array on the other side, they will be separate.
1482
+ * You can also pass a regular expression to emit to all events that match it.
1483
+ *
1484
+ * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
1485
+ * @param {Array} [args] Optional array of arguments to be passed to each listener.
1486
+ * @return {Object} Current instance of EventEmitter for chaining.
1487
+ */
1488
+ proto.emitEvent = function emitEvent(evt, args) {
1489
+ var listenersMap = this.getListenersAsObject(evt);
1490
+ var listeners;
1491
+ var listener;
1492
+ var i;
1493
+ var key;
1494
+ var response;
1495
 
1496
+ for (key in listenersMap) {
1497
+ if (listenersMap.hasOwnProperty(key)) {
1498
+ listeners = listenersMap[key].slice(0);
1499
 
1500
+ for (i = 0; i < listeners.length; i++) {
1501
+ // If the listener returns true then it shall be removed from the event
1502
+ // The function is executed either with a basic call or an apply if there is an args array
1503
+ listener = listeners[i];
1504
 
1505
+ if (listener.once === true) {
1506
+ this.removeListener(evt, listener.listener);
1507
+ }
 
1508
 
1509
+ response = listener.listener.apply(this, args || []);
1510
 
1511
+ if (response === this._getOnceReturnValue()) {
1512
+ this.removeListener(evt, listener.listener);
1513
+ }
1514
+ }
1515
+ }
1516
+ }
1517
 
1518
+ return this;
1519
+ };
1520
 
1521
+ /**
1522
+ * Alias of emitEvent
1523
+ */
1524
+ proto.trigger = alias('emitEvent');
1525
 
1526
+ /**
1527
+ * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
1528
+ * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
1529
+ *
1530
+ * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
1531
+ * @param {...*} Optional additional arguments to be passed to each listener.
1532
+ * @return {Object} Current instance of EventEmitter for chaining.
1533
+ */
1534
+ proto.emit = function emit(evt) {
1535
+ var args = Array.prototype.slice.call(arguments, 1);
1536
+ return this.emitEvent(evt, args);
1537
+ };
1538
 
1539
+ /**
1540
+ * Sets the current value to check against when executing listeners. If a
1541
+ * listeners return value matches the one set here then it will be removed
1542
+ * after execution. This value defaults to true.
1543
+ *
1544
+ * @param {*} value The new value to check for when executing listeners.
1545
+ * @return {Object} Current instance of EventEmitter for chaining.
1546
+ */
1547
+ proto.setOnceReturnValue = function setOnceReturnValue(value) {
1548
+ this._onceReturnValue = value;
1549
+ return this;
1550
+ };
1551
 
1552
+ /**
1553
+ * Fetches the current value to check against when executing listeners. If
1554
+ * the listeners return value matches this one then it should be removed
1555
+ * automatically. It will return true by default.
1556
+ *
1557
+ * @return {*|Boolean} The current value to check for or the default, true.
1558
+ * @api private
1559
+ */
1560
+ proto._getOnceReturnValue = function _getOnceReturnValue() {
1561
+ if (this.hasOwnProperty('_onceReturnValue')) {
1562
+ return this._onceReturnValue;
1563
+ }
1564
+ else {
1565
+ return true;
1566
+ }
1567
+ };
1568
 
1569
+ /**
1570
+ * Fetches the events object and creates one if required.
1571
+ *
1572
+ * @return {Object} The events storage object.
1573
+ * @api private
1574
+ */
1575
+ proto._getEvents = function _getEvents() {
1576
+ return this._events || (this._events = {});
1577
+ };
1578
 
1579
+ /**
1580
+ * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
1581
+ *
1582
+ * @return {Function} Non conflicting EventEmitter class.
1583
+ */
1584
+ EventEmitter.noConflict = function noConflict() {
1585
+ exports.EventEmitter = originalGlobalValue;
1586
+ return EventEmitter;
1587
+ };
1588
 
1589
+ // Expose the class either via AMD, CommonJS or the global object
1590
+ if (typeof define === 'function' && define.amd) {
1591
+ define(function () {
1592
+ return EventEmitter;
1593
+ });
1594
  }
1595
+ else if (typeof module === 'object' && module.exports){
1596
+ module.exports = EventEmitter;
 
 
 
 
 
1597
  }
1598
+ else {
1599
+ exports.EventEmitter = EventEmitter;
 
 
 
 
 
 
 
 
 
 
 
 
 
1600
  }
1601
+ }(typeof window !== 'undefined' ? window : this || {}));
 
 
 
 
 
 
 
 
 
 
 
 
 
1602
 
1603
+ },{}]},{},[1]);
1604
  ; })();
assets/js/script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var l=void 0;!function r(s,l,c){function a(e,t){if(!l[e]){if(!s[e]){var i=!1;if(!t&&i)return i(e,!0);if(d)return d(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var o=l[e]={exports:{}};s[e][0].call(o.exports,function(t){return a(s[e][1][t]||t)},o,o.exports,r,s,l,c)}return l[e].exports}for(var d=!1,t=0;t<c.length;t++)a(c[t]);return a}({1:[function(t,s,e){!function(t){"use strict";function e(){}var i=e.prototype,n=t.EventEmitter;function r(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function o(t){return function(){return this[t].apply(this,arguments)}}i.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp)for(i in e={},n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i]);else e=n[t]||(n[t]=[]);return e},i.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},i.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&((e={})[t]=i),e||i},i.addListener=function(t,e){if(!function t(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&t(e.listener)}(e))throw new TypeError("listener must be a function");var i,n=this.getListenersAsObject(t),o="object"==typeof e;for(i in n)n.hasOwnProperty(i)&&-1===r(n[i],e)&&n[i].push(o?e:{listener:e,once:!1});return this},i.on=o("addListener"),i.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},i.once=o("addOnceListener"),i.defineEvent=function(t){return this.getListeners(t),this},i.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},i.removeListener=function(t,e){var i,n,o=this.getListenersAsObject(t);for(n in o)o.hasOwnProperty(n)&&-1!==(i=r(o[n],e))&&o[n].splice(i,1);return this},i.off=o("removeListener"),i.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},i.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},i.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},i.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"===i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},i.removeAllListeners=o("removeEvent"),i.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].slice(0),o=0;o<i.length;o++)!0===(n=i[o]).once&&this.removeListener(t,n.listener),n.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},i.trigger=o("emitEvent"),i.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},i.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return t.EventEmitter=n,e},"function"==typeof l&&l.amd?l(function(){return e}):"object"==typeof s&&s.exports?s.exports=e:t.EventEmitter=e}("undefined"!=typeof window?window:this||{})},{}],2:[function(t,e,i){"use strict";var o=320;function a(t,e){for(var i in e)t.style[i]=e[i]}function d(a,d,h){var u=+new Date,t=window.getComputedStyle(a),f={},g={};for(var e in d){d[e]=parseFloat(d[e]);var i=d[e],n=parseFloat(t[e]);n!=i?(g[e]=(i-n)/o,f[e]=n):delete d[e]}!function t(){var e,i,n,o,r=+new Date-u,s=!0;for(var l in d){e=g[l],i=d[l],n=e*r,o=f[l]+n,0<e&&i<=o||e<0&&o<=i?o=i:s=!1,f[l]=o;var c="opacity"!==l?"px":"";a.style[l]=o+c}u=+new Date,s?h&&h():window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,32)}()}e.exports={toggle:function(t,e,i){var n,o,r="none"!=t.style.display||0<t.offsetLeft,s=t.cloneNode(!0),l=function(){t.removeAttribute("data-animated"),t.setAttribute("style",s.getAttribute("style")),t.style.display=r?"none":"",i&&i()};if(t.setAttribute("data-animated","true"),r||(t.style.display=""),"slide"===e){if(n=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e;return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),o={},!r){if(o=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e[t[n]];return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],window.getComputedStyle(t)),!isFinite(o.height)){var c=t.getBoundingClientRect();o.height=c.height}a(t,n)}t.style.overflowY="hidden",d(t,r?n:o,l)}else n={opacity:0},o={opacity:1},r||a(t,n),d(t,r?n:o,l)},animate:d,animated:function(t){return!!t.getAttribute("data-animated")}}},{}],3:[function(t,e,i){"use strict";var n,o={animation:"fade",rehide:!1,content:"",cookie:null,icon:"&times",screenWidthCondition:null,position:"center",testMode:!1,trigger:!1,closable:!0},r=t("./animator.js");var s=function(t,e){this.id=t,this.config=function(t,e){var i={};for(var n in t)i[n]=t[n];for(var n in e)i[n]=e[n];return i}(o,e),this.overlay=document.getElementById("boxzilla-overlay"),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=this.calculateTriggerHeight(),this.cookieSet=this.isCookieSet(),this.element=null,this.contentElement=null,this.closeIcon=null,this.dom(),this.events()};s.prototype.events=function(){var e=this;this.closeIcon&&this.closeIcon.addEventListener("click",this.dismiss.bind(this)),this.element.addEventListener("click",function(t){"A"===t.target.tagName&&n.trigger("box.interactions.link",[e,t.target])},!1),this.element.addEventListener("submit",function(t){e.setCookie(),n.trigger("box.interactions.form",[e,t.target])},!1)},s.prototype.dom=function(){var t=document.createElement("div");t.className="boxzilla-container boxzilla-"+this.config.position+"-container";var e,i=document.createElement("div");if(i.setAttribute("id","boxzilla-"+this.id),i.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,i.style.display="none",t.appendChild(i),"string"==typeof this.config.content?(e=document.createElement("div")).innerHTML=this.config.content:(e=this.config.content).style.display="",e.className="boxzilla-content",i.appendChild(e),this.config.closable&&this.config.icon){var n=document.createElement("span");n.className="boxzilla-close-icon",n.innerHTML=this.config.icon,i.appendChild(n),this.closeIcon=n}document.body.appendChild(t),this.contentElement=e,this.element=i},s.prototype.setCustomBoxStyling=function(){var t=this.element.style.display;this.element.style.display="",this.element.style.overflowY="auto",this.element.style.maxHeight="none";var e=window.innerHeight,i=this.element.clientHeight;if(e<i&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var n=(e-i)/2;n=0<=n?n:0,this.element.style.marginTop=n+"px"}this.element.style.display=t},s.prototype.toggle=function(t){return void 0===t&&(t=!this.visible),t!==this.visible&&(!r.animated(this.element)&&(!(!t&&!this.config.closable)&&(this.visible=t,this.setCustomBoxStyling(),n.trigger("box."+(t?"show":"hide"),[this]),"center"===this.config.position&&(this.overlay.classList.toggle("boxzilla-"+this.id+"-overlay"),r.toggle(this.overlay,"fade")),r.toggle(this.element,this.config.animation,function(){this.visible||(this.contentElement.innerHTML=this.contentElement.innerHTML)}.bind(this)),!0)))},s.prototype.show=function(){return this.toggle(!0)},s.prototype.hide=function(){return this.toggle(!1)},s.prototype.calculateTriggerHeight=function(){var t,e,i=0;if(this.config.trigger)if("element"===this.config.trigger.method){var n=document.body.querySelector(this.config.trigger.value);if(n)i=n.getBoundingClientRect().top}else"percentage"===this.config.trigger.method&&(i=this.config.trigger.value/100*(t=document.body,e=document.documentElement,Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)));return i},s.prototype.fits=function(){if(!this.config.screenWidthCondition||!this.config.screenWidthCondition.value)return!0;switch(this.config.screenWidthCondition.condition){case"larger":return window.innerWidth>this.config.screenWidthCondition.value;case"smaller":return window.innerWidth<this.config.screenWidthCondition.value}return!0},s.prototype.onResize=function(){this.triggerHeight=this.calculateTriggerHeight(),this.setCustomBoxStyling()},s.prototype.mayAutoShow=function(){return!this.dismissed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},s.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},s.prototype.isCookieSet=function(){return!(this.config.testMode||!this.config.trigger)&&(!(!this.config.cookie||!this.config.cookie.triggered&&!this.config.cookie.dismissed)&&"true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))},s.prototype.setCookie=function(t){var e=new Date;e.setHours(e.getHours()+t),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"},s.prototype.trigger=function(){this.show()&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},s.prototype.dismiss=function(t){return t&&t.preventDefault(),!!this.visible&&(this.hide(),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,n.trigger("box.dismiss",[this]),!0)},e.exports=function(t){return n=t,s}},{"./animator.js":2}],4:[function(t,e,i){"use strict";var n,o,r,s,l=t("wolfy87-eventemitter"),c=t("./timer.js"),a=Object.create(l.prototype),d=t("./box.js")(a),h=[],u=window,f=!1,g=t("./styles.js"),m=t("./triggers/exit-intent.js");function p(n,o,r){var s,l;return o||(o=250),function(){var t=r||this,e=+new Date,i=arguments;s&&e<s+o?(clearTimeout(l),l=setTimeout(function(){s=e,n.apply(t,i)},o)):(s=e,n.apply(t,i))}}function v(t){27===t.keyCode&&a.dismiss()}function b(){z()||h.forEach(function(t){t.mayAutoShow()&&"pageviews"===t.config.trigger.method&&s>=t.config.trigger.value&&t.trigger()})}function w(){z()||h.forEach(function(t){t.mayAutoShow()&&("time_on_site"===t.config.trigger.method&&o.time>=t.config.trigger.value&&t.trigger(),"time_on_page"===t.config.trigger.method&&r.time>=t.config.trigger.value&&t.trigger())})}function y(){var e=u.hasOwnProperty("pageYOffset")?u.pageYOffset:u.scrollTop;e+=.9*window.innerHeight,h.forEach(function(t){if(t.mayAutoShow()&&!(t.triggerHeight<=0)){if(e>t.triggerHeight){if(z())return;t.trigger()}t.mayRehide()&&e<t.triggerHeight-5&&t.hide()}})}function x(){h.forEach(function(t){t.onResize()})}function E(t){var i=t.offsetX,n=t.offsetY;h.forEach(function(t){var e=t.element.getBoundingClientRect();(i<e.left-40||i>e.right+40||n<e.top-40||n>e.bottom+40)&&t.dismiss()})}function L(){z()||h.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()})}function z(){return 0<h.filter(function(t){return t.visible}).length}function _(t){for(var e=t.target||t.srcElement,i=0;i<=3&&(e&&"A"!==e.tagName);i++)e=e.parentElement;if(e&&"A"===e.tagName&&e.getAttribute("href")){var n=e.getAttribute("href").toLowerCase().match(/[#&]boxzilla-(\d+)/);if(n&&1<n.length){var o=n[1];a.toggle(o)}}}var k=function(){try{var t=sessionStorage.getItem("boxzilla_timer");t&&(o.time=t)}catch(t){}o.start(),r.start()},C=function(){sessionStorage.setItem("boxzilla_timer",o.time),o.stop(),r.stop()};a.init=function(){if(!f){document.body.addEventListener("click",_,!0);try{s=sessionStorage.getItem("boxzilla_pageviews")||0}catch(t){s=0}o=new c(0),r=new c(0);var t=document.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=g,document.head.appendChild(t),(n=document.createElement("div")).style.display="none",n.id="boxzilla-overlay",document.body.appendChild(n),new m(L),u.addEventListener("touchstart",p(y),!0),u.addEventListener("scroll",p(y),!0),window.addEventListener("resize",p(x)),window.addEventListener("load",x),n.addEventListener("click",E),window.setInterval(w,1e3),window.setTimeout(b,1e3),document.addEventListener("keyup",v),k(),window.addEventListener("focus",k),window.addEventListener("beforeunload",function(){C(),sessionStorage.setItem("boxzilla_pageviews",++s)}),window.addEventListener("blur",C),a.trigger("ready"),f=!0}},a.create=function(t,e){void 0!==e.minimumScreenWidth&&(e.screenWidthCondition={condition:"larger",value:e.minimumScreenWidth});var i=new d(t,e);return h.push(i),i},a.get=function(t){for(var e=0;e<h.length;e++){var i=h[e];if(i.id==t)return i}throw new Error("No box exists with ID "+t)},a.dismiss=function(t){void 0===t?h.forEach(function(t){t.dismiss()}):a.get(t).dismiss()},a.hide=function(t){void 0===t?h.forEach(function(t){t.hide()}):a.get(t).hide()},a.show=function(t){void 0===t?h.forEach(function(t){t.show()}):a.get(t).show()},a.toggle=function(t){void 0===t?h.forEach(function(t){t.toggle()}):a.get(t).toggle()},a.boxes=h,window.Boxzilla=a,void 0!==e&&e.exports&&(e.exports=a)},{"./box.js":3,"./styles.js":5,"./timer.js":6,"./triggers/exit-intent.js":7,"wolfy87-eventemitter":1}],5:[function(t,e,i){"use strict";e.exports="#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}"},{}],6:[function(t,e,i){"use strict";var n=function(t){this.time=t,this.interval=0};n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=n},{}],7:[function(t,e,i){"use strict";e.exports=function(t){var e=null,i={};function n(){document.documentElement.removeEventListener("mouseleave",s),document.documentElement.removeEventListener("mouseenter",r),document.documentElement.removeEventListener("click",o),window.removeEventListener("touchstart",l),window.removeEventListener("touchend",c),t()}function o(){null!==e&&(window.clearTimeout(e),e=null)}function r(t){o()}function s(t){o(),t.clientY<=0&&t.clientX<.8*window.innerWidth&&(e=window.setTimeout(n,400))}function l(t){o(),i={timestamp:performance.now(),scrollY:window.scrollY,windowHeight:window.innerHeight}}function c(t){o(),window.innerHeight>i.windowHeight||window.scrollY+20>=i.scrollY||300<performance.now()-i.timestamp||-1<["A","INPUT","BUTTON"].indexOf(t.target.tagName)||(e=window.setTimeout(n,800))}window.addEventListener("touchstart",l),window.addEventListener("touchend",c),document.documentElement.addEventListener("mouseenter",r),document.documentElement.addEventListener("mouseleave",s),document.documentElement.addEventListener("click",o)}},{}],8:[function(t,e,i){"use strict";function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var s=t("boxzilla"),l=window.boxzilla_options;function c(t){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.match(/[#&](boxzilla-\d+)/);if(!e||"object"!==d(e)||e.length<2)return!1;var i=e[1];return i===t.element.id||!!t.element.querySelector("#"+i)}window.Boxzilla=s;var a=-1<document.body.className.indexOf("logged-in");a&&l.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),s.init(),window.addEventListener("load",function(){if(!l.inited){for(var t in l.boxes){var e=l.boxes[t];e.testMode=a&&l.testMode;var i=document.getElementById("boxzilla-box-"+e.id+"-content");if(i){e.content=i;var n=s.create(e.id,e);n.element.className=n.element.className+" boxzilla-"+e.post.slug,o=n.element,(r=e.css).background_color&&(o.style.background=r.background_color),r.color&&(o.style.color=r.color),r.border_color&&(o.style.borderColor=r.border_color),r.border_width&&(o.style.borderWidth=parseInt(r.border_width)+"px"),r.border_style&&(o.style.borderStyle=r.border_style),r.width&&(o.style.maxWidth=parseInt(r.width)+"px"),n.element.firstChild.firstChild.className+=" first-child",n.element.firstChild.lastChild.className+=" last-child",n.fits()&&c(n)&&n.show()}}var o,r;l.inited=!0,s.trigger("done"),function(){if("object"===d(window.mc4wp_forms_config)&&window.mc4wp_forms_config.submitted_form){var t="#"+window.mc4wp_forms_config.submitted_form.element_id,e=s.boxes;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(n.element.querySelector(t))return n.show()}}}()}})}()},{boxzilla:4}]},{},[8])}();
2
  //# sourceMappingURL=script.min.js.map
1
+ !function(){var l=void 0;!function r(s,l,c){function a(e,t){if(!l[e]){if(!s[e]){var i=!1;if(!t&&i)return i(e,!0);if(d)return d(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var o=l[e]={exports:{}};s[e][0].call(o.exports,function(t){return a(s[e][1][t]||t)},o,o.exports,r,s,l,c)}return l[e].exports}for(var d=!1,t=0;t<c.length;t++)a(c[t]);return a}({1:[function(t,e,i){"use strict";function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var s=t("boxzilla"),l=window.boxzilla_options;function c(t){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.match(/[#&](boxzilla-\d+)/);if(!e||"object"!==d(e)||e.length<2)return!1;var i=e[1];return i===t.element.id||!!t.element.querySelector("#"+i)}window.Boxzilla=s;var a=-1<document.body.className.indexOf("logged-in");a&&l.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),s.init(),window.addEventListener("load",function(){if(!l.inited){for(var t in l.boxes){var e=l.boxes[t];e.testMode=a&&l.testMode;var i=document.getElementById("boxzilla-box-"+e.id+"-content");if(i){e.content=i;var n=s.create(e.id,e);n.element.className=n.element.className+" boxzilla-"+e.post.slug,o=n.element,(r=e.css).background_color&&(o.style.background=r.background_color),r.color&&(o.style.color=r.color),r.border_color&&(o.style.borderColor=r.border_color),r.border_width&&(o.style.borderWidth=parseInt(r.border_width)+"px"),r.border_style&&(o.style.borderStyle=r.border_style),r.width&&(o.style.maxWidth=parseInt(r.width)+"px");try{n.element.firstChild.firstChild.className+=" first-child",n.element.firstChild.lastChild.className+=" last-child"}catch(t){}n.fits()&&c(n)&&n.show()}}var o,r;l.inited=!0,s.trigger("done"),function(){if("object"!==d(window.mc4wp_forms_config)||!window.mc4wp_forms_config.submitted_form)return;var t="#"+window.mc4wp_forms_config.submitted_form.element_id,e=s.boxes;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(n.element.querySelector(t))return n.show()}}()}})}()},{boxzilla:4}],2:[function(t,e,i){"use strict";var o=320;function a(t,e){for(var i in e)t.style[i]=e[i]}function d(a,d,u){var h=+new Date,t=window.getComputedStyle(a),f={},g={};for(var e in d){d[e]=parseFloat(d[e]);var i=d[e],n=parseFloat(t[e]);n!=i?(g[e]=(i-n)/o,f[e]=n):delete d[e]}!function t(){var e,i,n,o,r=+new Date-h,s=!0;for(var l in d){e=g[l],i=d[l],n=e*r,o=f[l]+n,0<e&&i<=o||e<0&&o<=i?o=i:s=!1,f[l]=o;var c="opacity"!==l?"px":"";a.style[l]=o+c}h=+new Date,s?u&&u():window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,32)}()}e.exports={toggle:function(t,e,i){function n(){t.removeAttribute("data-animated"),t.setAttribute("style",l.getAttribute("style")),t.style.display=s?"none":"",i&&i()}var o,r,s="none"!=t.style.display||0<t.offsetLeft,l=t.cloneNode(!0);if(t.setAttribute("data-animated","true"),s||(t.style.display=""),"slide"===e){if(o=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e;return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),r={},!s){if(r=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e[t[n]];return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],window.getComputedStyle(t)),!isFinite(r.height)){var c=t.getBoundingClientRect();r.height=c.height}a(t,o)}t.style.overflowY="hidden",d(t,s?o:r,n)}else o={opacity:0},r={opacity:1},s||a(t,o),d(t,s?o:r,n)},animate:d,animated:function(t){return!!t.getAttribute("data-animated")}}},{}],3:[function(t,e,i){"use strict";var n,o={animation:"fade",rehide:!1,content:"",cookie:null,icon:"&times",screenWidthCondition:null,position:"center",testMode:!1,trigger:!1,closable:!0},r=t("./animator.js");function s(t,e){this.id=t,this.config=function(t,e){var i={};for(var n in t)i[n]=t[n];for(var n in e)i[n]=e[n];return i}(o,e),this.overlay=document.getElementById("boxzilla-overlay"),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=this.calculateTriggerHeight(),this.cookieSet=this.isCookieSet(),this.element=null,this.contentElement=null,this.closeIcon=null,this.dom(),this.events()}s.prototype.events=function(){var e=this;this.closeIcon&&this.closeIcon.addEventListener("click",function(t){t.preventDefault(),e.dismiss()}),this.element.addEventListener("click",function(t){"A"===t.target.tagName&&n.trigger("box.interactions.link",[e,t.target])},!1),this.element.addEventListener("submit",function(t){e.setCookie(),n.trigger("box.interactions.form",[e,t.target])},!1)},s.prototype.dom=function(){var t=document.createElement("div");t.className="boxzilla-container boxzilla-"+this.config.position+"-container";var e,i=document.createElement("div");if(i.setAttribute("id","boxzilla-"+this.id),i.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,i.style.display="none",t.appendChild(i),"string"==typeof this.config.content?(e=document.createElement("div")).innerHTML=this.config.content:(e=this.config.content).style.display="",e.className="boxzilla-content",i.appendChild(e),this.config.closable&&this.config.icon){var n=document.createElement("span");n.className="boxzilla-close-icon",n.innerHTML=this.config.icon,i.appendChild(n),this.closeIcon=n}document.body.appendChild(t),this.contentElement=e,this.element=i},s.prototype.setCustomBoxStyling=function(){var t=this.element.style.display;this.element.style.display="",this.element.style.overflowY="auto",this.element.style.maxHeight="none";var e=window.innerHeight,i=this.element.clientHeight;if(e<i&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var n=(e-i)/2;n=0<=n?n:0,this.element.style.marginTop=n+"px"}this.element.style.display=t},s.prototype.toggle=function(t,e){return e=void 0===e||e,(t=void 0===t?!this.visible:t)!==this.visible&&(!r.animated(this.element)&&(!(!t&&!this.config.closable)&&(this.visible=t,this.setCustomBoxStyling(),n.trigger("box."+(t?"show":"hide"),[this]),"center"===this.config.position&&(this.overlay.classList.toggle("boxzilla-"+this.id+"-overlay"),e?r.toggle(this.overlay,"fade"):this.overlay.style.display=t?"":"none"),e?r.toggle(this.element,this.config.animation,function(){this.visible||(this.contentElement.innerHTML=this.contentElement.innerHTML)}.bind(this)):this.element.style.display=t?"":"none",!0)))},s.prototype.show=function(t){return this.toggle(!0,t)},s.prototype.hide=function(t){return this.toggle(!1,t)},s.prototype.calculateTriggerHeight=function(){var t=0;if(this.config.trigger)if("element"===this.config.trigger.method){var e=document.body.querySelector(this.config.trigger.value);if(e)t=e.getBoundingClientRect().top}else"percentage"===this.config.trigger.method&&(t=this.config.trigger.value/100*function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}());return t},s.prototype.fits=function(){if(!this.config.screenWidthCondition||!this.config.screenWidthCondition.value)return!0;switch(this.config.screenWidthCondition.condition){case"larger":return window.innerWidth>this.config.screenWidthCondition.value;case"smaller":return window.innerWidth<this.config.screenWidthCondition.value}return!0},s.prototype.onResize=function(){this.triggerHeight=this.calculateTriggerHeight(),this.setCustomBoxStyling()},s.prototype.mayAutoShow=function(){return!this.dismissed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},s.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},s.prototype.isCookieSet=function(){return!(this.config.testMode||!this.config.trigger)&&(!(!this.config.cookie||!this.config.cookie.triggered&&!this.config.cookie.dismissed)&&"true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))},s.prototype.setCookie=function(t){var e=new Date;e.setHours(e.getHours()+t),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"},s.prototype.trigger=function(){this.show()&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},s.prototype.dismiss=function(t){return!!this.visible&&(this.hide(t),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,n.trigger("box.dismiss",[this]),!0)},e.exports=function(t){return n=t,s}},{"./animator.js":2}],4:[function(t,e,i){"use strict";var n,o,r,s,l=t("wolfy87-eventemitter"),c=t("./timer.js"),a=Object.create(l.prototype),d=t("./box.js")(a),u=[],h=window,f=!1,g=t("./styles.js"),m=t("./triggers/exit-intent.js");function p(n,o,r){var s,l;return o=o||250,function(){var t=r||this,e=+new Date,i=arguments;s&&e<s+o?(clearTimeout(l),l=setTimeout(function(){s=e,n.apply(t,i)},o)):(s=e,n.apply(t,i))}}function v(t){27===t.keyCode&&a.dismiss()}function y(){z()||u.forEach(function(t){t.mayAutoShow()&&"pageviews"===t.config.trigger.method&&s>=t.config.trigger.value&&t.trigger()})}function b(){z()||u.forEach(function(t){t.mayAutoShow()&&("time_on_site"===t.config.trigger.method&&o.time>=t.config.trigger.value&&t.trigger(),"time_on_page"===t.config.trigger.method&&r.time>=t.config.trigger.value&&t.trigger())})}function w(){var e=h.hasOwnProperty("pageYOffset")?h.pageYOffset:h.scrollTop;e+=.9*window.innerHeight,u.forEach(function(t){if(t.mayAutoShow()&&!(t.triggerHeight<=0)){if(e>t.triggerHeight){if(z())return;t.trigger()}t.mayRehide()&&e<t.triggerHeight-5&&t.hide()}})}function x(){u.forEach(function(t){t.onResize()})}function E(t){var i=t.offsetX,n=t.offsetY;u.forEach(function(t){var e=t.element.getBoundingClientRect();(i<e.left-40||i>e.right+40||n<e.top-40||n>e.bottom+40)&&t.dismiss()})}function L(){z()||u.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()})}function z(){return 0<u.filter(function(t){return t.visible}).length}function _(t){for(var e=t.target||t.srcElement,i=0;i<=3&&(e&&"A"!==e.tagName);i++)e=e.parentElement;if(e&&"A"===e.tagName&&e.getAttribute("href")){var n=e.getAttribute("href").toLowerCase().match(/[#&]boxzilla-(\d+)/);if(n&&1<n.length){var o=n[1];a.toggle(o)}}}var k=function(){try{var t=sessionStorage.getItem("boxzilla_timer");t&&(o.time=t)}catch(t){}o.start(),r.start()},C=function(){sessionStorage.setItem("boxzilla_timer",o.time),o.stop(),r.stop()};a.init=function(){if(!f){document.body.addEventListener("click",_,!0);try{s=sessionStorage.getItem("boxzilla_pageviews")||0}catch(t){s=0}o=new c(0),r=new c(0);var t=document.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=g,document.head.appendChild(t),(n=document.createElement("div")).style.display="none",n.id="boxzilla-overlay",document.body.appendChild(n),new m(L),h.addEventListener("touchstart",p(w),!0),h.addEventListener("scroll",p(w),!0),window.addEventListener("resize",p(x)),window.addEventListener("load",x),n.addEventListener("click",E),window.setInterval(b,1e3),window.setTimeout(y,1e3),document.addEventListener("keyup",v),k(),window.addEventListener("focus",k),window.addEventListener("beforeunload",function(){C(),sessionStorage.setItem("boxzilla_pageviews",++s)}),window.addEventListener("blur",C),a.trigger("ready"),f=!0}},a.create=function(t,e){void 0!==e.minimumScreenWidth&&(e.screenWidthCondition={condition:"larger",value:e.minimumScreenWidth});var i=new d(t,e);return u.push(i),i},a.get=function(t){for(var e=0;e<u.length;e++){var i=u[e];if(i.id==t)return i}throw new Error("No box exists with ID "+t)},a.dismiss=function(t,e){t?a.get(t).dismiss(e):u.forEach(function(t){t.dismiss(e)})},a.hide=function(t,e){t?a.get(t).hide(e):u.forEach(function(t){t.hide(e)})},a.show=function(t,e){t?a.get(t).show(e):u.forEach(function(t){t.show(e)})},a.toggle=function(t,e){t?a.get(t).toggle(e):u.forEach(function(t){t.toggle(e)})},a.boxes=u,window.Boxzilla=a,void 0!==e&&e.exports&&(e.exports=a)},{"./box.js":3,"./styles.js":5,"./timer.js":6,"./triggers/exit-intent.js":7,"wolfy87-eventemitter":8}],5:[function(t,e,i){"use strict";e.exports="#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}"},{}],6:[function(t,e,i){"use strict";function n(t){this.time=t,this.interval=0}n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=n},{}],7:[function(t,e,i){"use strict";e.exports=function(t){var e=null,i={};function n(){document.documentElement.removeEventListener("mouseleave",s),document.documentElement.removeEventListener("mouseenter",r),document.documentElement.removeEventListener("click",o),window.removeEventListener("touchstart",l),window.removeEventListener("touchend",c),t()}function o(){null!==e&&(window.clearTimeout(e),e=null)}function r(t){o()}function s(t){o(),t.clientY<=0&&t.clientX<.8*window.innerWidth&&(e=window.setTimeout(n,400))}function l(t){o(),i={timestamp:performance.now(),scrollY:window.scrollY,windowHeight:window.innerHeight}}function c(t){o(),window.innerHeight>i.windowHeight||window.scrollY+20>=i.scrollY||300<performance.now()-i.timestamp||-1<["A","INPUT","BUTTON"].indexOf(t.target.tagName)||(e=window.setTimeout(n,800))}window.addEventListener("touchstart",l),window.addEventListener("touchend",c),document.documentElement.addEventListener("mouseenter",r),document.documentElement.addEventListener("mouseleave",s),document.documentElement.addEventListener("click",o)}},{}],8:[function(t,s,e){!function(t){"use strict";function e(){}var i=e.prototype,n=t.EventEmitter;function r(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function o(t){return function(){return this[t].apply(this,arguments)}}i.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp)for(i in e={},n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i]);else e=n[t]||(n[t]=[]);return e},i.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},i.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&((e={})[t]=i),e||i},i.addListener=function(t,e){if(!function t(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&t(e.listener)}(e))throw new TypeError("listener must be a function");var i,n=this.getListenersAsObject(t),o="object"==typeof e;for(i in n)n.hasOwnProperty(i)&&-1===r(n[i],e)&&n[i].push(o?e:{listener:e,once:!1});return this},i.on=o("addListener"),i.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},i.once=o("addOnceListener"),i.defineEvent=function(t){return this.getListeners(t),this},i.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},i.removeListener=function(t,e){var i,n,o=this.getListenersAsObject(t);for(n in o)o.hasOwnProperty(n)&&-1!==(i=r(o[n],e))&&o[n].splice(i,1);return this},i.off=o("removeListener"),i.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},i.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},i.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},i.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"==i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},i.removeAllListeners=o("removeEvent"),i.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].slice(0),o=0;o<i.length;o++)!0===(n=i[o]).once&&this.removeListener(t,n.listener),n.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},i.trigger=o("emitEvent"),i.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},i.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return t.EventEmitter=n,e},"function"==typeof l&&l.amd?l(function(){return e}):"object"==typeof s&&s.exports?s.exports=e:t.EventEmitter=e}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=script.min.js.map
assets/js/script.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["script.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","EventEmitter","proto","prototype","originalGlobalValue","indexOfListener","listeners","listener","alias","name","this","apply","arguments","getListeners","evt","response","key","events","_getEvents","RegExp","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","isValidListener","TypeError","listenerIsWrapped","once","on","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","value","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","trigger","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd","window","2","duration","css","element","styles","property","style","animate","targetStyles","fn","last","Date","initialStyles","getComputedStyle","currentStyles","propSteps","parseFloat","to","current","tick","step","increment","newValue","timeSinceLastTick","done","suffix","requestAnimationFrame","setTimeout","toggle","animation","callbackFn","hiddenStyles","visibleStyles","nowVisible","display","offsetLeft","clone","cloneNode","cleanup","removeAttribute","setAttribute","getAttribute","properties","newObject","initObjectProperties","object","copyObjectProperties","isFinite","height","clientRect","getBoundingClientRect","overflowY","opacity","animated","3","Boxzilla","defaults","rehide","content","cookie","icon","screenWidthCondition","position","testMode","closable","Animator","Box","id","config","obj1","obj2","obj3","attrname","merge","overlay","document","getElementById","visible","dismissed","triggered","triggerHeight","calculateTriggerHeight","cookieSet","isCookieSet","contentElement","closeIcon","dom","box","addEventListener","dismiss","bind","target","tagName","setCookie","wrapper","createElement","className","appendChild","innerHTML","body","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","clientHeight","newTopMargin","marginTop","show","classList","hide","html","method","triggerElement","querySelector","top","documentElement","Math","max","scrollHeight","offsetHeight","fits","condition","innerWidth","onResize","mayAutoShow","mayRehide","replace","hours","expiryDate","setHours","getHours","toUTCString","preventDefault","_Boxzilla","./animator.js","4","siteTimer","pageTimer","pageViews","Timer","Object","create","boxes","scrollElement","initialised","ExitIntent","throttle","threshhold","scope","deferTimer","context","now","clearTimeout","onKeyUp","keyCode","checkPageViewsCriteria","isAnyBoxVisible","forEach","checkTimeCriteria","time","checkHeightCriteria","scrollY","pageYOffset","scrollTop","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","left","right","bottom","showBoxesWithExitIntentTrigger","filter","b","onElementClick","el","srcElement","parentElement","match","toLowerCase","boxId","timers","sessionTime","sessionStorage","getItem","start","setItem","stop","init","styleElement","head","setInterval","opts","minimumScreenWidth","get","./box.js","./styles.js","./timer.js","./triggers/exit-intent.js","wolfy87-eventemitter","5","6","interval","clearInterval","7","callback","timeout","touchStart","triggerCallback","removeEventListener","onMouseLeave","onMouseEnter","onTouchStart","onTouchEnd","clientY","clientX","timestamp","performance","indexOf","8","_typeof","obj","Symbol","iterator","constructor","options","boxzilla_options","locationHashRefersBox","location","hash","elementId","isLoggedIn","console","log","inited","boxOpts","boxContentElement","post","slug","background_color","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","firstChild","lastChild","mc4wp_forms_config","submitted_form","selector","element_id","maybeOpenMailChimpForWordPressBox","boxzilla"],"mappings":"CAAA,WAAe,IAA8EA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,GAAG,CAACQ,QAAQ,IAAIZ,EAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGQ,QAAQ,IAAI,IAAIL,GAAE,EAAoCH,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAA7b,CAA4c,CAACY,EAAE,CAAC,SAASC,EAAQC,EAAOL,IAQvlB,SAAUA,GACR,aAQA,SAASM,KAGT,IAAIC,EAAQD,EAAaE,UACrBC,EAAsBT,EAAQM,aAUlC,SAASI,EAAgBC,EAAWC,GAEhC,IADA,IAAIpB,EAAImB,EAAUT,OACXV,KACH,GAAImB,EAAUnB,GAAGoB,WAAaA,EAC1B,OAAOpB,EAIf,OAAQ,EAUZ,SAASqB,EAAMC,GACX,OAAO,WACH,OAAOC,KAAKD,GAAME,MAAMD,KAAME,YAatCV,EAAMW,aA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C,eAAeE,WAC1DrH,EAAQzF,EAASyF,MAErB,IAAK,IAAIyC,KAASzC,EAChB,GAAKA,EAAM5L,eAAeqO,GAA1B,CAIA,IAAIlG,EAAMyD,EAAMyC,GAEhB,GAAIlG,EAAIpF,QAAQgH,cAAciJ,GAE5B,OADA7K,EAAIsB,SA1CRyJ,MA1EJ,IAuIE,CAACC,SAAW,KAAK,GAAG,CAAC,IAtjDvB","file":"script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.5 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}],2:[function(require,module,exports){\n\"use strict\";\n\nvar duration = 320;\n\nfunction css(element, styles) {\n for (var property in styles) {\n element.style[property] = styles[property];\n }\n}\n\nfunction initObjectProperties(properties, value) {\n var newObject = {};\n\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n\n return newObject;\n}\n\nfunction copyObjectProperties(properties, object) {\n var newObject = {};\n\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n\n return newObject;\n}\n/**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\n\n\nfunction animated(element) {\n return !!element.getAttribute('data-animated');\n}\n/**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n */\n\n\nfunction toggle(element, animation, callbackFn) {\n var nowVisible = element.style.display != 'none' || element.offsetLeft > 0; // create clone for reference\n\n var clone = element.cloneNode(true);\n\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n\n if (callbackFn) {\n callbackFn();\n }\n }; // store attribute so everyone knows we're animating this element\n\n\n element.setAttribute('data-animated', \"true\"); // toggle element visiblity right away if we're making something visible\n\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles, visibleStyles; // animate properties\n\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], computedStyles); // in some browsers, getComputedStyle returns \"auto\" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height.\n\n if (!isFinite(visibleStyles.height)) {\n var clientRect = element.getBoundingClientRect();\n visibleStyles.height = clientRect.height;\n }\n\n css(element, hiddenStyles);\n } // don't show a scrollbar during animation\n\n\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = {\n opacity: 0\n };\n visibleStyles = {\n opacity: 1\n };\n\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n}\n\nfunction animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n // make sure we have an object filled with floats\n targetStyles[property] = parseFloat(targetStyles[property]); // calculate step size & current value\n\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]); // is there something to do?\n\n if (current == to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n var step, to, increment, newValue;\n\n for (var property in targetStyles) {\n step = propSteps[property];\n to = targetStyles[property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n } // store new value\n\n\n currentStyles[property] = newValue;\n var suffix = property !== \"opacity\" ? \"px\" : \"\";\n element.style[property] = newValue + suffix;\n }\n\n last = +new Date(); // keep going until we're done for all props\n\n if (!done) {\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n}\n\nmodule.exports = {\n 'toggle': toggle,\n 'animate': animate,\n 'animated': animated\n};\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookie': null,\n 'icon': '&times',\n 'screenWidthCondition': null,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n},\n Boxzilla,\n Animator = require('./animator.js');\n/**\n* Merge 2 objects, values of the latter overwriting the former.\n*\n* @param obj1\n* @param obj2\n* @returns {*}\n*/\n\n\nfunction merge(obj1, obj2) {\n var obj3 = {};\n\n for (var attrname in obj1) {\n obj3[attrname] = obj1[attrname];\n }\n\n for (var attrname in obj2) {\n obj3[attrname] = obj2[attrname];\n }\n\n return obj3;\n}\n/**\n* Get the real height of entire document.\n* @returns {number}\n*/\n\n\nfunction getDocumentHeight() {\n var body = document.body,\n html = document.documentElement;\n var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n return height;\n} // Box Object\n\n\nvar Box = function Box(id, config) {\n this.id = id; // store config values\n\n this.config = merge(defaults, config); // store ref to overlay\n\n this.overlay = document.getElementById('boxzilla-overlay'); // state\n\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = this.calculateTriggerHeight();\n this.cookieSet = this.isCookieSet();\n this.element = null;\n this.contentElement = null;\n this.closeIcon = null; // create dom elements for this box\n\n this.dom(); // further initialise the box\n\n this.events();\n}; // initialise the box\n\n\nBox.prototype.events = function () {\n var box = this; // attach event to \"close\" icon inside box\n\n if (this.closeIcon) {\n this.closeIcon.addEventListener('click', this.dismiss.bind(this));\n }\n\n this.element.addEventListener('click', function (e) {\n if (e.target.tagName === 'A') {\n Boxzilla.trigger('box.interactions.link', [box, e.target]);\n }\n }, false);\n this.element.addEventListener('submit', function (e) {\n box.setCookie();\n Boxzilla.trigger('box.interactions.form', [box, e.target]);\n }, false);\n}; // generate dom elements for this box\n\n\nBox.prototype.dom = function () {\n var wrapper = document.createElement('div');\n wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';\n var box = document.createElement('div');\n box.setAttribute('id', 'boxzilla-' + this.id);\n box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n var content;\n\n if (typeof this.config.content === \"string\") {\n content = document.createElement('div');\n content.innerHTML = this.config.content;\n } else {\n content = this.config.content; // make sure element is visible\n\n content.style.display = '';\n }\n\n content.className = 'boxzilla-content';\n box.appendChild(content);\n\n if (this.config.closable && this.config.icon) {\n var closeIcon = document.createElement('span');\n closeIcon.className = \"boxzilla-close-icon\";\n closeIcon.innerHTML = this.config.icon;\n box.appendChild(closeIcon);\n this.closeIcon = closeIcon;\n }\n\n document.body.appendChild(wrapper);\n this.contentElement = content;\n this.element = box;\n}; // set (calculate) custom box styling depending on box options\n\n\nBox.prototype.setCustomBoxStyling = function () {\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = 'auto';\n this.element.style.maxHeight = 'none'; // get new dimensions\n\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight; // add scrollbar to box and limit height\n\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n } // set new top margin for boxes which are centered\n\n\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n this.element.style.display = origDisplay;\n}; // toggle visibility of the box\n\n\nBox.prototype.toggle = function (show) {\n // revert visibility if no explicit argument is given\n if (typeof show === \"undefined\") {\n show = !this.visible;\n } // is box already at desired visibility?\n\n\n if (show === this.visible) {\n return false;\n } // is box being animated?\n\n\n if (Animator.animated(this.element)) {\n return false;\n } // if box should be hidden but is not closable, bail.\n\n\n if (!show && !this.config.closable) {\n return false;\n } // set new visibility status\n\n\n this.visible = show; // calculate new styling rules\n\n this.setCustomBoxStyling(); // trigger event\n\n Boxzilla.trigger('box.' + (show ? 'show' : 'hide'), [this]); // show or hide box using selected animation\n\n if (this.config.position === 'center') {\n this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');\n Animator.toggle(this.overlay, \"fade\");\n }\n\n Animator.toggle(this.element, this.config.animation, function () {\n if (this.visible) {\n return;\n }\n\n this.contentElement.innerHTML = this.contentElement.innerHTML;\n }.bind(this));\n return true;\n}; // show the box\n\n\nBox.prototype.show = function () {\n return this.toggle(true);\n}; // hide the box\n\n\nBox.prototype.hide = function () {\n return this.toggle(false);\n}; // calculate trigger height\n\n\nBox.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger) {\n if (this.config.trigger.method === 'element') {\n var triggerElement = document.body.querySelector(this.config.trigger.value);\n\n if (triggerElement) {\n var offset = triggerElement.getBoundingClientRect();\n triggerHeight = offset.top;\n }\n } else if (this.config.trigger.method === 'percentage') {\n triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();\n }\n }\n\n return triggerHeight;\n};\n\nBox.prototype.fits = function () {\n if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) {\n return true;\n }\n\n switch (this.config.screenWidthCondition.condition) {\n case \"larger\":\n return window.innerWidth > this.config.screenWidthCondition.value;\n\n case \"smaller\":\n return window.innerWidth < this.config.screenWidthCondition.value;\n } // meh.. condition should be \"smaller\" or \"larger\", just return true.\n\n\n return true;\n};\n\nBox.prototype.onResize = function () {\n this.triggerHeight = this.calculateTriggerHeight();\n this.setCustomBoxStyling();\n}; // is this box enabled?\n\n\nBox.prototype.mayAutoShow = function () {\n if (this.dismissed) {\n return false;\n } // check if box fits on given minimum screen width\n\n\n if (!this.fits()) {\n return false;\n } // if trigger empty or error in calculating triggerHeight, return false\n\n\n if (!this.config.trigger) {\n return false;\n } // rely on cookie value (show if not set, don't show if set)\n\n\n return !this.cookieSet;\n};\n\nBox.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n};\n\nBox.prototype.isCookieSet = function () {\n // always show on test mode or when no auto-trigger is configured\n if (this.config.testMode || !this.config.trigger) {\n return false;\n } // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.\n\n\n if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {\n return false;\n }\n\n var cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'boxzilla_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n return cookieSet;\n}; // set cookie that disables automatically showing the box\n\n\nBox.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n};\n\nBox.prototype.trigger = function () {\n var shown = this.show();\n\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n};\n/**\n* Dismisses the box and optionally sets a cookie.\n*\n* @param e The event that triggered this dismissal.\n* @returns {boolean}\n*/\n\n\nBox.prototype.dismiss = function (e) {\n // prevent default action\n e && e.preventDefault(); // only dismiss box if it's currently open.\n\n if (!this.visible) {\n return false;\n } // hide box element\n\n\n this.hide(); // set cookie\n\n if (this.config.cookie && this.config.cookie.dismissed) {\n this.setCookie(this.config.cookie.dismissed);\n }\n\n this.dismissed = true;\n Boxzilla.trigger('box.dismiss', [this]);\n return true;\n};\n\nmodule.exports = function (_Boxzilla) {\n Boxzilla = _Boxzilla;\n return Box;\n};\n\n},{\"./animator.js\":2}],4:[function(require,module,exports){\n'use strict';\n\nvar EventEmitter = require('wolfy87-eventemitter');\n\nvar Timer = require('./timer.js');\n\nvar Boxzilla = Object.create(EventEmitter.prototype);\n\nvar Box = require('./box.js')(Boxzilla);\n\nvar boxes = [];\nvar overlay;\nvar scrollElement = window;\nvar siteTimer;\nvar pageTimer;\nvar pageViews;\nvar initialised = false;\n\nvar styles = require('./styles.js');\n\nvar ExitIntent = require('./triggers/exit-intent.js');\n\nfunction throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last, deferTimer;\n return function () {\n var context = scope || this;\n var now = +new Date(),\n args = arguments;\n\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n} // \"keyup\" listener\n\n\nfunction onKeyUp(e) {\n if (e.keyCode === 27) {\n Boxzilla.dismiss();\n }\n} // check \"pageviews\" criteria for each box\n\n\nfunction checkPageViewsCriteria() {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n if (box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value) {\n box.trigger();\n }\n });\n} // check time trigger criteria for each box\n\n\nfunction checkTimeCriteria() {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n } // check \"time on site\" trigger\n\n\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) {\n box.trigger();\n } // check \"time on page\" trigger\n\n\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n });\n} // check triggerHeight criteria for all boxes\n\n\nfunction checkHeightCriteria() {\n var scrollY = scrollElement.hasOwnProperty('pageYOffset') ? scrollElement.pageYOffset : scrollElement.scrollTop;\n scrollY = scrollY + window.innerHeight * 0.9;\n boxes.forEach(function (box) {\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollY > box.triggerHeight) {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n } // trigger box\n\n\n box.trigger();\n } // if box may auto-hide and scrollY is less than triggerHeight (with small margin of error), hide box\n\n\n if (box.mayRehide() && scrollY < box.triggerHeight - 5) {\n box.hide();\n }\n });\n} // recalculate heights and variables based on height\n\n\nfunction recalculateHeights() {\n boxes.forEach(function (box) {\n box.onResize();\n });\n}\n\nfunction onOverlayClick(e) {\n var x = e.offsetX;\n var y = e.offsetY; // calculate if click was less than 40px outside box to avoid closing it by accident\n\n boxes.forEach(function (box) {\n var rect = box.element.getBoundingClientRect();\n var margin = 40; // if click was not anywhere near box, dismiss it.\n\n if (x < rect.left - margin || x > rect.right + margin || y < rect.top - margin || y > rect.bottom + margin) {\n box.dismiss();\n }\n });\n}\n\nfunction showBoxesWithExitIntentTrigger() {\n // do nothing if already triggered OR another box is visible.\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n}\n\nfunction isAnyBoxVisible() {\n return boxes.filter(function (b) {\n return b.visible;\n }).length > 0;\n}\n\nfunction onElementClick(e) {\n // find <a> element in up to 3 parent elements\n var el = e.target || e.srcElement;\n var depth = 3;\n\n for (var i = 0; i <= depth; i++) {\n if (!el || el.tagName === 'A') {\n break;\n }\n\n el = el.parentElement;\n }\n\n if (!el || el.tagName !== 'A' || !el.getAttribute('href')) {\n return;\n }\n\n var href = el.getAttribute('href').toLowerCase();\n var match = href.match(/[#&]boxzilla-(\\d+)/);\n\n if (match && match.length > 1) {\n var boxId = match[1];\n Boxzilla.toggle(boxId);\n }\n}\n\nvar timers = {\n start: function start() {\n try {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if (sessionTime) siteTimer.time = sessionTime;\n } catch (e) {}\n\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n}; // initialise & add event listeners\n\nBoxzilla.init = function () {\n if (initialised) {\n return;\n }\n\n document.body.addEventListener('click', onElementClick, true);\n\n try {\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n } catch (e) {\n pageViews = 0;\n }\n\n siteTimer = new Timer(0);\n pageTimer = new Timer(0); // insert styles into DOM\n\n var styleElement = document.createElement('style');\n styleElement.setAttribute(\"type\", \"text/css\");\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement); // add overlay element to dom\n\n overlay = document.createElement('div');\n overlay.style.display = 'none';\n overlay.id = 'boxzilla-overlay';\n document.body.appendChild(overlay); // init exit intent trigger\n\n new ExitIntent(showBoxesWithExitIntentTrigger);\n scrollElement.addEventListener('touchstart', throttle(checkHeightCriteria), true);\n scrollElement.addEventListener('scroll', throttle(checkHeightCriteria), true);\n window.addEventListener('resize', throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n overlay.addEventListener('click', onOverlayClick);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000);\n document.addEventListener('keyup', onKeyUp);\n timers.start();\n window.addEventListener('focus', timers.start);\n window.addEventListener('beforeunload', function () {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n window.addEventListener('blur', timers.stop);\n Boxzilla.trigger('ready');\n initialised = true; // ensure this function doesn't run again\n};\n/**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\n\n\nBoxzilla.create = function (id, opts) {\n // preserve backwards compat for minimumScreenWidth option\n if (typeof opts.minimumScreenWidth !== \"undefined\") {\n opts.screenWidthCondition = {\n condition: \"larger\",\n value: opts.minimumScreenWidth\n };\n }\n\n var box = new Box(id, opts);\n boxes.push(box);\n return box;\n};\n\nBoxzilla.get = function (id) {\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n\n if (box.id == id) {\n return box;\n }\n }\n\n throw new Error(\"No box exists with ID \" + id);\n}; // dismiss a single box (or all by omitting id param)\n\n\nBoxzilla.dismiss = function (id) {\n // if no id given, dismiss all current open boxes\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.dismiss();\n });\n } else {\n Boxzilla.get(id).dismiss();\n }\n};\n\nBoxzilla.hide = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.hide();\n });\n } else {\n Boxzilla.get(id).hide();\n }\n};\n\nBoxzilla.show = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.show();\n });\n } else {\n Boxzilla.get(id).show();\n }\n};\n\nBoxzilla.toggle = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.toggle();\n });\n } else {\n Boxzilla.get(id).toggle();\n }\n}; // expose each individual box.\n\n\nBoxzilla.boxes = boxes; // expose boxzilla object\n\nwindow.Boxzilla = Boxzilla;\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n}\n\n},{\"./box.js\":3,\"./styles.js\":5,\"./timer.js\":6,\"./triggers/exit-intent.js\":7,\"wolfy87-eventemitter\":1}],5:[function(require,module,exports){\n\"use strict\";\n\nvar styles = \"#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}\";\nmodule.exports = styles;\n\n},{}],6:[function(require,module,exports){\n'use strict';\n\nvar Timer = function Timer(start) {\n this.time = start;\n this.interval = 0;\n};\n\nTimer.prototype.tick = function () {\n this.time++;\n};\n\nTimer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n};\n\nTimer.prototype.stop = function () {\n if (this.interval) {\n window.clearInterval(this.interval);\n this.interval = 0;\n }\n};\n\nmodule.exports = Timer;\n\n},{}],7:[function(require,module,exports){\n'use strict';\n\nmodule.exports = function (callback) {\n var timeout = null;\n var touchStart = {};\n\n function triggerCallback() {\n document.documentElement.removeEventListener('mouseleave', onMouseLeave);\n document.documentElement.removeEventListener('mouseenter', onMouseEnter);\n document.documentElement.removeEventListener('click', clearTimeout);\n window.removeEventListener('touchstart', onTouchStart);\n window.removeEventListener('touchend', onTouchEnd);\n callback();\n }\n\n function clearTimeout() {\n if (timeout === null) {\n return;\n }\n\n window.clearTimeout(timeout);\n timeout = null;\n }\n\n function onMouseEnter(evt) {\n clearTimeout();\n }\n\n function onMouseLeave(evt) {\n clearTimeout(); // did mouse leave at top of window?\n // add small exception space in the top-right corner\n\n if (evt.clientY <= 0 && evt.clientX < 0.80 * window.innerWidth) {\n timeout = window.setTimeout(triggerCallback, 400);\n }\n }\n\n function onTouchStart(evt) {\n clearTimeout();\n touchStart = {\n timestamp: performance.now(),\n scrollY: window.scrollY,\n windowHeight: window.innerHeight\n };\n }\n\n function onTouchEnd(evt) {\n clearTimeout(); // did address bar appear?\n\n if (window.innerHeight > touchStart.windowHeight) {\n return;\n } // allow a tiny tiny margin for error, to not fire on clicks\n\n\n if (window.scrollY + 20 >= touchStart.scrollY) {\n return;\n }\n\n if (performance.now() - touchStart.timestamp > 300) {\n return;\n }\n\n if (['A', 'INPUT', 'BUTTON'].indexOf(evt.target.tagName) > -1) {\n return;\n }\n\n timeout = window.setTimeout(triggerCallback, 800);\n }\n\n window.addEventListener('touchstart', onTouchStart);\n window.addEventListener('touchend', onTouchEnd);\n document.documentElement.addEventListener('mouseenter', onMouseEnter);\n document.documentElement.addEventListener('mouseleave', onMouseLeave);\n document.documentElement.addEventListener('click', clearTimeout);\n};\n\n},{}],8:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n(function () {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n\n var options = window.boxzilla_options; // expose Boxzilla object to window\n\n window.Boxzilla = Boxzilla; // helper function for setting CSS styles\n\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n function createBoxesFromConfig() {\n // failsafe against including script twice.\n if (options.inited) {\n return;\n } // create boxes from options\n\n\n for (var key in options.boxes) {\n // get opts\n var boxOpts = options.boxes[key];\n boxOpts.testMode = isLoggedIn && options.testMode; // find box content element, bail if not found\n\n var boxContentElement = document.getElementById('boxzilla-box-' + boxOpts.id + '-content');\n\n if (!boxContentElement) {\n continue;\n } // use element as content option\n\n\n boxOpts.content = boxContentElement; // create box\n\n var box = Boxzilla.create(boxOpts.id, boxOpts); // add box slug to box element as classname\n\n box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug; // add custom css to box\n\n css(box.element, boxOpts.css);\n box.element.firstChild.firstChild.className += \" first-child\";\n box.element.firstChild.lastChild.className += \" last-child\"; // maybe show box right away\n\n if (box.fits() && locationHashRefersBox(box)) {\n box.show();\n }\n } // set flag to prevent initialising twice\n\n\n options.inited = true; // trigger \"done\" event.\n\n Boxzilla.trigger('done'); // maybe open box with MC4WP form in it\n\n maybeOpenMailChimpForWordPressBox();\n }\n\n function locationHashRefersBox(box) {\n if (!window.location.hash || 0 === window.location.hash.length) {\n return false;\n } // parse \"boxzilla-{id}\" from location hash\n\n\n var match = window.location.hash.match(/[#&](boxzilla-\\d+)/);\n\n if (!match || _typeof(match) !== \"object\" || match.length < 2) {\n return false;\n }\n\n var elementId = match[1];\n\n if (elementId === box.element.id) {\n return true;\n } else if (box.element.querySelector('#' + elementId)) {\n return true;\n }\n\n return false;\n }\n\n function maybeOpenMailChimpForWordPressBox() {\n if (_typeof(window.mc4wp_forms_config) !== \"object\" || !window.mc4wp_forms_config.submitted_form) {\n return;\n }\n\n var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;\n var boxes = Boxzilla.boxes;\n\n for (var boxId in boxes) {\n if (!boxes.hasOwnProperty(boxId)) {\n continue;\n }\n\n var box = boxes[boxId];\n\n if (box.element.querySelector(selector)) {\n box.show();\n return;\n }\n }\n } // print message when test mode is enabled\n\n\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n if (isLoggedIn && options.testMode) {\n console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\\'re done testing.');\n } // init boxzilla\n\n\n Boxzilla.init(); // on window.load, create DOM elements for boxes\n\n window.addEventListener('load', createBoxesFromConfig);\n})();\n\n},{\"boxzilla\":4}]},{},[8]);\n; })();"]}
1
+ {"version":3,"sources":["script.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","_typeof","obj","Symbol","iterator","constructor","prototype","Boxzilla","options","window","boxzilla_options","locationHashRefersBox","box","location","hash","match","elementId","element","id","querySelector","isLoggedIn","document","body","className","indexOf","testMode","console","log","init","addEventListener","inited","key","boxes","boxOpts","boxContentElement","getElementById","content","create","post","slug","styles","css","background_color","style","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","firstChild","lastChild","fits","show","trigger","mc4wp_forms_config","submitted_form","selector","element_id","boxId","hasOwnProperty","maybeOpenMailChimpForWordPressBox","boxzilla","2","duration","property","animate","targetStyles","fn","last","Date","initialStyles","getComputedStyle","currentStyles","propSteps","parseFloat","to","current","tick","step","increment","newValue","timeSinceLastTick","done","suffix","requestAnimationFrame","setTimeout","toggle","animation","callbackFn","cleanup","removeAttribute","setAttribute","clone","getAttribute","display","nowVisible","hiddenStyles","visibleStyles","offsetLeft","cloneNode","properties","value","newObject","initObjectProperties","object","copyObjectProperties","isFinite","height","clientRect","getBoundingClientRect","overflowY","opacity","animated","3","defaults","rehide","cookie","icon","screenWidthCondition","position","closable","Animator","Box","config","this","obj1","obj2","obj3","attrname","merge","overlay","visible","dismissed","triggered","triggerHeight","calculateTriggerHeight","cookieSet","isCookieSet","contentElement","closeIcon","dom","events","preventDefault","dismiss","target","tagName","setCookie","wrapper","createElement","appendChild","innerHTML","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","clientHeight","newTopMargin","marginTop","classList","bind","hide","method","triggerElement","top","html","documentElement","Math","max","scrollHeight","offsetHeight","getDocumentHeight","condition","innerWidth","onResize","mayAutoShow","mayRehide","replace","RegExp","hours","expiryDate","setHours","getHours","toUTCString","_Boxzilla","./animator.js","4","siteTimer","pageTimer","pageViews","EventEmitter","Timer","Object","scrollElement","initialised","ExitIntent","throttle","threshhold","scope","deferTimer","context","now","args","arguments","clearTimeout","apply","onKeyUp","keyCode","checkPageViewsCriteria","isAnyBoxVisible","forEach","checkTimeCriteria","time","checkHeightCriteria","scrollY","pageYOffset","scrollTop","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","left","right","bottom","showBoxesWithExitIntentTrigger","filter","b","onElementClick","el","srcElement","parentElement","toLowerCase","timers","sessionTime","sessionStorage","getItem","start","setItem","stop","styleElement","head","setInterval","opts","minimumScreenWidth","push","get","./box.js","./styles.js","./timer.js","./triggers/exit-intent.js","wolfy87-eventemitter","5","6","interval","clearInterval","7","callback","timeout","touchStart","triggerCallback","removeEventListener","onMouseLeave","onMouseEnter","onTouchStart","onTouchEnd","evt","clientY","clientX","timestamp","performance","8","proto","originalGlobalValue","indexOfListener","listeners","listener","alias","name","getListeners","response","_getEvents","test","flattenListeners","flatListeners","getListenersAsObject","Array","addListener","isValidListener","TypeError","listenerIsWrapped","once","on","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA8EA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAE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.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n(function () {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n\n var options = window.boxzilla_options; // expose Boxzilla object to window\n\n window.Boxzilla = Boxzilla; // helper function for setting CSS styles\n\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n function createBoxesFromConfig() {\n // failsafe against including script twice.\n if (options.inited) {\n return;\n } // create boxes from options\n\n\n for (var key in options.boxes) {\n // get opts\n var boxOpts = options.boxes[key];\n boxOpts.testMode = isLoggedIn && options.testMode; // find box content element, bail if not found\n\n var boxContentElement = document.getElementById('boxzilla-box-' + boxOpts.id + '-content');\n\n if (!boxContentElement) {\n continue;\n } // use element as content option\n\n\n boxOpts.content = boxContentElement; // create box\n\n var box = Boxzilla.create(boxOpts.id, boxOpts); // add box slug to box element as classname\n\n box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug; // add custom css to box\n\n css(box.element, boxOpts.css);\n\n try {\n box.element.firstChild.firstChild.className += \" first-child\";\n box.element.firstChild.lastChild.className += \" last-child\";\n } catch (e) {} // maybe show box right away\n\n\n if (box.fits() && locationHashRefersBox(box)) {\n box.show();\n }\n } // set flag to prevent initialising twice\n\n\n options.inited = true; // trigger \"done\" event.\n\n Boxzilla.trigger('done'); // maybe open box with MC4WP form in it\n\n maybeOpenMailChimpForWordPressBox();\n }\n\n function locationHashRefersBox(box) {\n if (!window.location.hash || 0 === window.location.hash.length) {\n return false;\n } // parse \"boxzilla-{id}\" from location hash\n\n\n var match = window.location.hash.match(/[#&](boxzilla-\\d+)/);\n\n if (!match || _typeof(match) !== \"object\" || match.length < 2) {\n return false;\n }\n\n var elementId = match[1];\n\n if (elementId === box.element.id) {\n return true;\n } else if (box.element.querySelector('#' + elementId)) {\n return true;\n }\n\n return false;\n }\n\n function maybeOpenMailChimpForWordPressBox() {\n if (_typeof(window.mc4wp_forms_config) !== \"object\" || !window.mc4wp_forms_config.submitted_form) {\n return;\n }\n\n var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;\n var boxes = Boxzilla.boxes;\n\n for (var boxId in boxes) {\n if (!boxes.hasOwnProperty(boxId)) {\n continue;\n }\n\n var box = boxes[boxId];\n\n if (box.element.querySelector(selector)) {\n box.show();\n return;\n }\n }\n } // print message when test mode is enabled\n\n\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n if (isLoggedIn && options.testMode) {\n console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\\'re done testing.');\n } // init boxzilla\n\n\n Boxzilla.init(); // on window.load, create DOM elements for boxes\n\n window.addEventListener('load', createBoxesFromConfig);\n})();\n\n},{\"boxzilla\":4}],2:[function(require,module,exports){\n\"use strict\";\n\nvar duration = 320;\n\nfunction css(element, styles) {\n for (var property in styles) {\n element.style[property] = styles[property];\n }\n}\n\nfunction initObjectProperties(properties, value) {\n var newObject = {};\n\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n\n return newObject;\n}\n\nfunction copyObjectProperties(properties, object) {\n var newObject = {};\n\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n\n return newObject;\n}\n/**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\n\n\nfunction animated(element) {\n return !!element.getAttribute('data-animated');\n}\n/**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n */\n\n\nfunction toggle(element, animation, callbackFn) {\n var nowVisible = element.style.display != 'none' || element.offsetLeft > 0; // create clone for reference\n\n var clone = element.cloneNode(true);\n\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n\n if (callbackFn) {\n callbackFn();\n }\n }; // store attribute so everyone knows we're animating this element\n\n\n element.setAttribute('data-animated', \"true\"); // toggle element visiblity right away if we're making something visible\n\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles, visibleStyles; // animate properties\n\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], computedStyles); // in some browsers, getComputedStyle returns \"auto\" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height.\n\n if (!isFinite(visibleStyles.height)) {\n var clientRect = element.getBoundingClientRect();\n visibleStyles.height = clientRect.height;\n }\n\n css(element, hiddenStyles);\n } // don't show a scrollbar during animation\n\n\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = {\n opacity: 0\n };\n visibleStyles = {\n opacity: 1\n };\n\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n}\n\nfunction animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n // make sure we have an object filled with floats\n targetStyles[property] = parseFloat(targetStyles[property]); // calculate step size & current value\n\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]); // is there something to do?\n\n if (current == to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n var step, to, increment, newValue;\n\n for (var property in targetStyles) {\n step = propSteps[property];\n to = targetStyles[property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n } // store new value\n\n\n currentStyles[property] = newValue;\n var suffix = property !== \"opacity\" ? \"px\" : \"\";\n element.style[property] = newValue + suffix;\n }\n\n last = +new Date(); // keep going until we're done for all props\n\n if (!done) {\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n}\n\nmodule.exports = {\n 'toggle': toggle,\n 'animate': animate,\n 'animated': animated\n};\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookie': null,\n 'icon': '&times',\n 'screenWidthCondition': null,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n},\n Boxzilla,\n Animator = require('./animator.js');\n/**\n* Merge 2 objects, values of the latter overwriting the former.\n*\n* @param obj1\n* @param obj2\n* @returns {*}\n*/\n\n\nfunction merge(obj1, obj2) {\n var obj3 = {};\n\n for (var attrname in obj1) {\n obj3[attrname] = obj1[attrname];\n }\n\n for (var attrname in obj2) {\n obj3[attrname] = obj2[attrname];\n }\n\n return obj3;\n}\n/**\n* Get the real height of entire document.\n* @returns {number}\n*/\n\n\nfunction getDocumentHeight() {\n var body = document.body,\n html = document.documentElement;\n var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n return height;\n} // Box Object\n\n\nvar Box = function Box(id, config) {\n this.id = id; // store config values\n\n this.config = merge(defaults, config); // store ref to overlay\n\n this.overlay = document.getElementById('boxzilla-overlay'); // state\n\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = this.calculateTriggerHeight();\n this.cookieSet = this.isCookieSet();\n this.element = null;\n this.contentElement = null;\n this.closeIcon = null; // create dom elements for this box\n\n this.dom(); // further initialise the box\n\n this.events();\n}; // initialise the box\n\n\nBox.prototype.events = function () {\n var box = this; // attach event to \"close\" icon inside box\n\n if (this.closeIcon) {\n this.closeIcon.addEventListener('click', function (e) {\n e.preventDefault();\n box.dismiss();\n });\n }\n\n this.element.addEventListener('click', function (e) {\n if (e.target.tagName === 'A') {\n Boxzilla.trigger('box.interactions.link', [box, e.target]);\n }\n }, false);\n this.element.addEventListener('submit', function (e) {\n box.setCookie();\n Boxzilla.trigger('box.interactions.form', [box, e.target]);\n }, false);\n}; // generate dom elements for this box\n\n\nBox.prototype.dom = function () {\n var wrapper = document.createElement('div');\n wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';\n var box = document.createElement('div');\n box.setAttribute('id', 'boxzilla-' + this.id);\n box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n var content;\n\n if (typeof this.config.content === \"string\") {\n content = document.createElement('div');\n content.innerHTML = this.config.content;\n } else {\n content = this.config.content; // make sure element is visible\n\n content.style.display = '';\n }\n\n content.className = 'boxzilla-content';\n box.appendChild(content);\n\n if (this.config.closable && this.config.icon) {\n var closeIcon = document.createElement('span');\n closeIcon.className = \"boxzilla-close-icon\";\n closeIcon.innerHTML = this.config.icon;\n box.appendChild(closeIcon);\n this.closeIcon = closeIcon;\n }\n\n document.body.appendChild(wrapper);\n this.contentElement = content;\n this.element = box;\n}; // set (calculate) custom box styling depending on box options\n\n\nBox.prototype.setCustomBoxStyling = function () {\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = 'auto';\n this.element.style.maxHeight = 'none'; // get new dimensions\n\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight; // add scrollbar to box and limit height\n\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n } // set new top margin for boxes which are centered\n\n\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n this.element.style.display = origDisplay;\n}; // toggle visibility of the box\n\n\nBox.prototype.toggle = function (show, animate) {\n show = typeof show === \"undefined\" ? !this.visible : show;\n animate = typeof animate === \"undefined\" ? true : animate; // is box already at desired visibility?\n\n if (show === this.visible) {\n return false;\n } // is box being animated?\n\n\n if (Animator.animated(this.element)) {\n return false;\n } // if box should be hidden but is not closable, bail.\n\n\n if (!show && !this.config.closable) {\n return false;\n } // set new visibility status\n\n\n this.visible = show; // calculate new styling rules\n\n this.setCustomBoxStyling(); // trigger event\n\n Boxzilla.trigger('box.' + (show ? 'show' : 'hide'), [this]); // show or hide box using selected animation\n\n if (this.config.position === 'center') {\n this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');\n\n if (animate) {\n Animator.toggle(this.overlay, \"fade\");\n } else {\n this.overlay.style.display = show ? '' : 'none';\n }\n }\n\n if (animate) {\n Animator.toggle(this.element, this.config.animation, function () {\n if (this.visible) {\n return;\n }\n\n this.contentElement.innerHTML = this.contentElement.innerHTML;\n }.bind(this));\n } else {\n this.element.style.display = show ? '' : 'none';\n }\n\n return true;\n}; // show the box\n\n\nBox.prototype.show = function (animate) {\n return this.toggle(true, animate);\n}; // hide the box\n\n\nBox.prototype.hide = function (animate) {\n return this.toggle(false, animate);\n}; // calculate trigger height\n\n\nBox.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger) {\n if (this.config.trigger.method === 'element') {\n var triggerElement = document.body.querySelector(this.config.trigger.value);\n\n if (triggerElement) {\n var offset = triggerElement.getBoundingClientRect();\n triggerHeight = offset.top;\n }\n } else if (this.config.trigger.method === 'percentage') {\n triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();\n }\n }\n\n return triggerHeight;\n};\n\nBox.prototype.fits = function () {\n if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) {\n return true;\n }\n\n switch (this.config.screenWidthCondition.condition) {\n case \"larger\":\n return window.innerWidth > this.config.screenWidthCondition.value;\n\n case \"smaller\":\n return window.innerWidth < this.config.screenWidthCondition.value;\n } // meh.. condition should be \"smaller\" or \"larger\", just return true.\n\n\n return true;\n};\n\nBox.prototype.onResize = function () {\n this.triggerHeight = this.calculateTriggerHeight();\n this.setCustomBoxStyling();\n}; // is this box enabled?\n\n\nBox.prototype.mayAutoShow = function () {\n if (this.dismissed) {\n return false;\n } // check if box fits on given minimum screen width\n\n\n if (!this.fits()) {\n return false;\n } // if trigger empty or error in calculating triggerHeight, return false\n\n\n if (!this.config.trigger) {\n return false;\n } // rely on cookie value (show if not set, don't show if set)\n\n\n return !this.cookieSet;\n};\n\nBox.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n};\n\nBox.prototype.isCookieSet = function () {\n // always show on test mode or when no auto-trigger is configured\n if (this.config.testMode || !this.config.trigger) {\n return false;\n } // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.\n\n\n if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {\n return false;\n }\n\n var cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'boxzilla_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n return cookieSet;\n}; // set cookie that disables automatically showing the box\n\n\nBox.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n};\n\nBox.prototype.trigger = function () {\n var shown = this.show();\n\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n};\n/**\n* Dismisses the box and optionally sets a cookie.\n*\n* @param e The event that triggered this dismissal.\n* @returns {boolean}\n*/\n\n\nBox.prototype.dismiss = function (animate) {\n // only dismiss box if it's currently open.\n if (!this.visible) {\n return false;\n } // hide box element\n\n\n this.hide(animate); // set cookie\n\n if (this.config.cookie && this.config.cookie.dismissed) {\n this.setCookie(this.config.cookie.dismissed);\n }\n\n this.dismissed = true;\n Boxzilla.trigger('box.dismiss', [this]);\n return true;\n};\n\nmodule.exports = function (_Boxzilla) {\n Boxzilla = _Boxzilla;\n return Box;\n};\n\n},{\"./animator.js\":2}],4:[function(require,module,exports){\n'use strict';\n\nvar EventEmitter = require('wolfy87-eventemitter');\n\nvar Timer = require('./timer.js');\n\nvar Boxzilla = Object.create(EventEmitter.prototype);\n\nvar Box = require('./box.js')(Boxzilla);\n\nvar boxes = [];\nvar overlay;\nvar scrollElement = window;\nvar siteTimer;\nvar pageTimer;\nvar pageViews;\nvar initialised = false;\n\nvar styles = require('./styles.js');\n\nvar ExitIntent = require('./triggers/exit-intent.js');\n\nfunction throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last, deferTimer;\n return function () {\n var context = scope || this;\n var now = +new Date(),\n args = arguments;\n\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n} // \"keyup\" listener\n\n\nfunction onKeyUp(e) {\n if (e.keyCode === 27) {\n Boxzilla.dismiss();\n }\n} // check \"pageviews\" criteria for each box\n\n\nfunction checkPageViewsCriteria() {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n if (box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value) {\n box.trigger();\n }\n });\n} // check time trigger criteria for each box\n\n\nfunction checkTimeCriteria() {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n } // check \"time on site\" trigger\n\n\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) {\n box.trigger();\n } // check \"time on page\" trigger\n\n\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n });\n} // check triggerHeight criteria for all boxes\n\n\nfunction checkHeightCriteria() {\n var scrollY = scrollElement.hasOwnProperty('pageYOffset') ? scrollElement.pageYOffset : scrollElement.scrollTop;\n scrollY = scrollY + window.innerHeight * 0.9;\n boxes.forEach(function (box) {\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollY > box.triggerHeight) {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n } // trigger box\n\n\n box.trigger();\n } // if box may auto-hide and scrollY is less than triggerHeight (with small margin of error), hide box\n\n\n if (box.mayRehide() && scrollY < box.triggerHeight - 5) {\n box.hide();\n }\n });\n} // recalculate heights and variables based on height\n\n\nfunction recalculateHeights() {\n boxes.forEach(function (box) {\n box.onResize();\n });\n}\n\nfunction onOverlayClick(e) {\n var x = e.offsetX;\n var y = e.offsetY; // calculate if click was less than 40px outside box to avoid closing it by accident\n\n boxes.forEach(function (box) {\n var rect = box.element.getBoundingClientRect();\n var margin = 40; // if click was not anywhere near box, dismiss it.\n\n if (x < rect.left - margin || x > rect.right + margin || y < rect.top - margin || y > rect.bottom + margin) {\n box.dismiss();\n }\n });\n}\n\nfunction showBoxesWithExitIntentTrigger() {\n // do nothing if already triggered OR another box is visible.\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n}\n\nfunction isAnyBoxVisible() {\n return boxes.filter(function (b) {\n return b.visible;\n }).length > 0;\n}\n\nfunction onElementClick(e) {\n // find <a> element in up to 3 parent elements\n var el = e.target || e.srcElement;\n var depth = 3;\n\n for (var i = 0; i <= depth; i++) {\n if (!el || el.tagName === 'A') {\n break;\n }\n\n el = el.parentElement;\n }\n\n if (!el || el.tagName !== 'A' || !el.getAttribute('href')) {\n return;\n }\n\n var href = el.getAttribute('href').toLowerCase();\n var match = href.match(/[#&]boxzilla-(\\d+)/);\n\n if (match && match.length > 1) {\n var boxId = match[1];\n Boxzilla.toggle(boxId);\n }\n}\n\nvar timers = {\n start: function start() {\n try {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if (sessionTime) siteTimer.time = sessionTime;\n } catch (e) {}\n\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n}; // initialise & add event listeners\n\nBoxzilla.init = function () {\n if (initialised) {\n return;\n }\n\n document.body.addEventListener('click', onElementClick, true);\n\n try {\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n } catch (e) {\n pageViews = 0;\n }\n\n siteTimer = new Timer(0);\n pageTimer = new Timer(0); // insert styles into DOM\n\n var styleElement = document.createElement('style');\n styleElement.setAttribute(\"type\", \"text/css\");\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement); // add overlay element to dom\n\n overlay = document.createElement('div');\n overlay.style.display = 'none';\n overlay.id = 'boxzilla-overlay';\n document.body.appendChild(overlay); // init exit intent trigger\n\n new ExitIntent(showBoxesWithExitIntentTrigger);\n scrollElement.addEventListener('touchstart', throttle(checkHeightCriteria), true);\n scrollElement.addEventListener('scroll', throttle(checkHeightCriteria), true);\n window.addEventListener('resize', throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n overlay.addEventListener('click', onOverlayClick);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000);\n document.addEventListener('keyup', onKeyUp);\n timers.start();\n window.addEventListener('focus', timers.start);\n window.addEventListener('beforeunload', function () {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n window.addEventListener('blur', timers.stop);\n Boxzilla.trigger('ready');\n initialised = true; // ensure this function doesn't run again\n};\n/**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\n\n\nBoxzilla.create = function (id, opts) {\n // preserve backwards compat for minimumScreenWidth option\n if (typeof opts.minimumScreenWidth !== \"undefined\") {\n opts.screenWidthCondition = {\n condition: \"larger\",\n value: opts.minimumScreenWidth\n };\n }\n\n var box = new Box(id, opts);\n boxes.push(box);\n return box;\n};\n\nBoxzilla.get = function (id) {\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n\n if (box.id == id) {\n return box;\n }\n }\n\n throw new Error(\"No box exists with ID \" + id);\n}; // dismiss a single box (or all by omitting id param)\n\n\nBoxzilla.dismiss = function (id, animate) {\n // if no id given, dismiss all current open boxes\n if (id) {\n Boxzilla.get(id).dismiss(animate);\n } else {\n boxes.forEach(function (box) {\n box.dismiss(animate);\n });\n }\n};\n\nBoxzilla.hide = function (id, animate) {\n if (id) {\n Boxzilla.get(id).hide(animate);\n } else {\n boxes.forEach(function (box) {\n box.hide(animate);\n });\n }\n};\n\nBoxzilla.show = function (id, animate) {\n if (id) {\n Boxzilla.get(id).show(animate);\n } else {\n boxes.forEach(function (box) {\n box.show(animate);\n });\n }\n};\n\nBoxzilla.toggle = function (id, animate) {\n if (id) {\n Boxzilla.get(id).toggle(animate);\n } else {\n boxes.forEach(function (box) {\n box.toggle(animate);\n });\n }\n}; // expose each individual box.\n\n\nBoxzilla.boxes = boxes; // expose boxzilla object\n\nwindow.Boxzilla = Boxzilla;\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n}\n\n},{\"./box.js\":3,\"./styles.js\":5,\"./timer.js\":6,\"./triggers/exit-intent.js\":7,\"wolfy87-eventemitter\":8}],5:[function(require,module,exports){\n\"use strict\";\n\nvar styles = \"#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}\";\nmodule.exports = styles;\n\n},{}],6:[function(require,module,exports){\n'use strict';\n\nvar Timer = function Timer(start) {\n this.time = start;\n this.interval = 0;\n};\n\nTimer.prototype.tick = function () {\n this.time++;\n};\n\nTimer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n};\n\nTimer.prototype.stop = function () {\n if (this.interval) {\n window.clearInterval(this.interval);\n this.interval = 0;\n }\n};\n\nmodule.exports = Timer;\n\n},{}],7:[function(require,module,exports){\n'use strict';\n\nmodule.exports = function (callback) {\n var timeout = null;\n var touchStart = {};\n\n function triggerCallback() {\n document.documentElement.removeEventListener('mouseleave', onMouseLeave);\n document.documentElement.removeEventListener('mouseenter', onMouseEnter);\n document.documentElement.removeEventListener('click', clearTimeout);\n window.removeEventListener('touchstart', onTouchStart);\n window.removeEventListener('touchend', onTouchEnd);\n callback();\n }\n\n function clearTimeout() {\n if (timeout === null) {\n return;\n }\n\n window.clearTimeout(timeout);\n timeout = null;\n }\n\n function onMouseEnter(evt) {\n clearTimeout();\n }\n\n function onMouseLeave(evt) {\n clearTimeout(); // did mouse leave at top of window?\n // add small exception space in the top-right corner\n\n if (evt.clientY <= 0 && evt.clientX < 0.80 * window.innerWidth) {\n timeout = window.setTimeout(triggerCallback, 400);\n }\n }\n\n function onTouchStart(evt) {\n clearTimeout();\n touchStart = {\n timestamp: performance.now(),\n scrollY: window.scrollY,\n windowHeight: window.innerHeight\n };\n }\n\n function onTouchEnd(evt) {\n clearTimeout(); // did address bar appear?\n\n if (window.innerHeight > touchStart.windowHeight) {\n return;\n } // allow a tiny tiny margin for error, to not fire on clicks\n\n\n if (window.scrollY + 20 >= touchStart.scrollY) {\n return;\n }\n\n if (performance.now() - touchStart.timestamp > 300) {\n return;\n }\n\n if (['A', 'INPUT', 'BUTTON'].indexOf(evt.target.tagName) > -1) {\n return;\n }\n\n timeout = window.setTimeout(triggerCallback, 800);\n }\n\n window.addEventListener('touchstart', onTouchStart);\n window.addEventListener('touchend', onTouchEnd);\n document.documentElement.addEventListener('mouseenter', onMouseEnter);\n document.documentElement.addEventListener('mouseleave', onMouseLeave);\n document.documentElement.addEventListener('click', clearTimeout);\n};\n\n},{}],8:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.6 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - https://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n; })();"]}
boxzilla.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
- Version: 3.2.11
5
  Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
6
  Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
7
  Author: ibericode
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
+ Version: 3.2.12
5
  Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
6
  Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
7
  Author: ibericode
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=bo
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 4.1
6
  Tested up to: 5.2
7
- Stable tag: 3.2.11
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
@@ -130,6 +130,14 @@ Have a look at the [frequently asked questions](https://wordpress.org/plugins/bo
130
  == Changelog ==
131
 
132
 
 
 
 
 
 
 
 
 
133
  #### 3.2.11 - May 8, 2019
134
 
135
  **Improvements**
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 4.1
6
  Tested up to: 5.2
7
+ Stable tag: 3.2.12
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
130
  == Changelog ==
131
 
132
 
133
+ #### 3.2.12 - June 7, 2019
134
+
135
+ **Improvements**
136
+
137
+ - Allow skipping animations when showing, hiding or dismissing a box.
138
+ - Check for empty box content after running filter hooks, instead of before.
139
+
140
+
141
  #### 3.2.11 - May 8, 2019
142
 
143
  **Improvements**
src/class-loader.php CHANGED
@@ -321,13 +321,14 @@ class BoxLoader
321
  // create `Box` instances out of \WP_Post instances
322
  $boxes = array();
323
  foreach ($posts as $key => $post) {
324
- // skip posts with no content
325
- $post_content = trim($post->post_content);
326
- if (empty($post_content)) {
 
327
  continue;
328
  }
329
 
330
- $boxes[ $key ] = new Box($post);
331
  }
332
  }
333
 
321
  // create `Box` instances out of \WP_Post instances
322
  $boxes = array();
323
  foreach ($posts as $key => $post) {
324
+ $box = new Box($post);
325
+
326
+ // skip boxes without any content
327
+ if ($box->get_content() === '') {
328
  continue;
329
  }
330
 
331
+ $boxes[ $key ] = $box;
332
  }
333
  }
334