MailChimp for WordPress - Version 4.5.0

Version Description

Download this release

Release Info

Developer DvanKooten
Plugin Icon 128x128 MailChimp for WordPress
Version 4.5.0
Comparing to
See all releases

Code changes from version 4.4 to 4.5.0

CHANGELOG.md CHANGED
@@ -1,7 +1,18 @@
1
  Changelog
2
  =========
3
 
4
- #### 4.4 - March 1, 2018
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  **Fixes**
7
 
1
  Changelog
2
  =========
3
 
4
+ #### 4.5.0 - March 27, 2019
5
+
6
+ **Additions**
7
+
8
+ - Built-in integration with Google reCAPTCHA to prevent bots from subscribing to your Mailchimp lists.
9
+
10
+ **Improvements**
11
+
12
+ - Minor improvements to the JavaScript that is loaded on admin pages.
13
+
14
+
15
+ #### 4.4.0 - March 1, 2019
16
 
17
  **Fixes**
18
 
assets/js/admin.js CHANGED
@@ -7,17 +7,23 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
7
 
8
  var m = window.m = require('mithril');
9
 
10
- var EventEmitter = require('wolfy87-eventemitter'); // vars
11
 
 
12
 
13
- var context = document.getElementById('mc4wp-admin');
14
- var events = new EventEmitter();
15
 
16
- var tabs = require('./admin/tabs.js')(context);
17
 
18
- var helpers = require('./admin/helpers.js');
19
 
20
- var settings = require('./admin/settings.js')(context, helpers, events);
 
 
 
 
 
 
 
21
 
22
  (0, _tlite.default)(function (el) {
23
  return el.className.indexOf('mc4wp-tooltip') > -1;
@@ -289,7 +295,11 @@ var URL = require('./url.js'); // Tabs
289
 
290
 
291
  var Tabs = function Tabs(context) {
292
- // TODO: last piece of jQuery... can we get rid of it?
 
 
 
 
293
  var $ = window.jQuery;
294
  var $context = $(context);
295
  var $tabs = $context.find('.tab');
7
 
8
  var m = window.m = require('mithril');
9
 
10
+ var EventEmitter = require('wolfy87-eventemitter');
11
 
12
+ var Tabs = require('./admin/tabs.js');
13
 
14
+ var Settings = require('./admin/settings.js');
 
15
 
16
+ var helpers = require('./admin/helpers.js'); // vars
17
 
 
18
 
19
+ var context = document.getElementById('mc4wp-admin');
20
+ var tabs, settings;
21
+ var events = new EventEmitter();
22
+
23
+ if (context !== null) {
24
+ tabs = Tabs(context);
25
+ settings = Settings(context, helpers, events);
26
+ }
27
 
28
  (0, _tlite.default)(function (el) {
29
  return el.className.indexOf('mc4wp-tooltip') > -1;
295
 
296
 
297
  var Tabs = function Tabs(context) {
298
+ if (context === null) {
299
+ return;
300
+ } // TODO: last piece of jQuery... can we get rid of it?
301
+
302
+
303
  var $ = window.jQuery;
304
  var $context = $(context);
305
  var $tabs = $context.find('.tab');
assets/js/admin.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var l=void 0;!function o(a,l,s){function u(t,e){if(!l[t]){if(!a[t]){var n=!1;if(!e&&n)return n(t,!0);if(c)return c(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var i=l[t]={exports:{}};a[t][0].call(i.exports,function(e){return u(a[t][1][e]||e)},i,i.exports,o,a,l,s)}return l[t].exports}for(var c=!1,e=0;e<s.length;e++)u(s[e]);return u}({1:[function(e,t,n){"use strict";var r,i=(r=e("tlite"))&&r.__esModule?r:{default:r};var o=window.m=e("mithril"),a=e("wolfy87-eventemitter"),l=document.getElementById("mc4wp-admin"),s=new a,u=e("./admin/tabs.js")(l),c=e("./admin/helpers.js"),f=e("./admin/settings.js")(l,c,s);(0,i.default)(function(e){return-1<e.className.indexOf("mc4wp-tooltip")});var d=e("./admin/list-fetcher.js"),h=document.getElementById("mc4wp-list-fetcher");h&&o.mount(h,new d),e("./admin/fields/mailchimp-api-key.js"),window.mc4wp=window.mc4wp||{},window.mc4wp.deps=window.mc4wp.deps||{},window.mc4wp.deps.mithril=o,window.mc4wp.helpers=c,window.mc4wp.events=s,window.mc4wp.settings=f,window.mc4wp.tabs=u},{"./admin/fields/mailchimp-api-key.js":2,"./admin/helpers.js":3,"./admin/list-fetcher.js":4,"./admin/settings.js":5,"./admin/tabs.js":6,mithril:8,tlite:11,"wolfy87-eventemitter":12}],2:[function(e,t,n){"use strict";var r;function i(e){var t=document.createElement("p");t.className="help red",t.innerText=window.mc4wp_vars.i18n.invalid_api_key,r.nextElementSibling.innerText===t.innerText&&r.nextElementSibling.parentElement.removeChild(r.nextElementSibling),r.value.match(/^[0-9a-zA-Z*]{32}-[a-z]{2}[0-9]{1,2}$/)||r.parentElement.insertBefore(t,r.nextElementSibling)}(r=document.getElementById("mailchimp_api_key"))&&r.addEventListener("change",i)},{}],3:[function(e,t,n){"use strict";var r,a={};a.toggleElement=function(e){for(var t=document.querySelectorAll(e),n=0;n<t.length;n++){var r=t[n].clientHeight<=0;t[n].style.display=r?"":"none"}},a.bindEventToElement=function(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent&&e.attachEvent("on"+t,n)},a.bindEventToElements=function(e,t,n){Array.prototype.forEach.call(e,function(e){a.bindEventToElement(e,t,n)})},a.debounce=function(r,i,o){var a;return function(){var e=this,t=arguments,n=o&&!a;clearTimeout(a),a=setTimeout(function(){a=null,o||r.apply(e,t)},i),n&&r.apply(e,t)}},r=document.querySelectorAll("[data-showif]"),Array.prototype.forEach.call(r,function(e){var n=JSON.parse(e.getAttribute("data-showif")),t=document.querySelectorAll('[name="'+n.element+'"]'),r=e.querySelectorAll("input,select,textarea:not([readonly])"),i=void 0===n.hide||n.hide;function o(){if("radio"!==this.getAttribute("type")||this.checked){var t=("checkbox"===this.getAttribute("type")?this.checked:this.value)==n.value;i?(e.style.display=t?"":"none",e.style.visibility=t?"":"hidden"):e.style.opacity=t?"":"0.4",Array.prototype.forEach.call(r,function(e){t?e.removeAttribute("readonly"):e.setAttribute("readonly","readonly")})}}Array.prototype.forEach.call(t,function(e){o.call(e)}),a.bindEventToElements(t,"change",o)}),t.exports=a},{}],4:[function(e,t,n){"use strict";var r=window.jQuery,i=mc4wp_vars,o=i.i18n;function a(){this.working=!1,this.done=!1,i.mailchimp.api_connected&&0===i.mailchimp.lists.length&&this.fetch()}a.prototype.fetch=function(e){e&&e.preventDefault(),this.working=!0,this.done=!1,r.post(ajaxurl,{action:"mc4wp_renew_mailchimp_lists",timeout:6e5}).done(function(e){this.success=!0,e&&window.setTimeout(function(){window.location.reload()},3e3)}.bind(this)).fail(function(e){this.success=!1}.bind(this)).always(function(e){this.working=!1,this.done=!0,m.redraw()}.bind(this))},a.prototype.view=function(){return m("form",{method:"POST",onsubmit:this.fetch.bind(this)},[m("p",[m("input",{type:"submit",value:this.working?o.fetching_mailchimp_lists:o.renew_mailchimp_lists,className:"button",disabled:!!this.working}),m.trust(" &nbsp; "),this.working?[m("span.mc4wp-loader","Loading..."),m.trust(" &nbsp; "),m("em.help",o.fetching_mailchimp_lists_can_take_a_while)]:"",this.done?[this.success?m("em.help.green",o.fetching_mailchimp_lists_done):m("em.help.red",o.fetching_mailchimp_lists_error)]:""])])},t.exports=a},{}],5:[function(e,t,n){"use strict";function l(e){return(l="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){e.querySelector("form");var r=e.querySelectorAll(".mc4wp-list-input"),i=mc4wp_vars.mailchimp.lists,o=[];function a(){return o=[],Array.prototype.forEach.call(r,function(e){("boolean"!=typeof e.checked||e.checked)&&"object"===l(i[e.value])&&o.push(i[e.value])}),n.trigger("selectedLists.change",[o]),o}return n.on("selectedLists.change",function(){var e=document.querySelectorAll(".lists--only-selected > *");Array.prototype.forEach.call(e,function(e){var t,n,r=e.getAttribute("data-list-id");0<(t="id",n=r,o.filter(function(e){return e[t]===n})).length?e.setAttribute("class",e.getAttribute("class").replace("hidden","")):e.setAttribute("class",e.getAttribute("class")+" hidden")})}),t.bindEventToElements(r,"change",a),a(),{getSelectedLists:function(){return o}}}},{}],6:[function(e,t,n){"use strict";var d=e("./url.js");t.exports=function(i){var o=window.jQuery,e=o(i),r=e.find(".tab"),a=e.find(".nav-tab"),l=i.querySelector('input[name="_wp_http_referer"]'),s=[];function u(e){for(var t=0;t<s.length;t++)if(s[t].id===e)return s[t]}function c(e,t){if("string"==typeof e&&(e=u(e)),!e)return!1;null==t&&(t=!0),r.removeClass("tab-active").css("display","none"),a.removeClass("nav-tab-active"),Array.prototype.forEach.call(e.nav,function(e){e.className+=" nav-tab-active",e.blur()}),e.element.style.display="block",e.element.className+=" tab-active";var n=d.setParameter(window.location.href,"tab",e.id);return history.pushState&&t&&history.pushState(e.id,"",n),f(e),l.value=n,"function"==typeof tb_remove&&tb_remove(),"fields"===e.id&&window.mc4wp&&window.mc4wp.forms&&window.mc4wp.forms.editor&&mc4wp.forms.editor.refresh(),!0}function f(e){var t=document.title.split("-");document.title=document.title.replace(t[0],e.title+" ")}function t(e){e=e||window.event;var t=this.getAttribute("data-tab");if(!t){var n=this.className.match(/nav-tab-(\w+)?/);n&&(t=n[1])}if(!t){var r=d.parse(this.href);if(!r.tab)return;t=r.tab}return!c(t)||(e.preventDefault(),e.returnValue=!1)}return o.each(r,function(e,t){var n=t.id.substring(4),r=o(t).find("h2").first().text();s.push({id:n,title:r,element:t,nav:i.querySelectorAll(".nav-tab-"+n),open:function(){return c(n)}})}),a.click(t),o(document.body).on("click",".tab-link",t),function(){if(history.pushState){var e=r.filter(":visible").get(0);if(e){var t=u(e.id.substring(4));t&&(history.replaceState&&null===history.state&&history.replaceState(t.id,""),f(t))}}}(),window.addEventListener&&history.pushState&&window.addEventListener("popstate",function(e){return!e.state||c(e.state,!1)}),{open:c,get:u}}},{"./url.js":7}],7:[function(e,t,n){"use strict";var i={parse:function(e){var t={},n=e.split("&");for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t},build:function(e){var t=[];for(var n in e)t.push(n+"="+encodeURIComponent(e[n]));return t.join("&")},setParameter:function(e,t,n){var r=i.parse(e);return r[t]=n,i.build(r)}};t.exports=i},{}],8:[function(e,L,t){(function(k,S){!function(){"use strict";function z(e,t,n,r,i,o){return{tag:e,key:t,attrs:n,children:r,text:i,dom:o,domSize:void 0,state:void 0,_state:void 0,events:void 0,instance:void 0,skip:!1}}z.normalize=function(e){return Array.isArray(e)?z("[",void 0,void 0,z.normalizeChildren(e),void 0,void 0):null!=e&&"object"!=typeof e?z("#",void 0,void 0,!1===e?"":e,void 0,void 0):e},z.normalizeChildren=function(e){for(var t=0;t<e.length;t++)e[t]=z.normalize(e[t]);return e};var s=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,u={},c={}.hasOwnProperty;function f(e){for(var t in e)if(c.call(e,t))return!1;return!0}function e(e){var t,n=arguments[1],r=2;if(null==e||"string"!=typeof e&&"function"!=typeof e&&"function"!=typeof e.view)throw Error("The selector must be either a string or a component.");if("string"==typeof e)var i=u[e]||function(e){for(var t,n="div",r=[],i={};t=s.exec(e);){var o=t[1],a=t[2];if(""===o&&""!==a)n=a;else if("#"===o)i.id=a;else if("."===o)r.push(a);else if("["===t[3][0]){var l=t[6];l&&(l=l.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===t[4]?r.push(l):i[t[4]]=""===l?l:l||!0}}return 0<r.length&&(i.className=r.join(" ")),u[e]={tag:n,attrs:i}}(e);if(null==n?n={}:("object"!=typeof n||null!=n.tag||Array.isArray(n))&&(n={},r=1),arguments.length===r+1)t=arguments[r],Array.isArray(t)||(t=[t]);else for(t=[];r<arguments.length;)t.push(arguments[r++]);var o=z.normalizeChildren(t);return"string"==typeof e?function(e,t,n){var r,i,o=!1,a=t.className||t.class;if(!f(e.attrs)&&!f(t)){var l={};for(var s in t)c.call(t,s)&&(l[s]=t[s]);t=l}for(var s in e.attrs)c.call(e.attrs,s)&&(t[s]=e.attrs[s]);for(var s in void 0!==a&&(void 0!==t.class&&(t.class=void 0,t.className=a),null!=e.attrs.className&&(t.className=e.attrs.className+" "+a)),t)if(c.call(t,s)&&"key"!==s){o=!0;break}return Array.isArray(n)&&1===n.length&&null!=n[0]&&"#"===n[0].tag?i=n[0].children:r=n,z(e.tag,t.key,o?t:void 0,r,i)}(i,n,o):z(e,n.key,n,o)}e.trust=function(e){return null==e&&(e=""),z("<",void 0,void 0,e,void 0,void 0)},e.fragment=function(e,t){return z("[",e.key,e,z.normalizeChildren(t),void 0,void 0)};var t=e;if((d=function(e){if(!(this instanceof d))throw new Error("Promise must be called with `new`");if("function"!=typeof e)throw new TypeError("executor must be a function");var o=this,a=[],l=[],i=t(a,!0),s=t(l,!1),u=o._instance={resolvers:a,rejectors:l},c="function"==typeof S?S:setTimeout;function t(r,i){return function t(n){var e;try{if(!i||null==n||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof(e=n.then))c(function(){i||0!==r.length||console.error("Possible unhandled promise rejection:",n);for(var e=0;e<r.length;e++)r[e](n);a.length=0,l.length=0,u.state=i,u.retry=function(){t(n)}});else{if(n===o)throw new TypeError("Promise can't be resolved w/ itself");f(e.bind(n))}}catch(e){s(e)}}}function f(e){var n=0;function t(t){return function(e){0<n++||t(e)}}var r=t(s);try{e(t(i),r)}catch(e){r(e)}}f(e)}).prototype.then=function(e,t){var i,o,a=this._instance;function n(t,e,n,r){e.push(function(e){if("function"!=typeof t)n(e);else try{i(t(e))}catch(e){o&&o(e)}}),"function"==typeof a.retry&&r===a.state&&a.retry()}var r=new d(function(e,t){i=e,o=t});return n(e,a.resolvers,i,!0),n(t,a.rejectors,o,!1),r},d.prototype.catch=function(e){return this.then(null,e)},d.resolve=function(t){return t instanceof d?t:new d(function(e){e(t)})},d.reject=function(n){return new d(function(e,t){t(n)})},d.all=function(l){return new d(function(n,r){var i=l.length,o=0,a=[];if(0===l.length)n([]);else for(var e=0;e<l.length;e++)!function(t){function e(e){o++,a[t]=e,o===i&&n(a)}null==l[t]||"object"!=typeof l[t]&&"function"!=typeof l[t]||"function"!=typeof l[t].then?e(l[t]):l[t].then(e,r)}(e)})},d.race=function(r){return new d(function(e,t){for(var n=0;n<r.length;n++)r[n].then(e,t)})},"undefined"!=typeof window){void 0===window.Promise&&(window.Promise=d);var d=window.Promise}else if(void 0!==k){void 0===k.Promise&&(k.Promise=d);d=k.Promise}var v=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var r=[];for(var t in e)i(t,e[t]);return r.join("&");function i(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)i(e+"["+n+"]",t[n]);else if("[object Object]"===Object.prototype.toString.call(t))for(var n in t)i(e+"["+n+"]",t[n]);else r.push(encodeURIComponent(e)+(null!=t&&""!==t?"="+encodeURIComponent(t):""))}},m=new RegExp("^file://","i"),n=function(s,r){var t,o=0;function a(){var i=0;function o(){0==--i&&"function"==typeof t&&t()}return function t(n){var r=n.then;return n.then=function(){i++;var e=r.apply(n,arguments);return e.then(o,function(e){if(o(),0===i)throw e}),t(e)},n}}function u(e,t){if("string"==typeof e){var n=e;null==(e=t||{}).url&&(e.url=n)}return e}function c(e,t){if(null==t)return e;for(var n=e.match(/:[^\/]+/gi)||[],r=0;r<n.length;r++){var i=n[r].slice(1);null!=t[i]&&(e=e.replace(n[r],t[i]))}return e}function f(e,t){var n=v(t);if(""!==n){var r=e.indexOf("?")<0?"?":"&";e+=r+n}return e}function d(t){try{return""!==t?JSON.parse(t):null}catch(e){throw new Error(t)}}function h(e){return e.responseText}function p(e,t){if("function"==typeof e){if(!Array.isArray(t))return new e(t);for(var n=0;n<t.length;n++)t[n]=new e(t[n])}return t}return{request:function(l,e){var t=a();l=u(l,e);var n=new r(function(r,i){null==l.method&&(l.method="GET"),l.method=l.method.toUpperCase();var e="GET"!==l.method&&"TRACE"!==l.method&&("boolean"!=typeof l.useBody||l.useBody);"function"!=typeof l.serialize&&(l.serialize="undefined"!=typeof FormData&&l.data instanceof FormData?function(e){return e}:JSON.stringify),"function"!=typeof l.deserialize&&(l.deserialize=d),"function"!=typeof l.extract&&(l.extract=h),l.url=c(l.url,l.data),e?l.data=l.serialize(l.data):l.url=f(l.url,l.data);var o=new s.XMLHttpRequest,a=!1,t=o.abort;for(var n in o.abort=function(){a=!0,t.call(o)},o.open(l.method,l.url,"boolean"!=typeof l.async||l.async,"string"==typeof l.user?l.user:void 0,"string"==typeof l.password?l.password:void 0),l.serialize!==JSON.stringify||!e||l.headers&&l.headers.hasOwnProperty("Content-Type")||o.setRequestHeader("Content-Type","application/json; charset=utf-8"),l.deserialize!==d||l.headers&&l.headers.hasOwnProperty("Accept")||o.setRequestHeader("Accept","application/json, text/*"),l.withCredentials&&(o.withCredentials=l.withCredentials),l.headers)({}).hasOwnProperty.call(l.headers,n)&&o.setRequestHeader(n,l.headers[n]);"function"==typeof l.config&&(o=l.config(o,l)||o),o.onreadystatechange=function(){if(!a&&4===o.readyState)try{var e=l.extract!==h?l.extract(o,l):l.deserialize(l.extract(o,l));if(200<=o.status&&o.status<300||304===o.status||m.test(l.url))r(p(l.type,e));else{var t=new Error(o.responseText);for(var n in e)t[n]=e[n];i(t)}}catch(e){i(e)}},e&&null!=l.data?o.send(l.data):o.send()});return!0===l.background?n:t(n)},jsonp:function(i,e){var t=a();i=u(i,e);var n=new r(function(t,e){var n=i.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+o++,r=s.document.createElement("script");s[n]=function(e){r.parentNode.removeChild(r),t(p(i.type,e)),delete s[n]},r.onerror=function(){r.parentNode.removeChild(r),e(new Error("JSONP request failed")),delete s[n]},null==i.data&&(i.data={}),i.url=c(i.url,i.data),i.data[i.callbackKey||"callback"]=n,r.src=f(i.url,i.data),s.document.documentElement.appendChild(r)});return!0===i.background?n:t(n)},setCompletionCallback:function(e){t=e}}}(window,d),r=function(e){var a,d=e.document,u=d.createDocumentFragment(),t={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function h(e){return e.attrs&&e.attrs.xmlns||t[e.tag]}function b(e,t,n,r,i,o,a){for(var l=n;l<r;l++){var s=t[l];null!=s&&x(e,s,i,a,o)}}function x(e,t,n,r,i){var o,a,l,s=t.tag;if("string"!=typeof s)return function(e,t,n,r,i){{if(v(t,n),null==t.instance)return t.domSize=0,u;var o=x(e,t.instance,n,r,i);return t.dom=t.instance.dom,t.domSize=null!=t.dom?t.instance.domSize:0,k(e,o,i),o}}(e,t,n,r,i);switch(t.state={},null!=t.attrs&&j(t.attrs,t,n),s){case"#":return o=e,l=i,(a=t).dom=d.createTextNode(a.children),k(o,a.dom,l),a.dom;case"<":return p(e,t,i);case"[":return function(e,t,n,r,i){var o=d.createDocumentFragment();if(null!=t.children){var a=t.children;b(o,a,0,a.length,n,null,r)}return t.dom=o.firstChild,t.domSize=o.childNodes.length,k(e,o,i),o}(e,t,n,r,i);default:return function(e,t,n,r,i){var o=t.tag,a=t.attrs,l=a&&a.is,s=(r=h(t)||r)?l?d.createElementNS(r,o,{is:l}):d.createElementNS(r,o):l?d.createElement(o,{is:l}):d.createElement(o);t.dom=s,null!=a&&function(e,t,n){for(var r in t)w(e,r,null,t[r],n)}(t,a,r);if(k(e,s,i),null!=t.attrs&&null!=t.attrs.contenteditable)y(t);else if(null!=t.text&&(""!==t.text?s.textContent=t.text:t.children=[z("#",void 0,void 0,t.text,void 0,void 0)]),null!=t.children){var u=t.children;b(s,u,0,u.length,n,null,r),f=(c=t).attrs,"select"===c.tag&&null!=f&&("value"in f&&w(c,"value",null,f.value,void 0),"selectedIndex"in f&&w(c,"selectedIndex",null,f.selectedIndex,void 0))}var c,f;return s}(e,t,n,r,i)}}function p(e,t,n){var r={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"}[(t.children.match(/^\s*?<(\w+)/im)||[])[1]]||"div",i=d.createElement(r);i.innerHTML=t.children,t.dom=i.firstChild,t.domSize=i.childNodes.length;for(var o,a=d.createDocumentFragment();o=i.firstChild;)a.appendChild(o);return k(e,a,n),a}function v(e,t){var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return u;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return u;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}if(e._state=e.state,null!=e.attrs&&j(e.attrs,e,t),j(e._state,e,t),e.instance=z.normalize(e._state.view.call(e.state,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null}function m(e,t,n,r,i,o,a){if(t!==n&&(null!=t||null!=n))if(null==t)b(e,n,0,n.length,i,o,a);else if(null==n)S(t,0,t.length,n);else{if(t.length===n.length){for(var l=!1,s=0;s<n.length;s++)if(null!=n[s]&&null!=t[s]){l=null==n[s].key&&null==t[s].key;break}if(l){for(s=0;s<t.length;s++)t[s]!==n[s]&&(null==t[s]&&null!=n[s]?x(e,n[s],i,a,A(t,s+1,o)):null==n[s]?S(t,s,s+1,n):E(e,t[s],n[s],i,A(t,s+1,o),r,a));return}}if(r=r||function(e,t){if(null!=e.pool&&Math.abs(e.pool.length-t.length)<=Math.abs(e.length-t.length)){var n=e[0]&&e[0].children&&e[0].children.length||0,r=e.pool[0]&&e.pool[0].children&&e.pool[0].children.length||0,i=t[0]&&t[0].children&&t[0].children.length||0;if(Math.abs(r-i)<=Math.abs(n-i))return!0}return!1}(t,n)){var u=t.pool;t=t.concat(t.pool)}for(var c,f=0,d=0,h=t.length-1,p=n.length-1;f<=h&&d<=p;){if((m=t[f])!==(y=n[d])||r)if(null==m)f++;else if(null==y)d++;else if(m.key===y.key){var v=null!=u&&f>=t.length-u.length||null==u&&r;d++,E(e,m,y,i,A(t,++f,o),v,a),r&&m.tag===y.tag&&k(e,T(m),o)}else{if((m=t[h])!==y||r)if(null==m)h--;else if(null==y)d++;else{if(m.key!==y.key)break;v=null!=u&&h>=t.length-u.length||null==u&&r;E(e,m,y,i,A(t,h+1,o),v,a),(r||d<p)&&k(e,T(m),A(t,f,o)),h--,d++}else h--,d++}else f++,d++}for(;f<=h&&d<=p;){var m,y;if((m=t[h])!==(y=n[p])||r)if(null==m)h--;else if(null==y)p--;else if(m.key===y.key){v=null!=u&&h>=t.length-u.length||null==u&&r;E(e,m,y,i,A(t,h+1,o),v,a),r&&m.tag===y.tag&&k(e,T(m),o),null!=m.dom&&(o=m.dom),h--,p--}else{if(c||(c=_(t,h)),null!=y){var g=c[y.key];if(null!=g){var w=t[g];v=null!=u&&g>=t.length-u.length||null==u&&r;E(e,w,y,i,A(t,h+1,o),r,a),k(e,T(w),o),t[g].skip=!0,null!=w.dom&&(o=w.dom)}else{o=x(e,y,i,a,o)}}p--}else h--,p--;if(p<d)break}b(e,n,d,p+1,i,o,a),S(t,f,h+1,n)}}function E(e,t,n,r,i,o,a){var l,s,u,c,f=t.tag;if(f===n.tag){if(n.state=t.state,n._state=t._state,n.events=t.events,!o&&function(e,t){var n,r;null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate&&(n=e.attrs.onbeforeupdate.call(e.state,e,t));"string"!=typeof e.tag&&"function"==typeof e._state.onbeforeupdate&&(r=e._state.onbeforeupdate.call(e.state,e,t));return!(void 0===n&&void 0===r||n||r||(e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,0))}(n,t))return;if("string"==typeof f)switch(null!=n.attrs&&(o?(n.state={},j(n.attrs,n,r)):O(n.attrs,n,r)),f){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(t,n);break;case"<":l=e,u=n,c=i,(s=t).children!==u.children?(T(s),p(l,u,c)):(u.dom=s.dom,u.domSize=s.domSize);break;case"[":!function(e,t,n,r,i,o,a){m(e,t.children,n.children,r,i,o,a);var l=0,s=n.children;if((n.dom=null)!=s){for(var u=0;u<s.length;u++){var c=s[u];null!=c&&null!=c.dom&&(null==n.dom&&(n.dom=c.dom),l+=c.domSize||1)}1!==l&&(n.domSize=l)}}(e,t,n,o,r,i,a);break;default:!function(e,t,n,r,i){var o=t.dom=e.dom;i=h(t)||i,"textarea"===t.tag&&(null==t.attrs&&(t.attrs={}),null!=t.text&&(t.attrs.value=t.text,t.text=void 0));(function(e,t,n,r){if(null!=n)for(var i in n)w(e,i,t&&t[i],n[i],r);if(null!=t)for(var i in t)null!=n&&i in n||("className"===i&&(i="class"),"o"!==i[0]||"n"!==i[1]||L(i)?"key"!==i&&e.dom.removeAttribute(i):C(e,i,void 0))})(t,e.attrs,t.attrs,i),null!=t.attrs&&null!=t.attrs.contenteditable?y(t):null!=e.text&&null!=t.text&&""!==t.text?e.text.toString()!==t.text.toString()&&(e.dom.firstChild.nodeValue=t.text):(null!=e.text&&(e.children=[z("#",void 0,void 0,e.text,void 0,e.dom.firstChild)]),null!=t.text&&(t.children=[z("#",void 0,void 0,t.text,void 0,void 0)]),m(o,e.children,t.children,n,r,null,i))}(t,n,o,r,a)}else!function(e,t,n,r,i,o,a){if(o)v(n,r);else{if(n.instance=z.normalize(n._state.view.call(n.state,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");null!=n.attrs&&O(n.attrs,n,r),O(n._state,n,r)}null!=n.instance?(null==t.instance?x(e,n.instance,r,a,i):E(e,t.instance,n.instance,r,i,o,a),n.dom=n.instance.dom,n.domSize=n.instance.domSize):null!=t.instance?(g(t.instance,null),n.dom=void 0,n.domSize=0):(n.dom=t.dom,n.domSize=t.domSize)}(e,t,n,r,i,o,a)}else g(t,null),x(e,n,r,a,i)}function _(e,t){var n={},r=0;for(r=0;r<t;r++){var i=e[r];if(null!=i){var o=i.key;null!=o&&(n[o]=r)}}return n}function T(e){var t=e.domSize;if(null==t&&null!=e.dom)return e.dom;var n=d.createDocumentFragment();if(0<t){for(var r=e.dom;--t;)n.appendChild(r.nextSibling);n.insertBefore(r,n.firstChild)}return n}function A(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function k(e,t,n){n&&n.parentNode?e.insertBefore(t,n):e.appendChild(t)}function y(e){var t=e.children;if(null!=t&&1===t.length&&"<"===t[0].tag){var n=t[0].children;e.dom.innerHTML!==n&&(e.dom.innerHTML=n)}else if(null!=e.text||null!=t&&0!==t.length)throw new Error("Child node of a contenteditable must be trusted")}function S(e,t,n,r){for(var i=t;i<n;i++){var o=e[i];null!=o&&(o.skip?o.skip=!1:g(o,r))}}function g(r,i){var e,o=1,a=0;r.attrs&&"function"==typeof r.attrs.onbeforeremove&&(null!=(e=r.attrs.onbeforeremove.call(r.state,r))&&"function"==typeof e.then&&(o++,e.then(t,t)));"string"!=typeof r.tag&&"function"==typeof r._state.onbeforeremove&&(null!=(e=r._state.onbeforeremove.call(r.state,r))&&"function"==typeof e.then&&(o++,e.then(t,t)));function t(){if(++a===o&&(function e(t){t.attrs&&"function"==typeof t.attrs.onremove&&t.attrs.onremove.call(t.state,t);if("string"!=typeof t.tag)"function"==typeof t._state.onremove&&t._state.onremove.call(t.state,t),null!=t.instance&&e(t.instance);else{var n=t.children;if(Array.isArray(n))for(var r=0;r<n.length;r++){var i=n[r];null!=i&&e(i)}}}(r),r.dom)){var e=r.domSize||1;if(1<e)for(var t=r.dom;--e;)l(t.nextSibling);l(r.dom),null==i||null!=r.domSize||null!=(n=r.attrs)&&(n.oncreate||n.onupdate||n.onbeforeremove||n.onremove)||"string"!=typeof r.tag||(i.pool?i.pool.push(r):i.pool=[r])}var n}t()}function l(e){var t=e.parentNode;null!=t&&t.removeChild(e)}function w(e,t,n,r,i){var o=e.dom;if("key"!==t&&"is"!==t&&(n!==r||(a=e,"value"===(l=t)||"checked"===l||"selectedIndex"===l||"selected"===l&&a.dom===d.activeElement)||"object"==typeof r)&&void 0!==r&&!L(t)){var a,l,s,u,c=t.indexOf(":");if(-1<c&&"xlink"===t.substr(0,c))o.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(c+1),r);else if("o"===t[0]&&"n"===t[1]&&"function"==typeof r)C(e,t,r);else if("style"===t)!function(e,t,n){t===n&&(e.style.cssText="",t=null);if(null==n)e.style.cssText="";else if("string"==typeof n)e.style.cssText=n;else{for(var r in"string"==typeof t&&(e.style.cssText=""),n)e.style[r]=n[r];if(null!=t&&"string"!=typeof t)for(var r in t)r in n||(e.style[r]="")}}(o,n,r);else if(t in o&&("href"!==(u=t)&&"list"!==u&&"form"!==u&&"width"!==u&&"height"!==u)&&void 0===i&&!((s=e).attrs.is||-1<s.tag.indexOf("-"))){if("value"===t){var f=""+r;if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===f&&e.dom===d.activeElement)return;if("select"===e.tag)if(null===r){if(-1===e.dom.selectedIndex&&e.dom===d.activeElement)return}else if(null!==n&&e.dom.value===f&&e.dom===d.activeElement)return;if("option"===e.tag&&null!=n&&e.dom.value===f)return}if("input"===e.tag&&"type"===t)return void o.setAttribute(t,r);o[t]=r}else"boolean"==typeof r?r?o.setAttribute(t,""):o.removeAttribute(t):o.setAttribute("className"===t?"class":t,r)}}function L(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function C(e,t,n){var r=e.dom,i="function"!=typeof a?n:function(e){var t=n.call(r,e);return a.call(r,e),t};if(t in r)r[t]="function"==typeof n?i:null;else{var o=t.slice(2);if(void 0===e.events&&(e.events={}),e.events[t]===i)return;null!=e.events[t]&&r.removeEventListener(o,e.events[t],!1),"function"==typeof n&&(e.events[t]=i,r.addEventListener(o,e.events[t],!1))}}function j(e,t,n){"function"==typeof e.oninit&&e.oninit.call(t.state,t),"function"==typeof e.oncreate&&n.push(e.oncreate.bind(t.state,t))}function O(e,t,n){"function"==typeof e.onupdate&&n.push(e.onupdate.bind(t.state,t))}return{render:function(e,t){if(!e)throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var n=[],r=d.activeElement,i=e.namespaceURI;null==e.vnodes&&(e.textContent=""),Array.isArray(t)||(t=[t]),m(e,e.vnodes,z.normalizeChildren(t),!1,n,null,"http://www.w3.org/1999/xhtml"===i?void 0:i),e.vnodes=t,null!=r&&d.activeElement!==r&&r.focus();for(var o=0;o<n.length;o++)n[o]()},setEventCallback:function(e){return a=e}}};var i=function(e){var t=r(e);t.setEventCallback(function(e){!1===e.redraw?e.redraw=void 0:n()});var a=[];function l(e){var t=a.indexOf(e);-1<t&&a.splice(t,2)}function n(){for(var e=1;e<a.length;e+=2)a[e]()}return{subscribe:function(e,t){var n,r,i,o;l(e),a.push(e,(n=t,r=0,i=null,o="function"==typeof requestAnimationFrame?requestAnimationFrame:setTimeout,function(){var e=Date.now();0===r||16<=e-r?(r=e,n()):null===i&&(i=o(function(){i=null,n(),r=Date.now()},16-(e-r)))}))},unsubscribe:l,redraw:n,render:t.render}}(window);n.setCompletionCallback(i.redraw);var o;t.mount=(o=i,function(e,t){if(null===t)return o.render(e,[]),void o.unsubscribe(e);if(null==t.view&&"function"!=typeof t)throw new Error("m.mount(element, component) expects a component, not a vnode");o.subscribe(e,function(){o.render(e,z(t))}),o.redraw()});var a,l,h,p,y,g,w,b,x,E=d,_=function(e){if(""===e||null==e)return{};"?"===e.charAt(0)&&(e=e.slice(1));for(var t=e.split("&"),n={},r={},i=0;i<t.length;i++){var o=t[i].split("="),a=decodeURIComponent(o[0]),l=2===o.length?decodeURIComponent(o[1]):"";"true"===l?l=!0:"false"===l&&(l=!1);var s=a.split(/\]\[?|\[/),u=n;-1<a.indexOf("[")&&s.pop();for(var c=0;c<s.length;c++){var f=s[c],d=s[c+1],h=""==d||!isNaN(parseInt(d,10)),p=c===s.length-1;if(""===f)null==r[a=s.slice(0,c).join()]&&(r[a]=0),f=r[a]++;null==u[f]&&(u[f]=p?l:h?[]:{}),u=u[f]}}return n},T=function(c){var n,f="function"==typeof c.history.pushState,r="function"==typeof S?S:setTimeout;function e(e){var t=c.location[e].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);return"pathname"===e&&"/"!==t[0]&&(t="/"+t),t}function d(e,t,n){var r=e.indexOf("?"),i=e.indexOf("#"),o=-1<r?r:-1<i?i:e.length;if(-1<r){var a=-1<i?i:e.length,l=_(e.slice(r+1,a));for(var s in l)t[s]=l[s]}if(-1<i){var u=_(e.slice(i+1));for(var s in u)n[s]=u[s]}return e.slice(0,o)}var h={prefix:"#!",getPath:function(){switch(h.prefix.charAt(0)){case"#":return e("hash").slice(h.prefix.length);case"?":return e("search").slice(h.prefix.length)+e("hash");default:return e("pathname").slice(h.prefix.length)+e("search")+e("hash")}},setPath:function(e,n,t){var r={},i={};if(e=d(e,r,i),null!=n){for(var o in n)r[o]=n[o];e=e.replace(/:([^\/]+)/g,function(e,t){return delete r[t],n[t]})}var a=v(r);a&&(e+="?"+a);var l=v(i);if(l&&(e+="#"+l),f){var s=t?t.state:null,u=t?t.title:null;c.onpopstate(),t&&t.replace?c.history.replaceState(s,u,h.prefix+e):c.history.pushState(s,u,h.prefix+e)}else c.location.href=h.prefix+e}};return h.defineRoutes=function(l,s,u){function e(){var r=h.getPath(),i={},e=d(r,i,i),t=c.history.state;if(null!=t)for(var n in t)i[n]=t[n];for(var o in l){var a=new RegExp("^"+o.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(a.test(e))return void e.replace(a,function(){for(var e=o.match(/:[^\/]+/g)||[],t=[].slice.call(arguments,1,-2),n=0;n<e.length;n++)i[e[n].replace(/:|\./g,"")]=decodeURIComponent(t[n]);s(l[o],i,r,o)})}u(r,i)}var t;f?c.onpopstate=(t=e,function(){null==n&&(n=r(function(){n=null,t()}))}):"#"===h.prefix.charAt(0)&&(c.onhashchange=e),e()},h};t.route=(a=window,l=i,b=T(a),(x=function(e,t,n){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var o=function(){null!=h&&l.render(e,h(z(p,y.key,y)))},a=function(e){if(e===t)throw new Error("Could not resolve default route "+t);b.setPath(t,null,{replace:!0})};b.defineRoutes(n,function(t,n,r){var i=w=function(e,t){i===w&&(p=null==t||"function"!=typeof t.view&&"function"!=typeof t?"div":t,y=n,g=r,w=null,h=(e.render||function(e){return e}).bind(e),o())};t.view||"function"==typeof t?i({},t):t.onmatch?E.resolve(t.onmatch(n,r)).then(function(e){i(t,e)},a):i(t,"div")},a),l.subscribe(e,o)}).set=function(e,t,n){null!=w&&((n=n||{}).replace=!0),w=null,b.setPath(e,t,n)},x.get=function(){return g},x.prefix=function(e){b.prefix=e},x.link=function(e){e.dom.setAttribute("href",b.prefix+e.attrs.href),e.dom.onclick=function(e){if(!(e.ctrlKey||e.metaKey||e.shiftKey||2===e.which)){e.preventDefault(),e.redraw=!1;var t=this.getAttribute("href");0===t.indexOf(b.prefix)&&(t=t.slice(b.prefix.length)),x.set(t,void 0,void 0)}}},x.param=function(e){return void 0!==y&&void 0!==e?y[e]:y},x),t.withAttr=function(t,n,r){return function(e){n.call(r||this,t in e.currentTarget?e.currentTarget[t]:e.currentTarget.getAttribute(t))}};var A=r(window);t.render=A.render,t.redraw=i.redraw,t.request=n.request,t.jsonp=n.jsonp,t.parseQueryString=_,t.buildQueryString=v,t.version="1.1.6",t.vnode=z,void 0!==L?L.exports=t:window.m=t}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{timers:10}],9:[function(e,t,n){var r,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{i="function"==typeof clearTimeout?clearTimeout:l}catch(e){i=l}}();var u,c=[],f=!1,d=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):d=-1,c.length&&p())}function p(){if(!f){var e=s(h);f=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,f=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===l||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(e)}}function v(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new v(e,t)),1!==c.length||f||s(p)},v.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],10:[function(s,e,u){(function(e,t){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,i=Array.prototype.slice,o={},a=0;function l(e,t){this._id=e,this._clearFn=t}u.setTimeout=function(){return new l(n.call(setTimeout,window,arguments),clearTimeout)},u.setInterval=function(){return new l(n.call(setInterval,window,arguments),clearInterval)},u.clearTimeout=u.clearInterval=function(e){e.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},u.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},u.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},u._unrefActive=u.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},u.setImmediate="function"==typeof e?e:function(e){var t=a++,n=!(arguments.length<2)&&i.call(arguments,1);return o[t]=!0,r(function(){o[t]&&(n?e.apply(null,n):e.call(null),u.clearImmediate(t))}),t},u.clearImmediate="function"==typeof t?t:function(e){delete o[e]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":9,timers:10}],11:[function(e,t,n){function u(r){document.addEventListener("mouseover",function(e){var t=e.target,n=r(t);n||(n=(t=t.parentElement)&&r(t)),n&&u.show(t,n,!0)})}u.show=function(e,t,l){var s="data-tlite";t=t||{},(e.tooltip||function(e,t){var n,r,i;function o(){u.hide(e,!0)}function a(){n||(n=function(l,e,t){var s=document.createElement("span"),n=t.grav||l.getAttribute("data-tlite")||"n";s.innerHTML=e,l.appendChild(s);var u=n[0]||"",c=n[1]||"";function r(){s.className="tlite tlite-"+u+c;var e=l.offsetTop,t=l.offsetLeft;s.offsetParent===l&&(e=t=0);var n=l.offsetWidth,r=l.offsetHeight,i=s.offsetHeight,o=s.offsetWidth,a=t+n/2;s.style.top=("s"===u?e-i-10:"n"===u?e+r+10:e+r/2-i/2)+"px",s.style.left=("w"===c?t:"e"===c?t+n-o:"w"===u?t+n+10:"e"===u?t-o-10:a-o/2)+"px"}r();var i=s.getBoundingClientRect();"s"===u&&i.top<0?(u="n",r()):"n"===u&&i.bottom>window.innerHeight?(u="s",r()):"e"===u&&i.left<0?(u="w",r()):"w"===u&&i.right>window.innerWidth&&(u="e",r());return s.className+=" tlite-visible",s}(e,i,t))}return e.addEventListener("mousedown",o),e.addEventListener("mouseleave",o),e.tooltip={show:function(){i=e.title||e.getAttribute(s)||i,e.title="",e.setAttribute(s,""),i&&!r&&(r=setTimeout(a,l?150:1))},hide:function(e){if(l===e){r=clearTimeout(r);var t=n&&n.parentNode;t&&t.removeChild(n),n=void 0}}}}(e,t)).show()},u.hide=function(e,t){e.tooltip&&e.tooltip.hide(t)},void 0!==t&&t.exports&&(t.exports=u)},{}],12:[function(e,a,t){!function(e){"use strict";function t(){}var n=t.prototype,r=e.EventEmitter;function o(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function i(e){return function(){return this[e].apply(this,arguments)}}n.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp)for(n in t={},r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n]);else t=r[e]||(r[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,r=this.getListenersAsObject(e),i="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&-1===o(r[n],t)&&r[n].push(i?t:{listener:t,once:!1});return this},n.on=i("addListener"),n.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},n.once=i("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,r,i=this.getListenersAsObject(e);for(r in i)i.hasOwnProperty(r)&&-1!==(n=o(i[r],t))&&i[r].splice(n,1);return this},n.off=i("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 r,i,o=e?this.removeListener:this.addListener,a=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)o.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?o.call(this,r,i):a.call(this,r,i));return this},n.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},n.removeAllListeners=i("removeEvent"),n.emitEvent=function(e,t){var n,r,i,o,a=this.getListenersAsObject(e);for(o in a)if(a.hasOwnProperty(o))for(n=a[o].slice(0),i=0;i<n.length;i++)!0===(r=n[i]).once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},n.trigger=i("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=r,t},"function"==typeof l&&l.amd?l(function(){return t}):"object"==typeof a&&a.exports?a.exports=t:e.EventEmitter=t}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=admin.min.js.map
1
+ !function(){var a=void 0;!function o(l,a,s){function u(t,e){if(!a[t]){if(!l[t]){var n=!1;if(!e&&n)return n(t,!0);if(c)return c(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var i=a[t]={exports:{}};l[t][0].call(i.exports,function(e){return u(l[t][1][e]||e)},i,i.exports,o,l,a,s)}return a[t].exports}for(var c=!1,e=0;e<s.length;e++)u(s[e]);return u}({1:[function(e,t,n){"use strict";var r,i=(r=e("tlite"))&&r.__esModule?r:{default:r};var o,l,a=window.m=e("mithril"),s=e("wolfy87-eventemitter"),u=e("./admin/tabs.js"),c=e("./admin/settings.js"),f=e("./admin/helpers.js"),d=document.getElementById("mc4wp-admin"),h=new s;null!==d&&(o=u(d),l=c(d,f,h)),(0,i.default)(function(e){return-1<e.className.indexOf("mc4wp-tooltip")});var p=e("./admin/list-fetcher.js"),v=document.getElementById("mc4wp-list-fetcher");v&&a.mount(v,new p),e("./admin/fields/mailchimp-api-key.js"),window.mc4wp=window.mc4wp||{},window.mc4wp.deps=window.mc4wp.deps||{},window.mc4wp.deps.mithril=a,window.mc4wp.helpers=f,window.mc4wp.events=h,window.mc4wp.settings=l,window.mc4wp.tabs=o},{"./admin/fields/mailchimp-api-key.js":2,"./admin/helpers.js":3,"./admin/list-fetcher.js":4,"./admin/settings.js":5,"./admin/tabs.js":6,mithril:8,tlite:11,"wolfy87-eventemitter":12}],2:[function(e,t,n){"use strict";var r;function i(e){var t=document.createElement("p");t.className="help red",t.innerText=window.mc4wp_vars.i18n.invalid_api_key,r.nextElementSibling.innerText===t.innerText&&r.nextElementSibling.parentElement.removeChild(r.nextElementSibling),r.value.match(/^[0-9a-zA-Z*]{32}-[a-z]{2}[0-9]{1,2}$/)||r.parentElement.insertBefore(t,r.nextElementSibling)}(r=document.getElementById("mailchimp_api_key"))&&r.addEventListener("change",i)},{}],3:[function(e,t,n){"use strict";var r,l={};l.toggleElement=function(e){for(var t=document.querySelectorAll(e),n=0;n<t.length;n++){var r=t[n].clientHeight<=0;t[n].style.display=r?"":"none"}},l.bindEventToElement=function(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent&&e.attachEvent("on"+t,n)},l.bindEventToElements=function(e,t,n){Array.prototype.forEach.call(e,function(e){l.bindEventToElement(e,t,n)})},l.debounce=function(r,i,o){var l;return function(){var e=this,t=arguments,n=o&&!l;clearTimeout(l),l=setTimeout(function(){l=null,o||r.apply(e,t)},i),n&&r.apply(e,t)}},r=document.querySelectorAll("[data-showif]"),Array.prototype.forEach.call(r,function(e){var n=JSON.parse(e.getAttribute("data-showif")),t=document.querySelectorAll('[name="'+n.element+'"]'),r=e.querySelectorAll("input,select,textarea:not([readonly])"),i=void 0===n.hide||n.hide;function o(){if("radio"!==this.getAttribute("type")||this.checked){var t=("checkbox"===this.getAttribute("type")?this.checked:this.value)==n.value;i?(e.style.display=t?"":"none",e.style.visibility=t?"":"hidden"):e.style.opacity=t?"":"0.4",Array.prototype.forEach.call(r,function(e){t?e.removeAttribute("readonly"):e.setAttribute("readonly","readonly")})}}Array.prototype.forEach.call(t,function(e){o.call(e)}),l.bindEventToElements(t,"change",o)}),t.exports=l},{}],4:[function(e,t,n){"use strict";var r=window.jQuery,i=mc4wp_vars,o=i.i18n;function l(){this.working=!1,this.done=!1,i.mailchimp.api_connected&&0===i.mailchimp.lists.length&&this.fetch()}l.prototype.fetch=function(e){e&&e.preventDefault(),this.working=!0,this.done=!1,r.post(ajaxurl,{action:"mc4wp_renew_mailchimp_lists",timeout:6e5}).done(function(e){this.success=!0,e&&window.setTimeout(function(){window.location.reload()},3e3)}.bind(this)).fail(function(e){this.success=!1}.bind(this)).always(function(e){this.working=!1,this.done=!0,m.redraw()}.bind(this))},l.prototype.view=function(){return m("form",{method:"POST",onsubmit:this.fetch.bind(this)},[m("p",[m("input",{type:"submit",value:this.working?o.fetching_mailchimp_lists:o.renew_mailchimp_lists,className:"button",disabled:!!this.working}),m.trust(" &nbsp; "),this.working?[m("span.mc4wp-loader","Loading..."),m.trust(" &nbsp; "),m("em.help",o.fetching_mailchimp_lists_can_take_a_while)]:"",this.done?[this.success?m("em.help.green",o.fetching_mailchimp_lists_done):m("em.help.red",o.fetching_mailchimp_lists_error)]:""])])},t.exports=l},{}],5:[function(e,t,n){"use strict";function a(e){return(a="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){e.querySelector("form");var r=e.querySelectorAll(".mc4wp-list-input"),i=mc4wp_vars.mailchimp.lists,o=[];function l(){return o=[],Array.prototype.forEach.call(r,function(e){("boolean"!=typeof e.checked||e.checked)&&"object"===a(i[e.value])&&o.push(i[e.value])}),n.trigger("selectedLists.change",[o]),o}return n.on("selectedLists.change",function(){var e=document.querySelectorAll(".lists--only-selected > *");Array.prototype.forEach.call(e,function(e){var t,n,r=e.getAttribute("data-list-id");0<(t="id",n=r,o.filter(function(e){return e[t]===n})).length?e.setAttribute("class",e.getAttribute("class").replace("hidden","")):e.setAttribute("class",e.getAttribute("class")+" hidden")})}),t.bindEventToElements(r,"change",l),l(),{getSelectedLists:function(){return o}}}},{}],6:[function(e,t,n){"use strict";var d=e("./url.js");t.exports=function(i){if(null!==i){var o=window.jQuery,e=o(i),r=e.find(".tab"),l=e.find(".nav-tab"),a=i.querySelector('input[name="_wp_http_referer"]'),s=[];return o.each(r,function(e,t){var n=t.id.substring(4),r=o(t).find("h2").first().text();s.push({id:n,title:r,element:t,nav:i.querySelectorAll(".nav-tab-"+n),open:function(){return c(n)}})}),l.click(t),o(document.body).on("click",".tab-link",t),function(){if(history.pushState){var e=r.filter(":visible").get(0);if(e){var t=u(e.id.substring(4));t&&(history.replaceState&&null===history.state&&history.replaceState(t.id,""),f(t))}}}(),window.addEventListener&&history.pushState&&window.addEventListener("popstate",function(e){return!e.state||c(e.state,!1)}),{open:c,get:u}}function u(e){for(var t=0;t<s.length;t++)if(s[t].id===e)return s[t]}function c(e,t){if("string"==typeof e&&(e=u(e)),!e)return!1;null==t&&(t=!0),r.removeClass("tab-active").css("display","none"),l.removeClass("nav-tab-active"),Array.prototype.forEach.call(e.nav,function(e){e.className+=" nav-tab-active",e.blur()}),e.element.style.display="block",e.element.className+=" tab-active";var n=d.setParameter(window.location.href,"tab",e.id);return history.pushState&&t&&history.pushState(e.id,"",n),f(e),a.value=n,"function"==typeof tb_remove&&tb_remove(),"fields"===e.id&&window.mc4wp&&window.mc4wp.forms&&window.mc4wp.forms.editor&&mc4wp.forms.editor.refresh(),!0}function f(e){var t=document.title.split("-");document.title=document.title.replace(t[0],e.title+" ")}function t(e){e=e||window.event;var t=this.getAttribute("data-tab");if(!t){var n=this.className.match(/nav-tab-(\w+)?/);n&&(t=n[1])}if(!t){var r=d.parse(this.href);if(!r.tab)return;t=r.tab}return!c(t)||(e.preventDefault(),e.returnValue=!1)}}},{"./url.js":7}],7:[function(e,t,n){"use strict";var i={parse:function(e){var t={},n=e.split("&");for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t},build:function(e){var t=[];for(var n in e)t.push(n+"="+encodeURIComponent(e[n]));return t.join("&")},setParameter:function(e,t,n){var r=i.parse(e);return r[t]=n,i.build(r)}};t.exports=i},{}],8:[function(e,L,t){(function(k,S){!function(){"use strict";function z(e,t,n,r,i,o){return{tag:e,key:t,attrs:n,children:r,text:i,dom:o,domSize:void 0,state:void 0,_state:void 0,events:void 0,instance:void 0,skip:!1}}z.normalize=function(e){return Array.isArray(e)?z("[",void 0,void 0,z.normalizeChildren(e),void 0,void 0):null!=e&&"object"!=typeof e?z("#",void 0,void 0,!1===e?"":e,void 0,void 0):e},z.normalizeChildren=function(e){for(var t=0;t<e.length;t++)e[t]=z.normalize(e[t]);return e};var s=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,u={},c={}.hasOwnProperty;function f(e){for(var t in e)if(c.call(e,t))return!1;return!0}function e(e){var t,n=arguments[1],r=2;if(null==e||"string"!=typeof e&&"function"!=typeof e&&"function"!=typeof e.view)throw Error("The selector must be either a string or a component.");if("string"==typeof e)var i=u[e]||function(e){for(var t,n="div",r=[],i={};t=s.exec(e);){var o=t[1],l=t[2];if(""===o&&""!==l)n=l;else if("#"===o)i.id=l;else if("."===o)r.push(l);else if("["===t[3][0]){var a=t[6];a&&(a=a.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===t[4]?r.push(a):i[t[4]]=""===a?a:a||!0}}return 0<r.length&&(i.className=r.join(" ")),u[e]={tag:n,attrs:i}}(e);if(null==n?n={}:("object"!=typeof n||null!=n.tag||Array.isArray(n))&&(n={},r=1),arguments.length===r+1)t=arguments[r],Array.isArray(t)||(t=[t]);else for(t=[];r<arguments.length;)t.push(arguments[r++]);var o=z.normalizeChildren(t);return"string"==typeof e?function(e,t,n){var r,i,o=!1,l=t.className||t.class;if(!f(e.attrs)&&!f(t)){var a={};for(var s in t)c.call(t,s)&&(a[s]=t[s]);t=a}for(var s in e.attrs)c.call(e.attrs,s)&&(t[s]=e.attrs[s]);for(var s in void 0!==l&&(void 0!==t.class&&(t.class=void 0,t.className=l),null!=e.attrs.className&&(t.className=e.attrs.className+" "+l)),t)if(c.call(t,s)&&"key"!==s){o=!0;break}return Array.isArray(n)&&1===n.length&&null!=n[0]&&"#"===n[0].tag?i=n[0].children:r=n,z(e.tag,t.key,o?t:void 0,r,i)}(i,n,o):z(e,n.key,n,o)}e.trust=function(e){return null==e&&(e=""),z("<",void 0,void 0,e,void 0,void 0)},e.fragment=function(e,t){return z("[",e.key,e,z.normalizeChildren(t),void 0,void 0)};var t=e;if((d=function(e){if(!(this instanceof d))throw new Error("Promise must be called with `new`");if("function"!=typeof e)throw new TypeError("executor must be a function");var o=this,l=[],a=[],i=t(l,!0),s=t(a,!1),u=o._instance={resolvers:l,rejectors:a},c="function"==typeof S?S:setTimeout;function t(r,i){return function t(n){var e;try{if(!i||null==n||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof(e=n.then))c(function(){i||0!==r.length||console.error("Possible unhandled promise rejection:",n);for(var e=0;e<r.length;e++)r[e](n);l.length=0,a.length=0,u.state=i,u.retry=function(){t(n)}});else{if(n===o)throw new TypeError("Promise can't be resolved w/ itself");f(e.bind(n))}}catch(e){s(e)}}}function f(e){var n=0;function t(t){return function(e){0<n++||t(e)}}var r=t(s);try{e(t(i),r)}catch(e){r(e)}}f(e)}).prototype.then=function(e,t){var i,o,l=this._instance;function n(t,e,n,r){e.push(function(e){if("function"!=typeof t)n(e);else try{i(t(e))}catch(e){o&&o(e)}}),"function"==typeof l.retry&&r===l.state&&l.retry()}var r=new d(function(e,t){i=e,o=t});return n(e,l.resolvers,i,!0),n(t,l.rejectors,o,!1),r},d.prototype.catch=function(e){return this.then(null,e)},d.resolve=function(t){return t instanceof d?t:new d(function(e){e(t)})},d.reject=function(n){return new d(function(e,t){t(n)})},d.all=function(a){return new d(function(n,r){var i=a.length,o=0,l=[];if(0===a.length)n([]);else for(var e=0;e<a.length;e++)!function(t){function e(e){o++,l[t]=e,o===i&&n(l)}null==a[t]||"object"!=typeof a[t]&&"function"!=typeof a[t]||"function"!=typeof a[t].then?e(a[t]):a[t].then(e,r)}(e)})},d.race=function(r){return new d(function(e,t){for(var n=0;n<r.length;n++)r[n].then(e,t)})},"undefined"!=typeof window){void 0===window.Promise&&(window.Promise=d);var d=window.Promise}else if(void 0!==k){void 0===k.Promise&&(k.Promise=d);d=k.Promise}var v=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var r=[];for(var t in e)i(t,e[t]);return r.join("&");function i(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)i(e+"["+n+"]",t[n]);else if("[object Object]"===Object.prototype.toString.call(t))for(var n in t)i(e+"["+n+"]",t[n]);else r.push(encodeURIComponent(e)+(null!=t&&""!==t?"="+encodeURIComponent(t):""))}},m=new RegExp("^file://","i"),n=function(s,r){var t,o=0;function l(){var i=0;function o(){0==--i&&"function"==typeof t&&t()}return function t(n){var r=n.then;return n.then=function(){i++;var e=r.apply(n,arguments);return e.then(o,function(e){if(o(),0===i)throw e}),t(e)},n}}function u(e,t){if("string"==typeof e){var n=e;null==(e=t||{}).url&&(e.url=n)}return e}function c(e,t){if(null==t)return e;for(var n=e.match(/:[^\/]+/gi)||[],r=0;r<n.length;r++){var i=n[r].slice(1);null!=t[i]&&(e=e.replace(n[r],t[i]))}return e}function f(e,t){var n=v(t);if(""!==n){var r=e.indexOf("?")<0?"?":"&";e+=r+n}return e}function d(t){try{return""!==t?JSON.parse(t):null}catch(e){throw new Error(t)}}function h(e){return e.responseText}function p(e,t){if("function"==typeof e){if(!Array.isArray(t))return new e(t);for(var n=0;n<t.length;n++)t[n]=new e(t[n])}return t}return{request:function(a,e){var t=l();a=u(a,e);var n=new r(function(r,i){null==a.method&&(a.method="GET"),a.method=a.method.toUpperCase();var e="GET"!==a.method&&"TRACE"!==a.method&&("boolean"!=typeof a.useBody||a.useBody);"function"!=typeof a.serialize&&(a.serialize="undefined"!=typeof FormData&&a.data instanceof FormData?function(e){return e}:JSON.stringify),"function"!=typeof a.deserialize&&(a.deserialize=d),"function"!=typeof a.extract&&(a.extract=h),a.url=c(a.url,a.data),e?a.data=a.serialize(a.data):a.url=f(a.url,a.data);var o=new s.XMLHttpRequest,l=!1,t=o.abort;for(var n in o.abort=function(){l=!0,t.call(o)},o.open(a.method,a.url,"boolean"!=typeof a.async||a.async,"string"==typeof a.user?a.user:void 0,"string"==typeof a.password?a.password:void 0),a.serialize!==JSON.stringify||!e||a.headers&&a.headers.hasOwnProperty("Content-Type")||o.setRequestHeader("Content-Type","application/json; charset=utf-8"),a.deserialize!==d||a.headers&&a.headers.hasOwnProperty("Accept")||o.setRequestHeader("Accept","application/json, text/*"),a.withCredentials&&(o.withCredentials=a.withCredentials),a.headers)({}).hasOwnProperty.call(a.headers,n)&&o.setRequestHeader(n,a.headers[n]);"function"==typeof a.config&&(o=a.config(o,a)||o),o.onreadystatechange=function(){if(!l&&4===o.readyState)try{var e=a.extract!==h?a.extract(o,a):a.deserialize(a.extract(o,a));if(200<=o.status&&o.status<300||304===o.status||m.test(a.url))r(p(a.type,e));else{var t=new Error(o.responseText);for(var n in e)t[n]=e[n];i(t)}}catch(e){i(e)}},e&&null!=a.data?o.send(a.data):o.send()});return!0===a.background?n:t(n)},jsonp:function(i,e){var t=l();i=u(i,e);var n=new r(function(t,e){var n=i.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+o++,r=s.document.createElement("script");s[n]=function(e){r.parentNode.removeChild(r),t(p(i.type,e)),delete s[n]},r.onerror=function(){r.parentNode.removeChild(r),e(new Error("JSONP request failed")),delete s[n]},null==i.data&&(i.data={}),i.url=c(i.url,i.data),i.data[i.callbackKey||"callback"]=n,r.src=f(i.url,i.data),s.document.documentElement.appendChild(r)});return!0===i.background?n:t(n)},setCompletionCallback:function(e){t=e}}}(window,d),r=function(e){var l,d=e.document,u=d.createDocumentFragment(),t={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function h(e){return e.attrs&&e.attrs.xmlns||t[e.tag]}function b(e,t,n,r,i,o,l){for(var a=n;a<r;a++){var s=t[a];null!=s&&x(e,s,i,l,o)}}function x(e,t,n,r,i){var o,l,a,s=t.tag;if("string"!=typeof s)return function(e,t,n,r,i){{if(v(t,n),null==t.instance)return t.domSize=0,u;var o=x(e,t.instance,n,r,i);return t.dom=t.instance.dom,t.domSize=null!=t.dom?t.instance.domSize:0,k(e,o,i),o}}(e,t,n,r,i);switch(t.state={},null!=t.attrs&&j(t.attrs,t,n),s){case"#":return o=e,a=i,(l=t).dom=d.createTextNode(l.children),k(o,l.dom,a),l.dom;case"<":return p(e,t,i);case"[":return function(e,t,n,r,i){var o=d.createDocumentFragment();if(null!=t.children){var l=t.children;b(o,l,0,l.length,n,null,r)}return t.dom=o.firstChild,t.domSize=o.childNodes.length,k(e,o,i),o}(e,t,n,r,i);default:return function(e,t,n,r,i){var o=t.tag,l=t.attrs,a=l&&l.is,s=(r=h(t)||r)?a?d.createElementNS(r,o,{is:a}):d.createElementNS(r,o):a?d.createElement(o,{is:a}):d.createElement(o);t.dom=s,null!=l&&function(e,t,n){for(var r in t)w(e,r,null,t[r],n)}(t,l,r);if(k(e,s,i),null!=t.attrs&&null!=t.attrs.contenteditable)y(t);else if(null!=t.text&&(""!==t.text?s.textContent=t.text:t.children=[z("#",void 0,void 0,t.text,void 0,void 0)]),null!=t.children){var u=t.children;b(s,u,0,u.length,n,null,r),f=(c=t).attrs,"select"===c.tag&&null!=f&&("value"in f&&w(c,"value",null,f.value,void 0),"selectedIndex"in f&&w(c,"selectedIndex",null,f.selectedIndex,void 0))}var c,f;return s}(e,t,n,r,i)}}function p(e,t,n){var r={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"}[(t.children.match(/^\s*?<(\w+)/im)||[])[1]]||"div",i=d.createElement(r);i.innerHTML=t.children,t.dom=i.firstChild,t.domSize=i.childNodes.length;for(var o,l=d.createDocumentFragment();o=i.firstChild;)l.appendChild(o);return k(e,l,n),l}function v(e,t){var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return u;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return u;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}if(e._state=e.state,null!=e.attrs&&j(e.attrs,e,t),j(e._state,e,t),e.instance=z.normalize(e._state.view.call(e.state,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null}function m(e,t,n,r,i,o,l){if(t!==n&&(null!=t||null!=n))if(null==t)b(e,n,0,n.length,i,o,l);else if(null==n)S(t,0,t.length,n);else{if(t.length===n.length){for(var a=!1,s=0;s<n.length;s++)if(null!=n[s]&&null!=t[s]){a=null==n[s].key&&null==t[s].key;break}if(a){for(s=0;s<t.length;s++)t[s]!==n[s]&&(null==t[s]&&null!=n[s]?x(e,n[s],i,l,A(t,s+1,o)):null==n[s]?S(t,s,s+1,n):E(e,t[s],n[s],i,A(t,s+1,o),r,l));return}}if(r=r||function(e,t){if(null!=e.pool&&Math.abs(e.pool.length-t.length)<=Math.abs(e.length-t.length)){var n=e[0]&&e[0].children&&e[0].children.length||0,r=e.pool[0]&&e.pool[0].children&&e.pool[0].children.length||0,i=t[0]&&t[0].children&&t[0].children.length||0;if(Math.abs(r-i)<=Math.abs(n-i))return!0}return!1}(t,n)){var u=t.pool;t=t.concat(t.pool)}for(var c,f=0,d=0,h=t.length-1,p=n.length-1;f<=h&&d<=p;){if((m=t[f])!==(y=n[d])||r)if(null==m)f++;else if(null==y)d++;else if(m.key===y.key){var v=null!=u&&f>=t.length-u.length||null==u&&r;d++,E(e,m,y,i,A(t,++f,o),v,l),r&&m.tag===y.tag&&k(e,T(m),o)}else{if((m=t[h])!==y||r)if(null==m)h--;else if(null==y)d++;else{if(m.key!==y.key)break;v=null!=u&&h>=t.length-u.length||null==u&&r;E(e,m,y,i,A(t,h+1,o),v,l),(r||d<p)&&k(e,T(m),A(t,f,o)),h--,d++}else h--,d++}else f++,d++}for(;f<=h&&d<=p;){var m,y;if((m=t[h])!==(y=n[p])||r)if(null==m)h--;else if(null==y)p--;else if(m.key===y.key){v=null!=u&&h>=t.length-u.length||null==u&&r;E(e,m,y,i,A(t,h+1,o),v,l),r&&m.tag===y.tag&&k(e,T(m),o),null!=m.dom&&(o=m.dom),h--,p--}else{if(c||(c=_(t,h)),null!=y){var g=c[y.key];if(null!=g){var w=t[g];v=null!=u&&g>=t.length-u.length||null==u&&r;E(e,w,y,i,A(t,h+1,o),r,l),k(e,T(w),o),t[g].skip=!0,null!=w.dom&&(o=w.dom)}else{o=x(e,y,i,l,o)}}p--}else h--,p--;if(p<d)break}b(e,n,d,p+1,i,o,l),S(t,f,h+1,n)}}function E(e,t,n,r,i,o,l){var a,s,u,c,f=t.tag;if(f===n.tag){if(n.state=t.state,n._state=t._state,n.events=t.events,!o&&function(e,t){var n,r;null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate&&(n=e.attrs.onbeforeupdate.call(e.state,e,t));"string"!=typeof e.tag&&"function"==typeof e._state.onbeforeupdate&&(r=e._state.onbeforeupdate.call(e.state,e,t));return!(void 0===n&&void 0===r||n||r||(e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,0))}(n,t))return;if("string"==typeof f)switch(null!=n.attrs&&(o?(n.state={},j(n.attrs,n,r)):O(n.attrs,n,r)),f){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(t,n);break;case"<":a=e,u=n,c=i,(s=t).children!==u.children?(T(s),p(a,u,c)):(u.dom=s.dom,u.domSize=s.domSize);break;case"[":!function(e,t,n,r,i,o,l){m(e,t.children,n.children,r,i,o,l);var a=0,s=n.children;if((n.dom=null)!=s){for(var u=0;u<s.length;u++){var c=s[u];null!=c&&null!=c.dom&&(null==n.dom&&(n.dom=c.dom),a+=c.domSize||1)}1!==a&&(n.domSize=a)}}(e,t,n,o,r,i,l);break;default:!function(e,t,n,r,i){var o=t.dom=e.dom;i=h(t)||i,"textarea"===t.tag&&(null==t.attrs&&(t.attrs={}),null!=t.text&&(t.attrs.value=t.text,t.text=void 0));(function(e,t,n,r){if(null!=n)for(var i in n)w(e,i,t&&t[i],n[i],r);if(null!=t)for(var i in t)null!=n&&i in n||("className"===i&&(i="class"),"o"!==i[0]||"n"!==i[1]||L(i)?"key"!==i&&e.dom.removeAttribute(i):C(e,i,void 0))})(t,e.attrs,t.attrs,i),null!=t.attrs&&null!=t.attrs.contenteditable?y(t):null!=e.text&&null!=t.text&&""!==t.text?e.text.toString()!==t.text.toString()&&(e.dom.firstChild.nodeValue=t.text):(null!=e.text&&(e.children=[z("#",void 0,void 0,e.text,void 0,e.dom.firstChild)]),null!=t.text&&(t.children=[z("#",void 0,void 0,t.text,void 0,void 0)]),m(o,e.children,t.children,n,r,null,i))}(t,n,o,r,l)}else!function(e,t,n,r,i,o,l){if(o)v(n,r);else{if(n.instance=z.normalize(n._state.view.call(n.state,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");null!=n.attrs&&O(n.attrs,n,r),O(n._state,n,r)}null!=n.instance?(null==t.instance?x(e,n.instance,r,l,i):E(e,t.instance,n.instance,r,i,o,l),n.dom=n.instance.dom,n.domSize=n.instance.domSize):null!=t.instance?(g(t.instance,null),n.dom=void 0,n.domSize=0):(n.dom=t.dom,n.domSize=t.domSize)}(e,t,n,r,i,o,l)}else g(t,null),x(e,n,r,l,i)}function _(e,t){var n={},r=0;for(r=0;r<t;r++){var i=e[r];if(null!=i){var o=i.key;null!=o&&(n[o]=r)}}return n}function T(e){var t=e.domSize;if(null==t&&null!=e.dom)return e.dom;var n=d.createDocumentFragment();if(0<t){for(var r=e.dom;--t;)n.appendChild(r.nextSibling);n.insertBefore(r,n.firstChild)}return n}function A(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function k(e,t,n){n&&n.parentNode?e.insertBefore(t,n):e.appendChild(t)}function y(e){var t=e.children;if(null!=t&&1===t.length&&"<"===t[0].tag){var n=t[0].children;e.dom.innerHTML!==n&&(e.dom.innerHTML=n)}else if(null!=e.text||null!=t&&0!==t.length)throw new Error("Child node of a contenteditable must be trusted")}function S(e,t,n,r){for(var i=t;i<n;i++){var o=e[i];null!=o&&(o.skip?o.skip=!1:g(o,r))}}function g(r,i){var e,o=1,l=0;r.attrs&&"function"==typeof r.attrs.onbeforeremove&&(null!=(e=r.attrs.onbeforeremove.call(r.state,r))&&"function"==typeof e.then&&(o++,e.then(t,t)));"string"!=typeof r.tag&&"function"==typeof r._state.onbeforeremove&&(null!=(e=r._state.onbeforeremove.call(r.state,r))&&"function"==typeof e.then&&(o++,e.then(t,t)));function t(){if(++l===o&&(function e(t){t.attrs&&"function"==typeof t.attrs.onremove&&t.attrs.onremove.call(t.state,t);if("string"!=typeof t.tag)"function"==typeof t._state.onremove&&t._state.onremove.call(t.state,t),null!=t.instance&&e(t.instance);else{var n=t.children;if(Array.isArray(n))for(var r=0;r<n.length;r++){var i=n[r];null!=i&&e(i)}}}(r),r.dom)){var e=r.domSize||1;if(1<e)for(var t=r.dom;--e;)a(t.nextSibling);a(r.dom),null==i||null!=r.domSize||null!=(n=r.attrs)&&(n.oncreate||n.onupdate||n.onbeforeremove||n.onremove)||"string"!=typeof r.tag||(i.pool?i.pool.push(r):i.pool=[r])}var n}t()}function a(e){var t=e.parentNode;null!=t&&t.removeChild(e)}function w(e,t,n,r,i){var o=e.dom;if("key"!==t&&"is"!==t&&(n!==r||(l=e,"value"===(a=t)||"checked"===a||"selectedIndex"===a||"selected"===a&&l.dom===d.activeElement)||"object"==typeof r)&&void 0!==r&&!L(t)){var l,a,s,u,c=t.indexOf(":");if(-1<c&&"xlink"===t.substr(0,c))o.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(c+1),r);else if("o"===t[0]&&"n"===t[1]&&"function"==typeof r)C(e,t,r);else if("style"===t)!function(e,t,n){t===n&&(e.style.cssText="",t=null);if(null==n)e.style.cssText="";else if("string"==typeof n)e.style.cssText=n;else{for(var r in"string"==typeof t&&(e.style.cssText=""),n)e.style[r]=n[r];if(null!=t&&"string"!=typeof t)for(var r in t)r in n||(e.style[r]="")}}(o,n,r);else if(t in o&&("href"!==(u=t)&&"list"!==u&&"form"!==u&&"width"!==u&&"height"!==u)&&void 0===i&&!((s=e).attrs.is||-1<s.tag.indexOf("-"))){if("value"===t){var f=""+r;if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===f&&e.dom===d.activeElement)return;if("select"===e.tag)if(null===r){if(-1===e.dom.selectedIndex&&e.dom===d.activeElement)return}else if(null!==n&&e.dom.value===f&&e.dom===d.activeElement)return;if("option"===e.tag&&null!=n&&e.dom.value===f)return}if("input"===e.tag&&"type"===t)return void o.setAttribute(t,r);o[t]=r}else"boolean"==typeof r?r?o.setAttribute(t,""):o.removeAttribute(t):o.setAttribute("className"===t?"class":t,r)}}function L(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function C(e,t,n){var r=e.dom,i="function"!=typeof l?n:function(e){var t=n.call(r,e);return l.call(r,e),t};if(t in r)r[t]="function"==typeof n?i:null;else{var o=t.slice(2);if(void 0===e.events&&(e.events={}),e.events[t]===i)return;null!=e.events[t]&&r.removeEventListener(o,e.events[t],!1),"function"==typeof n&&(e.events[t]=i,r.addEventListener(o,e.events[t],!1))}}function j(e,t,n){"function"==typeof e.oninit&&e.oninit.call(t.state,t),"function"==typeof e.oncreate&&n.push(e.oncreate.bind(t.state,t))}function O(e,t,n){"function"==typeof e.onupdate&&n.push(e.onupdate.bind(t.state,t))}return{render:function(e,t){if(!e)throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var n=[],r=d.activeElement,i=e.namespaceURI;null==e.vnodes&&(e.textContent=""),Array.isArray(t)||(t=[t]),m(e,e.vnodes,z.normalizeChildren(t),!1,n,null,"http://www.w3.org/1999/xhtml"===i?void 0:i),e.vnodes=t,null!=r&&d.activeElement!==r&&r.focus();for(var o=0;o<n.length;o++)n[o]()},setEventCallback:function(e){return l=e}}};var i=function(e){var t=r(e);t.setEventCallback(function(e){!1===e.redraw?e.redraw=void 0:n()});var l=[];function a(e){var t=l.indexOf(e);-1<t&&l.splice(t,2)}function n(){for(var e=1;e<l.length;e+=2)l[e]()}return{subscribe:function(e,t){var n,r,i,o;a(e),l.push(e,(n=t,r=0,i=null,o="function"==typeof requestAnimationFrame?requestAnimationFrame:setTimeout,function(){var e=Date.now();0===r||16<=e-r?(r=e,n()):null===i&&(i=o(function(){i=null,n(),r=Date.now()},16-(e-r)))}))},unsubscribe:a,redraw:n,render:t.render}}(window);n.setCompletionCallback(i.redraw);var o;t.mount=(o=i,function(e,t){if(null===t)return o.render(e,[]),void o.unsubscribe(e);if(null==t.view&&"function"!=typeof t)throw new Error("m.mount(element, component) expects a component, not a vnode");o.subscribe(e,function(){o.render(e,z(t))}),o.redraw()});var l,a,h,p,y,g,w,b,x,E=d,_=function(e){if(""===e||null==e)return{};"?"===e.charAt(0)&&(e=e.slice(1));for(var t=e.split("&"),n={},r={},i=0;i<t.length;i++){var o=t[i].split("="),l=decodeURIComponent(o[0]),a=2===o.length?decodeURIComponent(o[1]):"";"true"===a?a=!0:"false"===a&&(a=!1);var s=l.split(/\]\[?|\[/),u=n;-1<l.indexOf("[")&&s.pop();for(var c=0;c<s.length;c++){var f=s[c],d=s[c+1],h=""==d||!isNaN(parseInt(d,10)),p=c===s.length-1;if(""===f)null==r[l=s.slice(0,c).join()]&&(r[l]=0),f=r[l]++;null==u[f]&&(u[f]=p?a:h?[]:{}),u=u[f]}}return n},T=function(c){var n,f="function"==typeof c.history.pushState,r="function"==typeof S?S:setTimeout;function e(e){var t=c.location[e].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);return"pathname"===e&&"/"!==t[0]&&(t="/"+t),t}function d(e,t,n){var r=e.indexOf("?"),i=e.indexOf("#"),o=-1<r?r:-1<i?i:e.length;if(-1<r){var l=-1<i?i:e.length,a=_(e.slice(r+1,l));for(var s in a)t[s]=a[s]}if(-1<i){var u=_(e.slice(i+1));for(var s in u)n[s]=u[s]}return e.slice(0,o)}var h={prefix:"#!",getPath:function(){switch(h.prefix.charAt(0)){case"#":return e("hash").slice(h.prefix.length);case"?":return e("search").slice(h.prefix.length)+e("hash");default:return e("pathname").slice(h.prefix.length)+e("search")+e("hash")}},setPath:function(e,n,t){var r={},i={};if(e=d(e,r,i),null!=n){for(var o in n)r[o]=n[o];e=e.replace(/:([^\/]+)/g,function(e,t){return delete r[t],n[t]})}var l=v(r);l&&(e+="?"+l);var a=v(i);if(a&&(e+="#"+a),f){var s=t?t.state:null,u=t?t.title:null;c.onpopstate(),t&&t.replace?c.history.replaceState(s,u,h.prefix+e):c.history.pushState(s,u,h.prefix+e)}else c.location.href=h.prefix+e}};return h.defineRoutes=function(a,s,u){function e(){var r=h.getPath(),i={},e=d(r,i,i),t=c.history.state;if(null!=t)for(var n in t)i[n]=t[n];for(var o in a){var l=new RegExp("^"+o.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(l.test(e))return void e.replace(l,function(){for(var e=o.match(/:[^\/]+/g)||[],t=[].slice.call(arguments,1,-2),n=0;n<e.length;n++)i[e[n].replace(/:|\./g,"")]=decodeURIComponent(t[n]);s(a[o],i,r,o)})}u(r,i)}var t;f?c.onpopstate=(t=e,function(){null==n&&(n=r(function(){n=null,t()}))}):"#"===h.prefix.charAt(0)&&(c.onhashchange=e),e()},h};t.route=(l=window,a=i,b=T(l),(x=function(e,t,n){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var o=function(){null!=h&&a.render(e,h(z(p,y.key,y)))},l=function(e){if(e===t)throw new Error("Could not resolve default route "+t);b.setPath(t,null,{replace:!0})};b.defineRoutes(n,function(t,n,r){var i=w=function(e,t){i===w&&(p=null==t||"function"!=typeof t.view&&"function"!=typeof t?"div":t,y=n,g=r,w=null,h=(e.render||function(e){return e}).bind(e),o())};t.view||"function"==typeof t?i({},t):t.onmatch?E.resolve(t.onmatch(n,r)).then(function(e){i(t,e)},l):i(t,"div")},l),a.subscribe(e,o)}).set=function(e,t,n){null!=w&&((n=n||{}).replace=!0),w=null,b.setPath(e,t,n)},x.get=function(){return g},x.prefix=function(e){b.prefix=e},x.link=function(e){e.dom.setAttribute("href",b.prefix+e.attrs.href),e.dom.onclick=function(e){if(!(e.ctrlKey||e.metaKey||e.shiftKey||2===e.which)){e.preventDefault(),e.redraw=!1;var t=this.getAttribute("href");0===t.indexOf(b.prefix)&&(t=t.slice(b.prefix.length)),x.set(t,void 0,void 0)}}},x.param=function(e){return void 0!==y&&void 0!==e?y[e]:y},x),t.withAttr=function(t,n,r){return function(e){n.call(r||this,t in e.currentTarget?e.currentTarget[t]:e.currentTarget.getAttribute(t))}};var A=r(window);t.render=A.render,t.redraw=i.redraw,t.request=n.request,t.jsonp=n.jsonp,t.parseQueryString=_,t.buildQueryString=v,t.version="1.1.6",t.vnode=z,void 0!==L?L.exports=t:window.m=t}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{timers:10}],9:[function(e,t,n){var r,i,o=t.exports={};function l(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===l||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:l}catch(e){r=l}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var u,c=[],f=!1,d=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):d=-1,c.length&&p())}function p(){if(!f){var e=s(h);f=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,f=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(e)}}function v(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new v(e,t)),1!==c.length||f||s(p)},v.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],10:[function(s,e,u){(function(e,t){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,i=Array.prototype.slice,o={},l=0;function a(e,t){this._id=e,this._clearFn=t}u.setTimeout=function(){return new a(n.call(setTimeout,window,arguments),clearTimeout)},u.setInterval=function(){return new a(n.call(setInterval,window,arguments),clearInterval)},u.clearTimeout=u.clearInterval=function(e){e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},u.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},u.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},u._unrefActive=u.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},u.setImmediate="function"==typeof e?e:function(e){var t=l++,n=!(arguments.length<2)&&i.call(arguments,1);return o[t]=!0,r(function(){o[t]&&(n?e.apply(null,n):e.call(null),u.clearImmediate(t))}),t},u.clearImmediate="function"==typeof t?t:function(e){delete o[e]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":9,timers:10}],11:[function(e,t,n){function u(r){document.addEventListener("mouseover",function(e){var t=e.target,n=r(t);n||(n=(t=t.parentElement)&&r(t)),n&&u.show(t,n,!0)})}u.show=function(e,t,a){var s="data-tlite";t=t||{},(e.tooltip||function(e,t){var n,r,i;function o(){u.hide(e,!0)}function l(){n||(n=function(a,e,t){var s=document.createElement("span"),n=t.grav||a.getAttribute("data-tlite")||"n";s.innerHTML=e,a.appendChild(s);var u=n[0]||"",c=n[1]||"";function r(){s.className="tlite tlite-"+u+c;var e=a.offsetTop,t=a.offsetLeft;s.offsetParent===a&&(e=t=0);var n=a.offsetWidth,r=a.offsetHeight,i=s.offsetHeight,o=s.offsetWidth,l=t+n/2;s.style.top=("s"===u?e-i-10:"n"===u?e+r+10:e+r/2-i/2)+"px",s.style.left=("w"===c?t:"e"===c?t+n-o:"w"===u?t+n+10:"e"===u?t-o-10:l-o/2)+"px"}r();var i=s.getBoundingClientRect();"s"===u&&i.top<0?(u="n",r()):"n"===u&&i.bottom>window.innerHeight?(u="s",r()):"e"===u&&i.left<0?(u="w",r()):"w"===u&&i.right>window.innerWidth&&(u="e",r());return s.className+=" tlite-visible",s}(e,i,t))}return e.addEventListener("mousedown",o),e.addEventListener("mouseleave",o),e.tooltip={show:function(){i=e.title||e.getAttribute(s)||i,e.title="",e.setAttribute(s,""),i&&!r&&(r=setTimeout(l,a?150:1))},hide:function(e){if(a===e){r=clearTimeout(r);var t=n&&n.parentNode;t&&t.removeChild(n),n=void 0}}}}(e,t)).show()},u.hide=function(e,t){e.tooltip&&e.tooltip.hide(t)},void 0!==t&&t.exports&&(t.exports=u)},{}],12:[function(e,l,t){!function(e){"use strict";function t(){}var n=t.prototype,r=e.EventEmitter;function o(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function i(e){return function(){return this[e].apply(this,arguments)}}n.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp)for(n in t={},r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n]);else t=r[e]||(r[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,r=this.getListenersAsObject(e),i="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&-1===o(r[n],t)&&r[n].push(i?t:{listener:t,once:!1});return this},n.on=i("addListener"),n.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},n.once=i("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,r,i=this.getListenersAsObject(e);for(r in i)i.hasOwnProperty(r)&&-1!==(n=o(i[r],t))&&i[r].splice(n,1);return this},n.off=i("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 r,i,o=e?this.removeListener:this.addListener,l=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)o.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?o.call(this,r,i):l.call(this,r,i));return this},n.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},n.removeAllListeners=i("removeEvent"),n.emitEvent=function(e,t){var n,r,i,o,l=this.getListenersAsObject(e);for(o in l)if(l.hasOwnProperty(o))for(n=l[o].slice(0),i=0;i<n.length;i++)!0===(r=n[i]).once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},n.trigger=i("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=r,t},"function"==typeof a&&a.amd?a(function(){return t}):"object"==typeof l&&l.exports?l.exports=t:e.EventEmitter=t}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=admin.min.js.map
assets/js/admin.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["admin.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","obj","_tlite","__esModule","default","m","window","EventEmitter","context","document","getElementById","events","tabs","helpers","settings","el","className","indexOf","ListFetcher","mount","mc4wp","deps","mithril","./admin/fields/mailchimp-api-key.js","./admin/helpers.js","./admin/list-fetcher.js","./admin/settings.js","./admin/tabs.js","tlite","wolfy87-eventemitter","2","field","validate","evt","node","createElement","innerText","mc4wp_vars","i18n","invalid_api_key","nextElementSibling","parentElement","removeChild","value","match","insertBefore","addEventListener","3","showIfElements","toggleElement","selector","elements","querySelectorAll","show","clientHeight","style","display","bindEventToElement","element","event","handler","attachEvent","bindEventToElements","Array","prototype","forEach","debounce","func","wait","immediate","timeout","this","args","arguments","callNow","clearTimeout","setTimeout","apply","config","JSON","parse","getAttribute","parentElements","inputs","hide","checked","conditionMet","visibility","opacity","inputElement","removeAttribute","setAttribute","4","$","jQuery","working","done","mailchimp","api_connected","lists","fetch","preventDefault","post","ajaxurl","action","data","success","location","reload","bind","fail","always","redraw","view","method","onsubmit","type","fetching_mailchimp_lists","renew_mailchimp_lists","disabled","trust","fetching_mailchimp_lists_can_take_a_while","fetching_mailchimp_lists_done","fetching_mailchimp_lists_error","5","_typeof","Symbol","iterator","constructor","querySelector","listInputs","selectedLists","updateSelectedLists","input","push","trigger","on","rows","searchKey","searchValue","listId","filter","replace","getSelectedLists","6","URL","$context","$tabs","find","$tabNavs","refererField","get","id","_open","tab","updateState","removeClass","css","nav","blur","url","setParameter","href","history","pushState","title","tb_remove","forms","editor","refresh","split","switchTab","tabId","urlParams","returnValue","each","substring","first","text","open","click","body","activeTab","replaceState","state","init","./url.js","7","query","hasOwnProperty","b","decodeURIComponent","build","ret","d","encodeURIComponent","join","key","8","global","setImmediate","Vnode","tag","attrs0","children","dom","attrs","domSize","_state","instance","skip","normalize","isArray","normalizeChildren","selectorParser","selectorCache","hasOwn","isEmpty","object","hyperscript","start","cached","classes","exec","attrValue","compileSelector","normalized","childList","hasAttrs","class","newAttrs","execSelector","html","fragment","attrs1","PromisePolyfill","executor","TypeError","self","resolvers","rejectors","resolveCurrent","rejectCurrent","_instance","callAsync","list","shouldAbsorb","execute","then","console","error","retry","executeOnce","runs","run","fn","onerror","onFulfilled","onRejection","resolveNext","rejectNext","handle","callback","next","promise","resolve","reject","catch","all","total","count","values","consume","race","Promise","buildQueryString","Object","toString","key0","destructure","FILE_PROTOCOL_REGEX","RegExp","requestService","$window","oncompletion","callbackCount","finalizer","complete","finalize","promise0","then0","extra","interpolate","tokens","slice","assemble","querystring","prefix","deserialize","extract","xhr","responseText","cast","type0","request","toUpperCase","useBody","serialize","FormData","stringify","XMLHttpRequest","aborted","_abort","abort","async","user","password","headers","setRequestHeader","withCredentials","onreadystatechange","readyState","response","status","test","send","background","jsonp","callbackName","Math","round","random","script","parentNode","callbackKey","src","documentElement","appendChild","setCompletionCallback","_8","coreRenderer","onevent","$doc","$emptyFragment","createDocumentFragment","nameSpace","svg","math","getNameSpace","vnode","xmlns","createNodes","parent","vnodes","end","hooks","nextSibling","ns","createNode","initComponent","insertNode","createComponent","initLifecycle","createTextNode","createHTML","firstChild","childNodes","createFragment","attrs2","is","createElementNS","key2","setAttr","setAttrs","contenteditable","setContentEditable","textContent","selectedIndex","parent1","caption","thead","tbody","tfoot","tr","th","td","colgroup","col","temp","innerHTML","child","sentinel","create","$$reentrantLock$$","updateNodes","old","recycling","removeNodes","isUnkeyed","getNextSibling","updateNode","pool","abs","oldChildrenLength","poolChildrenLength","vnodesChildrenLength","isRecyclable","concat","map","oldStart","oldEnd","v","shouldRecycle","toFragment","getKeyMap","oldIndex","movable","oldTag","forceVnodeUpdate","forceComponentUpdate","onbeforeupdate","shouldNotUpdate","updateLifecycle","nodeValue","updateText","updateFragment","isLifecycleMethod","updateEvent","updateAttrs","updateElement","removeNode","updateComponent","count0","content","result","expected","called","onbeforeremove","continuation","onremove","removeNodeFromDOM","source","oncreate","onupdate","attr","activeElement","nsLastIndex","substr","setAttributeNS","cssText","updateStyle","normalized0","eventName","removeEventListener","oninit","render","active","namespace","namespaceURI","focus","setEventCallback","redrawService","renderService","callbacks","unsubscribe","key1","index","splice","subscribe","last","pending","requestAnimationFrame","now","Date","_11","redrawService0","root","component","render1","attrs3","currentPath","lastUpdate","routeService","route","parseQueryString","string","charAt","entries","data0","counters","entry","key5","levels","cursor","pop","j","level","nextLevel","isNumber","isNaN","parseInt","isValue","coreRouter","asyncId","supportsPushState","callAsync0","normalize1","fragment0","parsePath","path","queryData","hashData","queryIndex","hashIndex","pathEnd","queryEnd","queryParams","key4","hashParams","router","getPath","setPath","options","match2","token","hash","onpopstate","defineRoutes","routes","resolveRoute","params","pathname","k","route0","matcher","keys","callback0","onhashchange","defaultRoute","run1","bail","payload","update","routeResolver","comp","onmatch","resolved","set","prefix0","link","vnode1","onclick","ctrlKey","metaKey","shiftKey","which","param","key3","withAttr","attrName","callback1","currentTarget","_28","version","timers","9","cachedSetTimeout","cachedClearTimeout","process","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","len","marker","runClearTimeout","Item","array","noop","nextTick","browser","env","argv","versions","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","name","binding","cwd","chdir","dir","umask","10","clearImmediate","Function","immediateIds","nextImmediateId","Timeout","clearFn","_id","_clearFn","setInterval","clearInterval","close","unref","ref","enroll","item","msecs","_idleTimeoutId","_idleTimeout","unenroll","_unrefActive","_onTimeout","process/browser.js","11","getTooltipOpts","target","opts","isAuto","fallbackAttrib","tooltip","tooltipEl","showTimer","autoHide","fadeIn","grav","vertGrav","horzGrav","positionTooltip","top","offsetTop","left","offsetLeft","offsetParent","width","offsetWidth","height","offsetHeight","tooltipHeight","tooltipWidth","centerEl","rect","getBoundingClientRect","bottom","innerHeight","right","innerWidth","createTooltip","isAutoHiding","Tooltip","12","proto","originalGlobalValue","indexOfListener","listener","alias","getListeners","_getEvents","flattenListeners","flatListeners","getListenersAsObject","isValidListener","listenerIsWrapped","addOnceListener","defineEvent","defineEvents","evts","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","_events","emitEvent","listenersMap","_getOnceReturnValue","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA6BA,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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EAAMwB,UAAY,SAAmBhpB,EAAKuC,GACtC,IACI8gB,EACAsE,EACAzqB,EACAkN,EAJA6e,EAAe3mB,KAAK2lB,qBAAqBjoB,GAO7C,IAAKoK,KAAO6e,EACR,GAAIA,EAAarf,eAAeQ,GAG5B,IAFAiZ,EAAY4F,EAAa7e,GAAKiG,MAAM,GAE/BnT,EAAI,EAAGA,EAAImmB,EAAUzlB,OAAQV,KAKR,KAFtByqB,EAAWtE,EAAUnmB,IAER4lB,MACTxgB,KAAK0gB,eAAehjB,EAAK2nB,EAASA,UAG3BA,EAASA,SAAS/kB,MAAMN,KAAMC,GAAQ,MAEhCD,KAAK4mB,uBAClB5mB,KAAK0gB,eAAehjB,EAAK2nB,EAASA,UAMlD,OAAOrlB,MAMXklB,EAAMlhB,QAAUshB,EAAM,aAUtBJ,EAAMtE,KAAO,SAAcljB,GACvB,IAAIuC,EAAOT,MAAMC,UAAUsO,MAAM1S,KAAK6E,UAAW,GACjD,OAAOF,KAAK0mB,UAAUhpB,EAAKuC,IAW/BilB,EAAM2B,mBAAqB,SAA4BzoB,GAEnD,OADA4B,KAAK8mB,iBAAmB1oB,EACjB4B,MAWXklB,EAAM0B,oBAAsB,WACxB,OAAI5mB,KAAKsH,eAAe,qBACbtH,KAAK8mB,kBAapB5B,EAAMM,WAAa,WACf,OAAOxlB,KAAKymB,UAAYzmB,KAAKymB,QAAU,KAQ3CzqB,EAAa+qB,WAAa,WAEtB,OADA3rB,EAAQY,aAAempB,EAChBnpB,GAIW,mBAAX3B,GAAyBA,EAAO2sB,IACvC3sB,EAAO,WACH,OAAO2B,IAGY,iBAAXP,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAUY,EAGjBZ,EAAQY,aAAeA,EA5d9B,CA8dmB,oBAAXD,OAAyBA,OAASiE,MAAQ,KAEjD,KAAK,GAAG,CAAC,IAjlFX","file":"admin.min.js","sourcesContent":["(function () { var require = 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'; // dependencies\n\nvar _tlite = _interopRequireDefault(require(\"tlite\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar m = window.m = require('mithril');\n\nvar EventEmitter = require('wolfy87-eventemitter'); // vars\n\n\nvar context = document.getElementById('mc4wp-admin');\nvar events = new EventEmitter();\n\nvar tabs = require('./admin/tabs.js')(context);\n\nvar helpers = require('./admin/helpers.js');\n\nvar settings = require('./admin/settings.js')(context, helpers, events);\n\n(0, _tlite.default)(function (el) {\n return el.className.indexOf('mc4wp-tooltip') > -1;\n}); // list fetcher\n\nvar ListFetcher = require('./admin/list-fetcher.js');\n\nvar mount = document.getElementById('mc4wp-list-fetcher');\n\nif (mount) {\n m.mount(mount, new ListFetcher());\n}\n\nrequire('./admin/fields/mailchimp-api-key.js'); // expose some things\n\n\nwindow.mc4wp = window.mc4wp || {};\nwindow.mc4wp.deps = window.mc4wp.deps || {};\nwindow.mc4wp.deps.mithril = m;\nwindow.mc4wp.helpers = helpers;\nwindow.mc4wp.events = events;\nwindow.mc4wp.settings = settings;\nwindow.mc4wp.tabs = tabs;\n\n},{\"./admin/fields/mailchimp-api-key.js\":2,\"./admin/helpers.js\":3,\"./admin/list-fetcher.js\":4,\"./admin/settings.js\":5,\"./admin/tabs.js\":6,\"mithril\":8,\"tlite\":11,\"wolfy87-eventemitter\":12}],2:[function(require,module,exports){\n'use strict';\n\nvar field;\n\nfunction validate(evt) {\n var node = document.createElement('p');\n node.className = 'help red';\n node.innerText = window.mc4wp_vars.i18n.invalid_api_key;\n\n if (field.nextElementSibling.innerText === node.innerText) {\n field.nextElementSibling.parentElement.removeChild(field.nextElementSibling);\n }\n\n if (!field.value.match(/^[0-9a-zA-Z*]{32}-[a-z]{2}[0-9]{1,2}$/)) {\n field.parentElement.insertBefore(node, field.nextElementSibling);\n }\n}\n\n(function () {\n field = document.getElementById('mailchimp_api_key');\n\n if (!field) {\n return;\n }\n\n field.addEventListener('change', validate);\n})();\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar helpers = {};\n\nhelpers.toggleElement = function (selector) {\n var elements = document.querySelectorAll(selector);\n\n for (var i = 0; i < elements.length; i++) {\n var show = elements[i].clientHeight <= 0;\n elements[i].style.display = show ? '' : 'none';\n }\n};\n\nhelpers.bindEventToElement = function (element, event, handler) {\n if (element.addEventListener) {\n element.addEventListener(event, handler);\n } else if (element.attachEvent) {\n element.attachEvent('on' + event, handler);\n }\n};\n\nhelpers.bindEventToElements = function (elements, event, handler) {\n Array.prototype.forEach.call(elements, function (element) {\n helpers.bindEventToElement(element, event, handler);\n });\n}; // polling\n\n\nhelpers.debounce = function (func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n};\n/**\n * Showif.js\n */\n\n\n(function () {\n var showIfElements = document.querySelectorAll('[data-showif]'); // dependent elements\n\n Array.prototype.forEach.call(showIfElements, function (element) {\n var config = JSON.parse(element.getAttribute('data-showif'));\n var parentElements = document.querySelectorAll('[name=\"' + config.element + '\"]');\n var inputs = element.querySelectorAll('input,select,textarea:not([readonly])');\n var hide = config.hide === undefined || config.hide;\n\n function toggleElement() {\n // do nothing with unchecked radio inputs\n if (this.getAttribute('type') === \"radio\" && !this.checked) {\n return;\n }\n\n var value = this.getAttribute(\"type\") === \"checkbox\" ? this.checked : this.value;\n var conditionMet = value == config.value;\n\n if (hide) {\n element.style.display = conditionMet ? '' : 'none';\n element.style.visibility = conditionMet ? '' : 'hidden';\n } else {\n element.style.opacity = conditionMet ? '' : '0.4';\n } // disable input fields to stop sending their values to server\n\n\n Array.prototype.forEach.call(inputs, function (inputElement) {\n conditionMet ? inputElement.removeAttribute('readonly') : inputElement.setAttribute('readonly', 'readonly');\n });\n } // find checked element and call toggleElement function\n\n\n Array.prototype.forEach.call(parentElements, function (parentElement) {\n toggleElement.call(parentElement);\n }); // bind on all changes\n\n helpers.bindEventToElements(parentElements, 'change', toggleElement);\n });\n})();\n\nmodule.exports = helpers;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\nvar config = mc4wp_vars;\nvar i18n = config.i18n;\n\nfunction ListFetcher() {\n this.working = false;\n this.done = false; // start fetching right away when no lists but api key given\n\n if (config.mailchimp.api_connected && config.mailchimp.lists.length === 0) {\n this.fetch();\n }\n}\n\nListFetcher.prototype.fetch = function (e) {\n e && e.preventDefault();\n this.working = true;\n this.done = false;\n $.post(ajaxurl, {\n action: \"mc4wp_renew_mailchimp_lists\",\n timeout: 600000 // 10 minutes, matching max_execution_time\n\n }).done(function (data) {\n this.success = true;\n\n if (data) {\n window.setTimeout(function () {\n window.location.reload();\n }, 3000);\n }\n }.bind(this)).fail(function (data) {\n this.success = false;\n }.bind(this)).always(function (data) {\n this.working = false;\n this.done = true;\n m.redraw();\n }.bind(this));\n};\n\nListFetcher.prototype.view = function () {\n return m('form', {\n method: \"POST\",\n onsubmit: this.fetch.bind(this)\n }, [m('p', [m('input', {\n type: \"submit\",\n value: this.working ? i18n.fetching_mailchimp_lists : i18n.renew_mailchimp_lists,\n className: \"button\",\n disabled: !!this.working\n }), m.trust(' &nbsp; '), this.working ? [m('span.mc4wp-loader', \"Loading...\"), m.trust(' &nbsp; '), m('em.help', i18n.fetching_mailchimp_lists_can_take_a_while)] : '', this.done ? [this.success ? m('em.help.green', i18n.fetching_mailchimp_lists_done) : m('em.help.red', i18n.fetching_mailchimp_lists_error)] : ''])]);\n};\n\nmodule.exports = ListFetcher;\n\n},{}],5:[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 Settings = function Settings(context, helpers, events) {\n 'use strict'; // vars\n\n var form = context.querySelector('form');\n var listInputs = context.querySelectorAll('.mc4wp-list-input');\n var lists = mc4wp_vars.mailchimp.lists;\n var selectedLists = []; // functions\n\n function getSelectedListsWhere(searchKey, searchValue) {\n return selectedLists.filter(function (el) {\n return el[searchKey] === searchValue;\n });\n }\n\n function getSelectedLists() {\n return selectedLists;\n }\n\n function updateSelectedLists() {\n selectedLists = [];\n Array.prototype.forEach.call(listInputs, function (input) {\n // skip unchecked checkboxes\n if (typeof input.checked === \"boolean\" && !input.checked) {\n return;\n }\n\n if (_typeof(lists[input.value]) === \"object\") {\n selectedLists.push(lists[input.value]);\n }\n });\n events.trigger('selectedLists.change', [selectedLists]);\n return selectedLists;\n }\n\n function toggleVisibleLists() {\n var rows = document.querySelectorAll('.lists--only-selected > *');\n Array.prototype.forEach.call(rows, function (el) {\n var listId = el.getAttribute('data-list-id');\n var isSelected = getSelectedListsWhere('id', listId).length > 0;\n\n if (isSelected) {\n el.setAttribute('class', el.getAttribute('class').replace('hidden', ''));\n } else {\n el.setAttribute('class', el.getAttribute('class') + \" hidden\");\n }\n });\n }\n\n events.on('selectedLists.change', toggleVisibleLists);\n helpers.bindEventToElements(listInputs, 'change', updateSelectedLists);\n updateSelectedLists();\n return {\n getSelectedLists: getSelectedLists\n };\n};\n\nmodule.exports = Settings;\n\n},{}],6:[function(require,module,exports){\n'use strict';\n\nvar URL = require('./url.js'); // Tabs\n\n\nvar Tabs = function Tabs(context) {\n // TODO: last piece of jQuery... can we get rid of it?\n var $ = window.jQuery;\n var $context = $(context);\n var $tabs = $context.find('.tab');\n var $tabNavs = $context.find('.nav-tab');\n var refererField = context.querySelector('input[name=\"_wp_http_referer\"]');\n var tabs = [];\n $.each($tabs, function (i, t) {\n var id = t.id.substring(4);\n var title = $(t).find('h2').first().text();\n tabs.push({\n id: id,\n title: title,\n element: t,\n nav: context.querySelectorAll('.nav-tab-' + id),\n open: function open() {\n return _open(id);\n }\n });\n });\n\n function get(id) {\n for (var i = 0; i < tabs.length; i++) {\n if (tabs[i].id === id) {\n return tabs[i];\n }\n }\n\n return undefined;\n }\n\n function _open(tab, updateState) {\n // make sure we have a tab object\n if (typeof tab === \"string\") {\n tab = get(tab);\n }\n\n if (!tab) {\n return false;\n } // should we update state?\n\n\n if (updateState == undefined) {\n updateState = true;\n } // hide all tabs & remove active class\n\n\n $tabs.removeClass('tab-active').css('display', 'none');\n $tabNavs.removeClass('nav-tab-active'); // add `nav-tab-active` to this tab\n\n Array.prototype.forEach.call(tab.nav, function (nav) {\n nav.className += \" nav-tab-active\";\n nav.blur();\n }); // show target tab\n\n tab.element.style.display = 'block';\n tab.element.className += \" tab-active\"; // create new URL\n\n var url = URL.setParameter(window.location.href, \"tab\", tab.id); // update hash\n\n if (history.pushState && updateState) {\n history.pushState(tab.id, '', url);\n } // update document title\n\n\n title(tab); // update referer field\n\n refererField.value = url; // if thickbox is open, close it.\n\n if (typeof tb_remove === \"function\") {\n tb_remove();\n } // refresh editor after switching tabs\n // TODO: decouple this! law of demeter etc.\n\n\n if (tab.id === 'fields' && window.mc4wp && window.mc4wp.forms && window.mc4wp.forms.editor) {\n mc4wp.forms.editor.refresh();\n }\n\n return true;\n }\n\n function title(tab) {\n var title = document.title.split('-');\n document.title = document.title.replace(title[0], tab.title + \" \");\n }\n\n function switchTab(e) {\n e = e || window.event; // get from data attribute\n\n var tabId = this.getAttribute('data-tab'); // get from classname\n\n if (!tabId) {\n var match = this.className.match(/nav-tab-(\\w+)?/);\n\n if (match) {\n tabId = match[1];\n }\n } // get from href\n\n\n if (!tabId) {\n var urlParams = URL.parse(this.href);\n\n if (!urlParams.tab) {\n return;\n }\n\n tabId = urlParams.tab;\n }\n\n var opened = _open(tabId);\n\n if (opened) {\n e.preventDefault();\n e.returnValue = false;\n return false;\n }\n\n return true;\n }\n\n function init() {\n // check for current tab\n if (!history.pushState) {\n return;\n }\n\n var activeTab = $tabs.filter(':visible').get(0);\n\n if (!activeTab) {\n return;\n }\n\n var tab = get(activeTab.id.substring(4));\n if (!tab) return; // check if tab is in html5 history\n\n if (history.replaceState && history.state === null) {\n history.replaceState(tab.id, '');\n } // update document title\n\n\n title(tab);\n }\n\n $tabNavs.click(switchTab);\n $(document.body).on('click', '.tab-link', switchTab);\n init();\n\n if (window.addEventListener && history.pushState) {\n window.addEventListener('popstate', function (e) {\n if (!e.state) return true;\n var tabId = e.state;\n return _open(tabId, false);\n });\n }\n\n return {\n open: _open,\n get: get\n };\n};\n\nmodule.exports = Tabs;\n\n},{\"./url.js\":7}],7:[function(require,module,exports){\n'use strict';\n\nvar URL = {\n parse: function parse(url) {\n var query = {};\n var a = url.split('&');\n\n for (var i in a) {\n if (!a.hasOwnProperty(i)) {\n continue;\n }\n\n var b = a[i].split('=');\n query[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);\n }\n\n return query;\n },\n build: function build(data) {\n var ret = [];\n\n for (var d in data) {\n ret.push(d + \"=\" + encodeURIComponent(data[d]));\n }\n\n return ret.join(\"&\");\n },\n setParameter: function setParameter(url, key, value) {\n var data = URL.parse(url);\n data[key] = value;\n return URL.build(data);\n }\n};\nmodule.exports = URL;\n\n},{}],8:[function(require,module,exports){\n(function (global,setImmediate){\n;(function() {\n\"use strict\"\nfunction Vnode(tag, key, attrs0, children, text, dom) {\n\treturn {tag: tag, key: key, attrs: attrs0, children: children, text: text, dom: dom, domSize: undefined, state: undefined, _state: undefined, events: undefined, instance: undefined, skip: false}\n}\nVnode.normalize = function(node) {\n\tif (Array.isArray(node)) return Vnode(\"[\", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)\n\tif (node != null && typeof node !== \"object\") return Vnode(\"#\", undefined, undefined, node === false ? \"\" : node, undefined, undefined)\n\treturn node\n}\nVnode.normalizeChildren = function normalizeChildren(children) {\n\tfor (var i = 0; i < children.length; i++) {\n\t\tchildren[i] = Vnode.normalize(children[i])\n\t}\n\treturn children\n}\nvar selectorParser = /(?:(^|#|\\.)([^#\\.\\[\\]]+))|(\\[(.+?)(?:\\s*=\\s*(\"|'|)((?:\\\\[\"'\\]]|.)*?)\\5)?\\])/g\nvar selectorCache = {}\nvar hasOwn = {}.hasOwnProperty\nfunction isEmpty(object) {\n\tfor (var key in object) if (hasOwn.call(object, key)) return false\n\treturn true\n}\nfunction compileSelector(selector) {\n\tvar match, tag = \"div\", classes = [], attrs = {}\n\twhile (match = selectorParser.exec(selector)) {\n\t\tvar type = match[1], value = match[2]\n\t\tif (type === \"\" && value !== \"\") tag = value\n\t\telse if (type === \"#\") attrs.id = value\n\t\telse if (type === \".\") classes.push(value)\n\t\telse if (match[3][0] === \"[\") {\n\t\t\tvar attrValue = match[6]\n\t\t\tif (attrValue) attrValue = attrValue.replace(/\\\\([\"'])/g, \"$1\").replace(/\\\\\\\\/g, \"\\\\\")\n\t\t\tif (match[4] === \"class\") classes.push(attrValue)\n\t\t\telse attrs[match[4]] = attrValue === \"\" ? attrValue : attrValue || true\n\t\t}\n\t}\n\tif (classes.length > 0) attrs.className = classes.join(\" \")\n\treturn selectorCache[selector] = {tag: tag, attrs: attrs}\n}\nfunction execSelector(state, attrs, children) {\n\tvar hasAttrs = false, childList, text\n\tvar className = attrs.className || attrs.class\n\tif (!isEmpty(state.attrs) && !isEmpty(attrs)) {\n\t\tvar newAttrs = {}\n\t\tfor(var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key)) {\n\t\t\t\tnewAttrs[key] = attrs[key]\n\t\t\t}\n\t\t}\n\t\tattrs = newAttrs\n\t}\n\tfor (var key in state.attrs) {\n\t\tif (hasOwn.call(state.attrs, key)) {\n\t\t\tattrs[key] = state.attrs[key]\n\t\t}\n\t}\n\tif (className !== undefined) {\n\t\tif (attrs.class !== undefined) {\n\t\t\tattrs.class = undefined\n\t\t\tattrs.className = className\n\t\t}\n\t\tif (state.attrs.className != null) {\n\t\t\tattrs.className = state.attrs.className + \" \" + className\n\t\t}\n\t}\n\tfor (var key in attrs) {\n\t\tif (hasOwn.call(attrs, key) && key !== \"key\") {\n\t\t\thasAttrs = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === \"#\") {\n\t\ttext = children[0].children\n\t} else {\n\t\tchildList = children\n\t}\n\treturn Vnode(state.tag, attrs.key, hasAttrs ? attrs : undefined, childList, text)\n}\nfunction hyperscript(selector) {\n\t// Because sloppy mode sucks\n\tvar attrs = arguments[1], start = 2, children\n\tif (selector == null || typeof selector !== \"string\" && typeof selector !== \"function\" && typeof selector.view !== \"function\") {\n\t\tthrow Error(\"The selector must be either a string or a component.\");\n\t}\n\tif (typeof selector === \"string\") {\n\t\tvar cached = selectorCache[selector] || compileSelector(selector)\n\t}\n\tif (attrs == null) {\n\t\tattrs = {}\n\t} else if (typeof attrs !== \"object\" || attrs.tag != null || Array.isArray(attrs)) {\n\t\tattrs = {}\n\t\tstart = 1\n\t}\n\tif (arguments.length === start + 1) {\n\t\tchildren = arguments[start]\n\t\tif (!Array.isArray(children)) children = [children]\n\t} else {\n\t\tchildren = []\n\t\twhile (start < arguments.length) children.push(arguments[start++])\n\t}\n\tvar normalized = Vnode.normalizeChildren(children)\n\tif (typeof selector === \"string\") {\n\t\treturn execSelector(cached, attrs, normalized)\n\t} else {\n\t\treturn Vnode(selector, attrs.key, attrs, normalized)\n\t}\n}\nhyperscript.trust = function(html) {\n\tif (html == null) html = \"\"\n\treturn Vnode(\"<\", undefined, undefined, html, undefined, undefined)\n}\nhyperscript.fragment = function(attrs1, children) {\n\treturn Vnode(\"[\", attrs1.key, attrs1, Vnode.normalizeChildren(children), undefined, undefined)\n}\nvar m = hyperscript\n/** @constructor */\nvar PromisePolyfill = function(executor) {\n\tif (!(this instanceof PromisePolyfill)) throw new Error(\"Promise must be called with `new`\")\n\tif (typeof executor !== \"function\") throw new TypeError(\"executor must be a function\")\n\tvar self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false)\n\tvar instance = self._instance = {resolvers: resolvers, rejectors: rejectors}\n\tvar callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction handler(list, shouldAbsorb) {\n\t\treturn function execute(value) {\n\t\t\tvar then\n\t\t\ttry {\n\t\t\t\tif (shouldAbsorb && value != null && (typeof value === \"object\" || typeof value === \"function\") && typeof (then = value.then) === \"function\") {\n\t\t\t\t\tif (value === self) throw new TypeError(\"Promise can't be resolved w/ itself\")\n\t\t\t\t\texecuteOnce(then.bind(value))\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcallAsync(function() {\n\t\t\t\t\t\tif (!shouldAbsorb && list.length === 0) console.error(\"Possible unhandled promise rejection:\", value)\n\t\t\t\t\t\tfor (var i = 0; i < list.length; i++) list[i](value)\n\t\t\t\t\t\tresolvers.length = 0, rejectors.length = 0\n\t\t\t\t\t\tinstance.state = shouldAbsorb\n\t\t\t\t\t\tinstance.retry = function() {execute(value)}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\trejectCurrent(e)\n\t\t\t}\n\t\t}\n\t}\n\tfunction executeOnce(then) {\n\t\tvar runs = 0\n\t\tfunction run(fn) {\n\t\t\treturn function(value) {\n\t\t\t\tif (runs++ > 0) return\n\t\t\t\tfn(value)\n\t\t\t}\n\t\t}\n\t\tvar onerror = run(rejectCurrent)\n\t\ttry {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)}\n\t}\n\texecuteOnce(executor)\n}\nPromisePolyfill.prototype.then = function(onFulfilled, onRejection) {\n\tvar self = this, instance = self._instance\n\tfunction handle(callback, list, next, state) {\n\t\tlist.push(function(value) {\n\t\t\tif (typeof callback !== \"function\") next(value)\n\t\t\telse try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)}\n\t\t})\n\t\tif (typeof instance.retry === \"function\" && state === instance.state) instance.retry()\n\t}\n\tvar resolveNext, rejectNext\n\tvar promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject})\n\thandle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false)\n\treturn promise\n}\nPromisePolyfill.prototype.catch = function(onRejection) {\n\treturn this.then(null, onRejection)\n}\nPromisePolyfill.resolve = function(value) {\n\tif (value instanceof PromisePolyfill) return value\n\treturn new PromisePolyfill(function(resolve) {resolve(value)})\n}\nPromisePolyfill.reject = function(value) {\n\treturn new PromisePolyfill(function(resolve, reject) {reject(value)})\n}\nPromisePolyfill.all = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tvar total = list.length, count = 0, values = []\n\t\tif (list.length === 0) resolve([])\n\t\telse for (var i = 0; i < list.length; i++) {\n\t\t\t(function(i) {\n\t\t\t\tfunction consume(value) {\n\t\t\t\t\tcount++\n\t\t\t\t\tvalues[i] = value\n\t\t\t\t\tif (count === total) resolve(values)\n\t\t\t\t}\n\t\t\t\tif (list[i] != null && (typeof list[i] === \"object\" || typeof list[i] === \"function\") && typeof list[i].then === \"function\") {\n\t\t\t\t\tlist[i].then(consume, reject)\n\t\t\t\t}\n\t\t\t\telse consume(list[i])\n\t\t\t})(i)\n\t\t}\n\t})\n}\nPromisePolyfill.race = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\tlist[i].then(resolve, reject)\n\t\t}\n\t})\n}\nif (typeof window !== \"undefined\") {\n\tif (typeof window.Promise === \"undefined\") window.Promise = PromisePolyfill\n\tvar PromisePolyfill = window.Promise\n} else if (typeof global !== \"undefined\") {\n\tif (typeof global.Promise === \"undefined\") global.Promise = PromisePolyfill\n\tvar PromisePolyfill = global.Promise\n} else {\n}\nvar buildQueryString = function(object) {\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") return \"\"\n\tvar args = []\n\tfor (var key0 in object) {\n\t\tdestructure(key0, object[key0])\n\t}\n\treturn args.join(\"&\")\n\tfunction destructure(key0, value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tdestructure(key0 + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse if (Object.prototype.toString.call(value) === \"[object Object]\") {\n\t\t\tfor (var i in value) {\n\t\t\t\tdestructure(key0 + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse args.push(encodeURIComponent(key0) + (value != null && value !== \"\" ? \"=\" + encodeURIComponent(value) : \"\"))\n\t}\n}\nvar FILE_PROTOCOL_REGEX = new RegExp(\"^file://\", \"i\")\nvar _8 = function($window, Promise) {\n\tvar callbackCount = 0\n\tvar oncompletion\n\tfunction setCompletionCallback(callback) {oncompletion = callback}\n\tfunction finalizer() {\n\t\tvar count = 0\n\t\tfunction complete() {if (--count === 0 && typeof oncompletion === \"function\") oncompletion()}\n\t\treturn function finalize(promise0) {\n\t\t\tvar then0 = promise0.then\n\t\t\tpromise0.then = function() {\n\t\t\t\tcount++\n\t\t\t\tvar next = then0.apply(promise0, arguments)\n\t\t\t\tnext.then(complete, function(e) {\n\t\t\t\t\tcomplete()\n\t\t\t\t\tif (count === 0) throw e\n\t\t\t\t})\n\t\t\t\treturn finalize(next)\n\t\t\t}\n\t\t\treturn promise0\n\t\t}\n\t}\n\tfunction normalize(args, extra) {\n\t\tif (typeof args === \"string\") {\n\t\t\tvar url = args\n\t\t\targs = extra || {}\n\t\t\tif (args.url == null) args.url = url\n\t\t}\n\t\treturn args\n\t}\n\tfunction request(args, extra) {\n\t\tvar finalize = finalizer()\n\t\targs = normalize(args, extra)\n\t\tvar promise0 = new Promise(function(resolve, reject) {\n\t\t\tif (args.method == null) args.method = \"GET\"\n\t\t\targs.method = args.method.toUpperCase()\n\t\t\tvar useBody = (args.method === \"GET\" || args.method === \"TRACE\") ? false : (typeof args.useBody === \"boolean\" ? args.useBody : true)\n\t\t\tif (typeof args.serialize !== \"function\") args.serialize = typeof FormData !== \"undefined\" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify\n\t\t\tif (typeof args.deserialize !== \"function\") args.deserialize = deserialize\n\t\t\tif (typeof args.extract !== \"function\") args.extract = extract\n\t\t\targs.url = interpolate(args.url, args.data)\n\t\t\tif (useBody) args.data = args.serialize(args.data)\n\t\t\telse args.url = assemble(args.url, args.data)\n\t\t\tvar xhr = new $window.XMLHttpRequest(),\n\t\t\t\taborted = false,\n\t\t\t\t_abort = xhr.abort\n\t\t\txhr.abort = function abort() {\n\t\t\t\taborted = true\n\t\t\t\t_abort.call(xhr)\n\t\t\t}\n\t\t\txhr.open(args.method, args.url, typeof args.async === \"boolean\" ? args.async : true, typeof args.user === \"string\" ? args.user : undefined, typeof args.password === \"string\" ? args.password : undefined)\n\t\t\tif (args.serialize === JSON.stringify && useBody && !(args.headers && args.headers.hasOwnProperty(\"Content-Type\"))) {\n\t\t\t\txhr.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\t}\n\t\t\tif (args.deserialize === deserialize && !(args.headers && args.headers.hasOwnProperty(\"Accept\"))) {\n\t\t\t\txhr.setRequestHeader(\"Accept\", \"application/json, text/*\")\n\t\t\t}\n\t\t\tif (args.withCredentials) xhr.withCredentials = args.withCredentials\n\t\t\tfor (var key in args.headers) if ({}.hasOwnProperty.call(args.headers, key)) {\n\t\t\t\txhr.setRequestHeader(key, args.headers[key])\n\t\t\t}\n\t\t\tif (typeof args.config === \"function\") xhr = args.config(xhr, args) || xhr\n\t\t\txhr.onreadystatechange = function() {\n\t\t\t\t// Don't throw errors on xhr.abort().\n\t\t\t\tif(aborted) return\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))\n\t\t\t\t\t\tif ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) {\n\t\t\t\t\t\t\tresolve(cast(args.type, response))\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar error = new Error(xhr.responseText)\n\t\t\t\t\t\t\tfor (var key in response) error[key] = response[key]\n\t\t\t\t\t\t\treject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\treject(e)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (useBody && (args.data != null)) xhr.send(args.data)\n\t\t\telse xhr.send()\n\t\t})\n\t\treturn args.background === true ? promise0 : finalize(promise0)\n\t}\n\tfunction jsonp(args, extra) {\n\t\tvar finalize = finalizer()\n\t\targs = normalize(args, extra)\n\t\tvar promise0 = new Promise(function(resolve, reject) {\n\t\t\tvar callbackName = args.callbackName || \"_mithril_\" + Math.round(Math.random() * 1e16) + \"_\" + callbackCount++\n\t\t\tvar script = $window.document.createElement(\"script\")\n\t\t\t$window[callbackName] = function(data) {\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\tresolve(cast(args.type, data))\n\t\t\t\tdelete $window[callbackName]\n\t\t\t}\n\t\t\tscript.onerror = function() {\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\treject(new Error(\"JSONP request failed\"))\n\t\t\t\tdelete $window[callbackName]\n\t\t\t}\n\t\t\tif (args.data == null) args.data = {}\n\t\t\targs.url = interpolate(args.url, args.data)\n\t\t\targs.data[args.callbackKey || \"callback\"] = callbackName\n\t\t\tscript.src = assemble(args.url, args.data)\n\t\t\t$window.document.documentElement.appendChild(script)\n\t\t})\n\t\treturn args.background === true? promise0 : finalize(promise0)\n\t}\n\tfunction interpolate(url, data) {\n\t\tif (data == null) return url\n\t\tvar tokens = url.match(/:[^\\/]+/gi) || []\n\t\tfor (var i = 0; i < tokens.length; i++) {\n\t\t\tvar key = tokens[i].slice(1)\n\t\t\tif (data[key] != null) {\n\t\t\t\turl = url.replace(tokens[i], data[key])\n\t\t\t}\n\t\t}\n\t\treturn url\n\t}\n\tfunction assemble(url, data) {\n\t\tvar querystring = buildQueryString(data)\n\t\tif (querystring !== \"\") {\n\t\t\tvar prefix = url.indexOf(\"?\") < 0 ? \"?\" : \"&\"\n\t\t\turl += prefix + querystring\n\t\t}\n\t\treturn url\n\t}\n\tfunction deserialize(data) {\n\t\ttry {return data !== \"\" ? JSON.parse(data) : null}\n\t\tcatch (e) {throw new Error(data)}\n\t}\n\tfunction extract(xhr) {return xhr.responseText}\n\tfunction cast(type0, data) {\n\t\tif (typeof type0 === \"function\") {\n\t\t\tif (Array.isArray(data)) {\n\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\t\tdata[i] = new type0(data[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\telse return new type0(data)\n\t\t}\n\t\treturn data\n\t}\n\treturn {request: request, jsonp: jsonp, setCompletionCallback: setCompletionCallback}\n}\nvar requestService = _8(window, PromisePolyfill)\nvar coreRenderer = function($window) {\n\tvar $doc = $window.document\n\tvar $emptyFragment = $doc.createDocumentFragment()\n\tvar nameSpace = {\n\t\tsvg: \"http://www.w3.org/2000/svg\",\n\t\tmath: \"http://www.w3.org/1998/Math/MathML\"\n\t}\n\tvar onevent\n\tfunction setEventCallback(callback) {return onevent = callback}\n\tfunction getNameSpace(vnode) {\n\t\treturn vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag]\n\t}\n\t//create\n\tfunction createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t}\n\tfunction createNode(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tif (typeof tag === \"string\") {\n\t\t\tvnode.state = {}\n\t\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tswitch (tag) {\n\t\t\t\tcase \"#\": return createText(parent, vnode, nextSibling)\n\t\t\t\tcase \"<\": return createHTML(parent, vnode, nextSibling)\n\t\t\t\tcase \"[\": return createFragment(parent, vnode, hooks, ns, nextSibling)\n\t\t\t\tdefault: return createElement(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t\telse return createComponent(parent, vnode, hooks, ns, nextSibling)\n\t}\n\tfunction createText(parent, vnode, nextSibling) {\n\t\tvnode.dom = $doc.createTextNode(vnode.children)\n\t\tinsertNode(parent, vnode.dom, nextSibling)\n\t\treturn vnode.dom\n\t}\n\tfunction createHTML(parent, vnode, nextSibling) {\n\t\tvar match1 = vnode.children.match(/^\\s*?<(\\w+)/im) || []\n\t\tvar parent1 = {caption: \"table\", thead: \"table\", tbody: \"table\", tfoot: \"table\", tr: \"tbody\", th: \"tr\", td: \"tr\", colgroup: \"table\", col: \"colgroup\"}[match1[1]] || \"div\"\n\t\tvar temp = $doc.createElement(parent1)\n\t\ttemp.innerHTML = vnode.children\n\t\tvnode.dom = temp.firstChild\n\t\tvnode.domSize = temp.childNodes.length\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tvar child\n\t\twhile (child = temp.firstChild) {\n\t\t\tfragment.appendChild(child)\n\t\t}\n\t\tinsertNode(parent, fragment, nextSibling)\n\t\treturn fragment\n\t}\n\tfunction createFragment(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tif (vnode.children != null) {\n\t\t\tvar children = vnode.children\n\t\t\tcreateNodes(fragment, children, 0, children.length, hooks, null, ns)\n\t\t}\n\t\tvnode.dom = fragment.firstChild\n\t\tvnode.domSize = fragment.childNodes.length\n\t\tinsertNode(parent, fragment, nextSibling)\n\t\treturn fragment\n\t}\n\tfunction createElement(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tvar attrs2 = vnode.attrs\n\t\tvar is = attrs2 && attrs2.is\n\t\tns = getNameSpace(vnode) || ns\n\t\tvar element = ns ?\n\t\t\tis ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) :\n\t\t\tis ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag)\n\t\tvnode.dom = element\n\t\tif (attrs2 != null) {\n\t\t\tsetAttrs(vnode, attrs2, ns)\n\t\t}\n\t\tinsertNode(parent, element, nextSibling)\n\t\tif (vnode.attrs != null && vnode.attrs.contenteditable != null) {\n\t\t\tsetContentEditable(vnode)\n\t\t}\n\t\telse {\n\t\t\tif (vnode.text != null) {\n\t\t\t\tif (vnode.text !== \"\") element.textContent = vnode.text\n\t\t\t\telse vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\t}\n\t\t\tif (vnode.children != null) {\n\t\t\t\tvar children = vnode.children\n\t\t\t\tcreateNodes(element, children, 0, children.length, hooks, null, ns)\n\t\t\t\tsetLateAttrs(vnode)\n\t\t\t}\n\t\t}\n\t\treturn element\n\t}\n\tfunction initComponent(vnode, hooks) {\n\t\tvar sentinel\n\t\tif (typeof vnode.tag.view === \"function\") {\n\t\t\tvnode.state = Object.create(vnode.tag)\n\t\t\tsentinel = vnode.state.view\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return $emptyFragment\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t} else {\n\t\t\tvnode.state = void 0\n\t\t\tsentinel = vnode.tag\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return $emptyFragment\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t\tvnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === \"function\") ? new vnode.tag(vnode) : vnode.tag(vnode)\n\t\t}\n\t\tvnode._state = vnode.state\n\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\tinitLifecycle(vnode._state, vnode, hooks)\n\t\tvnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tsentinel.$$reentrantLock$$ = null\n\t}\n\tfunction createComponent(parent, vnode, hooks, ns, nextSibling) {\n\t\tinitComponent(vnode, hooks)\n\t\tif (vnode.instance != null) {\n\t\t\tvar element = createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0\n\t\t\tinsertNode(parent, element, nextSibling)\n\t\t\treturn element\n\t\t}\n\t\telse {\n\t\t\tvnode.domSize = 0\n\t\t\treturn $emptyFragment\n\t\t}\n\t}\n\t//update\n\tfunction updateNodes(parent, old, vnodes, recycling, hooks, nextSibling, ns) {\n\t\tif (old === vnodes || old == null && vnodes == null) return\n\t\telse if (old == null) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)\n\t\telse if (vnodes == null) removeNodes(old, 0, old.length, vnodes)\n\t\telse {\n\t\t\tif (old.length === vnodes.length) {\n\t\t\t\tvar isUnkeyed = false\n\t\t\t\tfor (var i = 0; i < vnodes.length; i++) {\n\t\t\t\t\tif (vnodes[i] != null && old[i] != null) {\n\t\t\t\t\t\tisUnkeyed = vnodes[i].key == null && old[i].key == null\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isUnkeyed) {\n\t\t\t\t\tfor (var i = 0; i < old.length; i++) {\n\t\t\t\t\t\tif (old[i] === vnodes[i]) continue\n\t\t\t\t\t\telse if (old[i] == null && vnodes[i] != null) createNode(parent, vnodes[i], hooks, ns, getNextSibling(old, i + 1, nextSibling))\n\t\t\t\t\t\telse if (vnodes[i] == null) removeNodes(old, i, i + 1, vnodes)\n\t\t\t\t\t\telse updateNode(parent, old[i], vnodes[i], hooks, getNextSibling(old, i + 1, nextSibling), recycling, ns)\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\trecycling = recycling || isRecyclable(old, vnodes)\n\t\t\tif (recycling) {\n\t\t\t\tvar pool = old.pool\n\t\t\t\told = old.concat(old.pool)\n\t\t\t}\n\t\t\tvar oldStart = 0, start = 0, oldEnd = old.length - 1, end = vnodes.length - 1, map\n\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\tvar o = old[oldStart], v = vnodes[start]\n\t\t\t\tif (o === v && !recycling) oldStart++, start++\n\t\t\t\telse if (o == null) oldStart++\n\t\t\t\telse if (v == null) start++\n\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\tvar shouldRecycle = (pool != null && oldStart >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\toldStart++, start++\n\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), shouldRecycle, ns)\n\t\t\t\t\tif (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar o = old[oldEnd]\n\t\t\t\t\tif (o === v && !recycling) oldEnd--, start++\n\t\t\t\t\telse if (o == null) oldEnd--\n\t\t\t\t\telse if (v == null) start++\n\t\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\t\tvar shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)\n\t\t\t\t\t\tif (recycling || start < end) insertNode(parent, toFragment(o), getNextSibling(old, oldStart, nextSibling))\n\t\t\t\t\t\toldEnd--, start++\n\t\t\t\t\t}\n\t\t\t\t\telse break\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\tvar o = old[oldEnd], v = vnodes[end]\n\t\t\t\tif (o === v && !recycling) oldEnd--, end--\n\t\t\t\telse if (o == null) oldEnd--\n\t\t\t\telse if (v == null) end--\n\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\tvar shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)\n\t\t\t\t\tif (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)\n\t\t\t\t\tif (o.dom != null) nextSibling = o.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!map) map = getKeyMap(old, oldEnd)\n\t\t\t\t\tif (v != null) {\n\t\t\t\t\t\tvar oldIndex = map[v.key]\n\t\t\t\t\t\tif (oldIndex != null) {\n\t\t\t\t\t\t\tvar movable = old[oldIndex]\n\t\t\t\t\t\t\tvar shouldRecycle = (pool != null && oldIndex >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\t\t\tupdateNode(parent, movable, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), recycling, ns)\n\t\t\t\t\t\t\tinsertNode(parent, toFragment(movable), nextSibling)\n\t\t\t\t\t\t\told[oldIndex].skip = true\n\t\t\t\t\t\t\tif (movable.dom != null) nextSibling = movable.dom\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar dom = createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\tnextSibling = dom\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tend--\n\t\t\t\t}\n\t\t\t\tif (end < start) break\n\t\t\t}\n\t\t\tcreateNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\tremoveNodes(old, oldStart, oldEnd + 1, vnodes)\n\t\t}\n\t}\n\tfunction updateNode(parent, old, vnode, hooks, nextSibling, recycling, ns) {\n\t\tvar oldTag = old.tag, tag = vnode.tag\n\t\tif (oldTag === tag) {\n\t\t\tvnode.state = old.state\n\t\t\tvnode._state = old._state\n\t\t\tvnode.events = old.events\n\t\t\tif (!recycling && shouldNotUpdate(vnode, old)) return\n\t\t\tif (typeof oldTag === \"string\") {\n\t\t\t\tif (vnode.attrs != null) {\n\t\t\t\t\tif (recycling) {\n\t\t\t\t\t\tvnode.state = {}\n\t\t\t\t\t\tinitLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t\t}\n\t\t\t\t\telse updateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t}\n\t\t\t\tswitch (oldTag) {\n\t\t\t\t\tcase \"#\": updateText(old, vnode); break\n\t\t\t\t\tcase \"<\": updateHTML(parent, old, vnode, nextSibling); break\n\t\t\t\t\tcase \"[\": updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns); break\n\t\t\t\t\tdefault: updateElement(old, vnode, recycling, hooks, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t\telse updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns)\n\t\t}\n\t\telse {\n\t\t\tremoveNode(old, null)\n\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t}\n\t}\n\tfunction updateText(old, vnode) {\n\t\tif (old.children.toString() !== vnode.children.toString()) {\n\t\t\told.dom.nodeValue = vnode.children\n\t\t}\n\t\tvnode.dom = old.dom\n\t}\n\tfunction updateHTML(parent, old, vnode, nextSibling) {\n\t\tif (old.children !== vnode.children) {\n\t\t\ttoFragment(old)\n\t\t\tcreateHTML(parent, vnode, nextSibling)\n\t\t}\n\t\telse vnode.dom = old.dom, vnode.domSize = old.domSize\n\t}\n\tfunction updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns) {\n\t\tupdateNodes(parent, old.children, vnode.children, recycling, hooks, nextSibling, ns)\n\t\tvar domSize = 0, children = vnode.children\n\t\tvnode.dom = null\n\t\tif (children != null) {\n\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\tvar child = children[i]\n\t\t\t\tif (child != null && child.dom != null) {\n\t\t\t\t\tif (vnode.dom == null) vnode.dom = child.dom\n\t\t\t\t\tdomSize += child.domSize || 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (domSize !== 1) vnode.domSize = domSize\n\t\t}\n\t}\n\tfunction updateElement(old, vnode, recycling, hooks, ns) {\n\t\tvar element = vnode.dom = old.dom\n\t\tns = getNameSpace(vnode) || ns\n\t\tif (vnode.tag === \"textarea\") {\n\t\t\tif (vnode.attrs == null) vnode.attrs = {}\n\t\t\tif (vnode.text != null) {\n\t\t\t\tvnode.attrs.value = vnode.text //FIXME handle0 multiple children\n\t\t\t\tvnode.text = undefined\n\t\t\t}\n\t\t}\n\t\tupdateAttrs(vnode, old.attrs, vnode.attrs, ns)\n\t\tif (vnode.attrs != null && vnode.attrs.contenteditable != null) {\n\t\t\tsetContentEditable(vnode)\n\t\t}\n\t\telse if (old.text != null && vnode.text != null && vnode.text !== \"\") {\n\t\t\tif (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text\n\t\t}\n\t\telse {\n\t\t\tif (old.text != null) old.children = [Vnode(\"#\", undefined, undefined, old.text, undefined, old.dom.firstChild)]\n\t\t\tif (vnode.text != null) vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\tupdateNodes(element, old.children, vnode.children, recycling, hooks, null, ns)\n\t\t}\n\t}\n\tfunction updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) {\n\t\tif (recycling) {\n\t\t\tinitComponent(vnode, hooks)\n\t\t} else {\n\t\t\tvnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))\n\t\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\t\tif (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tupdateLifecycle(vnode._state, vnode, hooks)\n\t\t}\n\t\tif (vnode.instance != null) {\n\t\t\tif (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\telse updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.instance.domSize\n\t\t}\n\t\telse if (old.instance != null) {\n\t\t\tremoveNode(old.instance, null)\n\t\t\tvnode.dom = undefined\n\t\t\tvnode.domSize = 0\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t}\n\t}\n\tfunction isRecyclable(old, vnodes) {\n\t\tif (old.pool != null && Math.abs(old.pool.length - vnodes.length) <= Math.abs(old.length - vnodes.length)) {\n\t\t\tvar oldChildrenLength = old[0] && old[0].children && old[0].children.length || 0\n\t\t\tvar poolChildrenLength = old.pool[0] && old.pool[0].children && old.pool[0].children.length || 0\n\t\t\tvar vnodesChildrenLength = vnodes[0] && vnodes[0].children && vnodes[0].children.length || 0\n\t\t\tif (Math.abs(poolChildrenLength - vnodesChildrenLength) <= Math.abs(oldChildrenLength - vnodesChildrenLength)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n\tfunction getKeyMap(vnodes, end) {\n\t\tvar map = {}, i = 0\n\t\tfor (var i = 0; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tvar key2 = vnode.key\n\t\t\t\tif (key2 != null) map[key2] = i\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}\n\tfunction toFragment(vnode) {\n\t\tvar count0 = vnode.domSize\n\t\tif (count0 != null || vnode.dom == null) {\n\t\t\tvar fragment = $doc.createDocumentFragment()\n\t\t\tif (count0 > 0) {\n\t\t\t\tvar dom = vnode.dom\n\t\t\t\twhile (--count0) fragment.appendChild(dom.nextSibling)\n\t\t\t\tfragment.insertBefore(dom, fragment.firstChild)\n\t\t\t}\n\t\t\treturn fragment\n\t\t}\n\t\telse return vnode.dom\n\t}\n\tfunction getNextSibling(vnodes, i, nextSibling) {\n\t\tfor (; i < vnodes.length; i++) {\n\t\t\tif (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom\n\t\t}\n\t\treturn nextSibling\n\t}\n\tfunction insertNode(parent, dom, nextSibling) {\n\t\tif (nextSibling && nextSibling.parentNode) parent.insertBefore(dom, nextSibling)\n\t\telse parent.appendChild(dom)\n\t}\n\tfunction setContentEditable(vnode) {\n\t\tvar children = vnode.children\n\t\tif (children != null && children.length === 1 && children[0].tag === \"<\") {\n\t\t\tvar content = children[0].children\n\t\t\tif (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content\n\t\t}\n\t\telse if (vnode.text != null || children != null && children.length !== 0) throw new Error(\"Child node of a contenteditable must be trusted\")\n\t}\n\t//remove\n\tfunction removeNodes(vnodes, start, end, context) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tif (vnode.skip) vnode.skip = false\n\t\t\t\telse removeNode(vnode, context)\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeNode(vnode, context) {\n\t\tvar expected = 1, called = 0\n\t\tif (vnode.attrs && typeof vnode.attrs.onbeforeremove === \"function\") {\n\t\t\tvar result = vnode.attrs.onbeforeremove.call(vnode.state, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\texpected++\n\t\t\t\tresult.then(continuation, continuation)\n\t\t\t}\n\t\t}\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onbeforeremove === \"function\") {\n\t\t\tvar result = vnode._state.onbeforeremove.call(vnode.state, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\texpected++\n\t\t\t\tresult.then(continuation, continuation)\n\t\t\t}\n\t\t}\n\t\tcontinuation()\n\t\tfunction continuation() {\n\t\t\tif (++called === expected) {\n\t\t\t\tonremove(vnode)\n\t\t\t\tif (vnode.dom) {\n\t\t\t\t\tvar count0 = vnode.domSize || 1\n\t\t\t\t\tif (count0 > 1) {\n\t\t\t\t\t\tvar dom = vnode.dom\n\t\t\t\t\t\twhile (--count0) {\n\t\t\t\t\t\t\tremoveNodeFromDOM(dom.nextSibling)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tremoveNodeFromDOM(vnode.dom)\n\t\t\t\t\tif (context != null && vnode.domSize == null && !hasIntegrationMethods(vnode.attrs) && typeof vnode.tag === \"string\") { //TODO test custom elements\n\t\t\t\t\t\tif (!context.pool) context.pool = [vnode]\n\t\t\t\t\t\telse context.pool.push(vnode)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeNodeFromDOM(node) {\n\t\tvar parent = node.parentNode\n\t\tif (parent != null) parent.removeChild(node)\n\t}\n\tfunction onremove(vnode) {\n\t\tif (vnode.attrs && typeof vnode.attrs.onremove === \"function\") vnode.attrs.onremove.call(vnode.state, vnode)\n\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\tif (typeof vnode._state.onremove === \"function\") vnode._state.onremove.call(vnode.state, vnode)\n\t\t\tif (vnode.instance != null) onremove(vnode.instance)\n\t\t} else {\n\t\t\tvar children = vnode.children\n\t\t\tif (Array.isArray(children)) {\n\t\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\t\tvar child = children[i]\n\t\t\t\t\tif (child != null) onremove(child)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//attrs2\n\tfunction setAttrs(vnode, attrs2, ns) {\n\t\tfor (var key2 in attrs2) {\n\t\t\tsetAttr(vnode, key2, null, attrs2[key2], ns)\n\t\t}\n\t}\n\tfunction setAttr(vnode, key2, old, value, ns) {\n\t\tvar element = vnode.dom\n\t\tif (key2 === \"key\" || key2 === \"is\" || (old === value && !isFormAttribute(vnode, key2)) && typeof value !== \"object\" || typeof value === \"undefined\" || isLifecycleMethod(key2)) return\n\t\tvar nsLastIndex = key2.indexOf(\":\")\n\t\tif (nsLastIndex > -1 && key2.substr(0, nsLastIndex) === \"xlink\") {\n\t\t\telement.setAttributeNS(\"http://www.w3.org/1999/xlink\", key2.slice(nsLastIndex + 1), value)\n\t\t}\n\t\telse if (key2[0] === \"o\" && key2[1] === \"n\" && typeof value === \"function\") updateEvent(vnode, key2, value)\n\t\telse if (key2 === \"style\") updateStyle(element, old, value)\n\t\telse if (key2 in element && !isAttribute(key2) && ns === undefined && !isCustomElement(vnode)) {\n\t\t\tif (key2 === \"value\") {\n\t\t\t\tvar normalized0 = \"\" + value // eslint-disable-line no-implicit-coercion\n\t\t\t\t//setting input[value] to same value by typing on focused element moves cursor to end in Chrome\n\t\t\t\tif ((vnode.tag === \"input\" || vnode.tag === \"textarea\") && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return\n\t\t\t\t//setting select[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"select\") {\n\t\t\t\t\tif (value === null) {\n\t\t\t\t\t\tif (vnode.dom.selectedIndex === -1 && vnode.dom === $doc.activeElement) return\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (old !== null && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//setting option[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"option\" && old != null && vnode.dom.value === normalized0) return\n\t\t\t}\n\t\t\t// If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur.\n\t\t\tif (vnode.tag === \"input\" && key2 === \"type\") {\n\t\t\t\telement.setAttribute(key2, value)\n\t\t\t\treturn\n\t\t\t}\n\t\t\telement[key2] = value\n\t\t}\n\t\telse {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tif (value) element.setAttribute(key2, \"\")\n\t\t\t\telse element.removeAttribute(key2)\n\t\t\t}\n\t\t\telse element.setAttribute(key2 === \"className\" ? \"class\" : key2, value)\n\t\t}\n\t}\n\tfunction setLateAttrs(vnode) {\n\t\tvar attrs2 = vnode.attrs\n\t\tif (vnode.tag === \"select\" && attrs2 != null) {\n\t\t\tif (\"value\" in attrs2) setAttr(vnode, \"value\", null, attrs2.value, undefined)\n\t\t\tif (\"selectedIndex\" in attrs2) setAttr(vnode, \"selectedIndex\", null, attrs2.selectedIndex, undefined)\n\t\t}\n\t}\n\tfunction updateAttrs(vnode, old, attrs2, ns) {\n\t\tif (attrs2 != null) {\n\t\t\tfor (var key2 in attrs2) {\n\t\t\t\tsetAttr(vnode, key2, old && old[key2], attrs2[key2], ns)\n\t\t\t}\n\t\t}\n\t\tif (old != null) {\n\t\t\tfor (var key2 in old) {\n\t\t\t\tif (attrs2 == null || !(key2 in attrs2)) {\n\t\t\t\t\tif (key2 === \"className\") key2 = \"class\"\n\t\t\t\t\tif (key2[0] === \"o\" && key2[1] === \"n\" && !isLifecycleMethod(key2)) updateEvent(vnode, key2, undefined)\n\t\t\t\t\telse if (key2 !== \"key\") vnode.dom.removeAttribute(key2)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction isFormAttribute(vnode, attr) {\n\t\treturn attr === \"value\" || attr === \"checked\" || attr === \"selectedIndex\" || attr === \"selected\" && vnode.dom === $doc.activeElement\n\t}\n\tfunction isLifecycleMethod(attr) {\n\t\treturn attr === \"oninit\" || attr === \"oncreate\" || attr === \"onupdate\" || attr === \"onremove\" || attr === \"onbeforeremove\" || attr === \"onbeforeupdate\"\n\t}\n\tfunction isAttribute(attr) {\n\t\treturn attr === \"href\" || attr === \"list\" || attr === \"form\" || attr === \"width\" || attr === \"height\"// || attr === \"type\"\n\t}\n\tfunction isCustomElement(vnode){\n\t\treturn vnode.attrs.is || vnode.tag.indexOf(\"-\") > -1\n\t}\n\tfunction hasIntegrationMethods(source) {\n\t\treturn source != null && (source.oncreate || source.onupdate || source.onbeforeremove || source.onremove)\n\t}\n\t//style\n\tfunction updateStyle(element, old, style) {\n\t\tif (old === style) element.style.cssText = \"\", old = null\n\t\tif (style == null) element.style.cssText = \"\"\n\t\telse if (typeof style === \"string\") element.style.cssText = style\n\t\telse {\n\t\t\tif (typeof old === \"string\") element.style.cssText = \"\"\n\t\t\tfor (var key2 in style) {\n\t\t\t\telement.style[key2] = style[key2]\n\t\t\t}\n\t\t\tif (old != null && typeof old !== \"string\") {\n\t\t\t\tfor (var key2 in old) {\n\t\t\t\t\tif (!(key2 in style)) element.style[key2] = \"\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//event\n\tfunction updateEvent(vnode, key2, value) {\n\t\tvar element = vnode.dom\n\t\tvar callback = typeof onevent !== \"function\" ? value : function(e) {\n\t\t\tvar result = value.call(element, e)\n\t\t\tonevent.call(element, e)\n\t\t\treturn result\n\t\t}\n\t\tif (key2 in element) element[key2] = typeof value === \"function\" ? callback : null\n\t\telse {\n\t\t\tvar eventName = key2.slice(2)\n\t\t\tif (vnode.events === undefined) vnode.events = {}\n\t\t\tif (vnode.events[key2] === callback) return\n\t\t\tif (vnode.events[key2] != null) element.removeEventListener(eventName, vnode.events[key2], false)\n\t\t\tif (typeof value === \"function\") {\n\t\t\t\tvnode.events[key2] = callback\n\t\t\t\telement.addEventListener(eventName, vnode.events[key2], false)\n\t\t\t}\n\t\t}\n\t}\n\t//lifecycle\n\tfunction initLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.oninit === \"function\") source.oninit.call(vnode.state, vnode)\n\t\tif (typeof source.oncreate === \"function\") hooks.push(source.oncreate.bind(vnode.state, vnode))\n\t}\n\tfunction updateLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.onupdate === \"function\") hooks.push(source.onupdate.bind(vnode.state, vnode))\n\t}\n\tfunction shouldNotUpdate(vnode, old) {\n\t\tvar forceVnodeUpdate, forceComponentUpdate\n\t\tif (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === \"function\") forceVnodeUpdate = vnode.attrs.onbeforeupdate.call(vnode.state, vnode, old)\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onbeforeupdate === \"function\") forceComponentUpdate = vnode._state.onbeforeupdate.call(vnode.state, vnode, old)\n\t\tif (!(forceVnodeUpdate === undefined && forceComponentUpdate === undefined) && !forceVnodeUpdate && !forceComponentUpdate) {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t\tvnode.instance = old.instance\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\tfunction render(dom, vnodes) {\n\t\tif (!dom) throw new Error(\"Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.\")\n\t\tvar hooks = []\n\t\tvar active = $doc.activeElement\n\t\tvar namespace = dom.namespaceURI\n\t\t// First time0 rendering into a node clears it out\n\t\tif (dom.vnodes == null) dom.textContent = \"\"\n\t\tif (!Array.isArray(vnodes)) vnodes = [vnodes]\n\t\tupdateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, namespace === \"http://www.w3.org/1999/xhtml\" ? undefined : namespace)\n\t\tdom.vnodes = vnodes\n\t\t// document.activeElement can return null in IE https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement\n\t\tif (active != null && $doc.activeElement !== active) active.focus()\n\t\tfor (var i = 0; i < hooks.length; i++) hooks[i]()\n\t}\n\treturn {render: render, setEventCallback: setEventCallback}\n}\nfunction throttle(callback) {\n\t//60fps translates to 16.6ms, round it down since setTimeout requires int\n\tvar time = 16\n\tvar last = 0, pending = null\n\tvar timeout = typeof requestAnimationFrame === \"function\" ? requestAnimationFrame : setTimeout\n\treturn function() {\n\t\tvar now = Date.now()\n\t\tif (last === 0 || now - last >= time) {\n\t\t\tlast = now\n\t\t\tcallback()\n\t\t}\n\t\telse if (pending === null) {\n\t\t\tpending = timeout(function() {\n\t\t\t\tpending = null\n\t\t\t\tcallback()\n\t\t\t\tlast = Date.now()\n\t\t\t}, time - (now - last))\n\t\t}\n\t}\n}\nvar _11 = function($window) {\n\tvar renderService = coreRenderer($window)\n\trenderService.setEventCallback(function(e) {\n\t\tif (e.redraw === false) e.redraw = undefined\n\t\telse redraw()\n\t})\n\tvar callbacks = []\n\tfunction subscribe(key1, callback) {\n\t\tunsubscribe(key1)\n\t\tcallbacks.push(key1, throttle(callback))\n\t}\n\tfunction unsubscribe(key1) {\n\t\tvar index = callbacks.indexOf(key1)\n\t\tif (index > -1) callbacks.splice(index, 2)\n\t}\n\tfunction redraw() {\n\t\tfor (var i = 1; i < callbacks.length; i += 2) {\n\t\t\tcallbacks[i]()\n\t\t}\n\t}\n\treturn {subscribe: subscribe, unsubscribe: unsubscribe, redraw: redraw, render: renderService.render}\n}\nvar redrawService = _11(window)\nrequestService.setCompletionCallback(redrawService.redraw)\nvar _16 = function(redrawService0) {\n\treturn function(root, component) {\n\t\tif (component === null) {\n\t\t\tredrawService0.render(root, [])\n\t\t\tredrawService0.unsubscribe(root)\n\t\t\treturn\n\t\t}\n\t\t\n\t\tif (component.view == null && typeof component !== \"function\") throw new Error(\"m.mount(element, component) expects a component, not a vnode\")\n\t\t\n\t\tvar run0 = function() {\n\t\t\tredrawService0.render(root, Vnode(component))\n\t\t}\n\t\tredrawService0.subscribe(root, run0)\n\t\tredrawService0.redraw()\n\t}\n}\nm.mount = _16(redrawService)\nvar Promise = PromisePolyfill\nvar parseQueryString = function(string) {\n\tif (string === \"\" || string == null) return {}\n\tif (string.charAt(0) === \"?\") string = string.slice(1)\n\tvar entries = string.split(\"&\"), data0 = {}, counters = {}\n\tfor (var i = 0; i < entries.length; i++) {\n\t\tvar entry = entries[i].split(\"=\")\n\t\tvar key5 = decodeURIComponent(entry[0])\n\t\tvar value = entry.length === 2 ? decodeURIComponent(entry[1]) : \"\"\n\t\tif (value === \"true\") value = true\n\t\telse if (value === \"false\") value = false\n\t\tvar levels = key5.split(/\\]\\[?|\\[/)\n\t\tvar cursor = data0\n\t\tif (key5.indexOf(\"[\") > -1) levels.pop()\n\t\tfor (var j = 0; j < levels.length; j++) {\n\t\t\tvar level = levels[j], nextLevel = levels[j + 1]\n\t\t\tvar isNumber = nextLevel == \"\" || !isNaN(parseInt(nextLevel, 10))\n\t\t\tvar isValue = j === levels.length - 1\n\t\t\tif (level === \"\") {\n\t\t\t\tvar key5 = levels.slice(0, j).join()\n\t\t\t\tif (counters[key5] == null) counters[key5] = 0\n\t\t\t\tlevel = counters[key5]++\n\t\t\t}\n\t\t\tif (cursor[level] == null) {\n\t\t\t\tcursor[level] = isValue ? value : isNumber ? [] : {}\n\t\t\t}\n\t\t\tcursor = cursor[level]\n\t\t}\n\t}\n\treturn data0\n}\nvar coreRouter = function($window) {\n\tvar supportsPushState = typeof $window.history.pushState === \"function\"\n\tvar callAsync0 = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction normalize1(fragment0) {\n\t\tvar data = $window.location[fragment0].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)\n\t\tif (fragment0 === \"pathname\" && data[0] !== \"/\") data = \"/\" + data\n\t\treturn data\n\t}\n\tvar asyncId\n\tfunction debounceAsync(callback0) {\n\t\treturn function() {\n\t\t\tif (asyncId != null) return\n\t\t\tasyncId = callAsync0(function() {\n\t\t\t\tasyncId = null\n\t\t\t\tcallback0()\n\t\t\t})\n\t\t}\n\t}\n\tfunction parsePath(path, queryData, hashData) {\n\t\tvar queryIndex = path.indexOf(\"?\")\n\t\tvar hashIndex = path.indexOf(\"#\")\n\t\tvar pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length\n\t\tif (queryIndex > -1) {\n\t\t\tvar queryEnd = hashIndex > -1 ? hashIndex : path.length\n\t\t\tvar queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd))\n\t\t\tfor (var key4 in queryParams) queryData[key4] = queryParams[key4]\n\t\t}\n\t\tif (hashIndex > -1) {\n\t\t\tvar hashParams = parseQueryString(path.slice(hashIndex + 1))\n\t\t\tfor (var key4 in hashParams) hashData[key4] = hashParams[key4]\n\t\t}\n\t\treturn path.slice(0, pathEnd)\n\t}\n\tvar router = {prefix: \"#!\"}\n\trouter.getPath = function() {\n\t\tvar type2 = router.prefix.charAt(0)\n\t\tswitch (type2) {\n\t\t\tcase \"#\": return normalize1(\"hash\").slice(router.prefix.length)\n\t\t\tcase \"?\": return normalize1(\"search\").slice(router.prefix.length) + normalize1(\"hash\")\n\t\t\tdefault: return normalize1(\"pathname\").slice(router.prefix.length) + normalize1(\"search\") + normalize1(\"hash\")\n\t\t}\n\t}\n\trouter.setPath = function(path, data, options) {\n\t\tvar queryData = {}, hashData = {}\n\t\tpath = parsePath(path, queryData, hashData)\n\t\tif (data != null) {\n\t\t\tfor (var key4 in data) queryData[key4] = data[key4]\n\t\t\tpath = path.replace(/:([^\\/]+)/g, function(match2, token) {\n\t\t\t\tdelete queryData[token]\n\t\t\t\treturn data[token]\n\t\t\t})\n\t\t}\n\t\tvar query = buildQueryString(queryData)\n\t\tif (query) path += \"?\" + query\n\t\tvar hash = buildQueryString(hashData)\n\t\tif (hash) path += \"#\" + hash\n\t\tif (supportsPushState) {\n\t\t\tvar state = options ? options.state : null\n\t\t\tvar title = options ? options.title : null\n\t\t\t$window.onpopstate()\n\t\t\tif (options && options.replace) $window.history.replaceState(state, title, router.prefix + path)\n\t\t\telse $window.history.pushState(state, title, router.prefix + path)\n\t\t}\n\t\telse $window.location.href = router.prefix + path\n\t}\n\trouter.defineRoutes = function(routes, resolve, reject) {\n\t\tfunction resolveRoute() {\n\t\t\tvar path = router.getPath()\n\t\t\tvar params = {}\n\t\t\tvar pathname = parsePath(path, params, params)\n\t\t\tvar state = $window.history.state\n\t\t\tif (state != null) {\n\t\t\t\tfor (var k in state) params[k] = state[k]\n\t\t\t}\n\t\t\tfor (var route0 in routes) {\n\t\t\t\tvar matcher = new RegExp(\"^\" + route0.replace(/:[^\\/]+?\\.{3}/g, \"(.*?)\").replace(/:[^\\/]+/g, \"([^\\\\/]+)\") + \"\\/?$\")\n\t\t\t\tif (matcher.test(pathname)) {\n\t\t\t\t\tpathname.replace(matcher, function() {\n\t\t\t\t\t\tvar keys = route0.match(/:[^\\/]+/g) || []\n\t\t\t\t\t\tvar values = [].slice.call(arguments, 1, -2)\n\t\t\t\t\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\t\t\t\t\tparams[keys[i].replace(/:|\\./g, \"\")] = decodeURIComponent(values[i])\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresolve(routes[route0], params, path, route0)\n\t\t\t\t\t})\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\treject(path, params)\n\t\t}\n\t\tif (supportsPushState) $window.onpopstate = debounceAsync(resolveRoute)\n\t\telse if (router.prefix.charAt(0) === \"#\") $window.onhashchange = resolveRoute\n\t\tresolveRoute()\n\t}\n\treturn router\n}\nvar _20 = function($window, redrawService0) {\n\tvar routeService = coreRouter($window)\n\tvar identity = function(v) {return v}\n\tvar render1, component, attrs3, currentPath, lastUpdate\n\tvar route = function(root, defaultRoute, routes) {\n\t\tif (root == null) throw new Error(\"Ensure the DOM element that was passed to `m.route` is not undefined\")\n\t\tvar run1 = function() {\n\t\t\tif (render1 != null) redrawService0.render(root, render1(Vnode(component, attrs3.key, attrs3)))\n\t\t}\n\t\tvar bail = function(path) {\n\t\t\tif (path !== defaultRoute) routeService.setPath(defaultRoute, null, {replace: true})\n\t\t\telse throw new Error(\"Could not resolve default route \" + defaultRoute)\n\t\t}\n\t\trouteService.defineRoutes(routes, function(payload, params, path) {\n\t\t\tvar update = lastUpdate = function(routeResolver, comp) {\n\t\t\t\tif (update !== lastUpdate) return\n\t\t\t\tcomponent = comp != null && (typeof comp.view === \"function\" || typeof comp === \"function\")? comp : \"div\"\n\t\t\t\tattrs3 = params, currentPath = path, lastUpdate = null\n\t\t\t\trender1 = (routeResolver.render || identity).bind(routeResolver)\n\t\t\t\trun1()\n\t\t\t}\n\t\t\tif (payload.view || typeof payload === \"function\") update({}, payload)\n\t\t\telse {\n\t\t\t\tif (payload.onmatch) {\n\t\t\t\t\tPromise.resolve(payload.onmatch(params, path)).then(function(resolved) {\n\t\t\t\t\t\tupdate(payload, resolved)\n\t\t\t\t\t}, bail)\n\t\t\t\t}\n\t\t\t\telse update(payload, \"div\")\n\t\t\t}\n\t\t}, bail)\n\t\tredrawService0.subscribe(root, run1)\n\t}\n\troute.set = function(path, data, options) {\n\t\tif (lastUpdate != null) {\n\t\t\toptions = options || {}\n\t\t\toptions.replace = true\n\t\t}\n\t\tlastUpdate = null\n\t\trouteService.setPath(path, data, options)\n\t}\n\troute.get = function() {return currentPath}\n\troute.prefix = function(prefix0) {routeService.prefix = prefix0}\n\troute.link = function(vnode1) {\n\t\tvnode1.dom.setAttribute(\"href\", routeService.prefix + vnode1.attrs.href)\n\t\tvnode1.dom.onclick = function(e) {\n\t\t\tif (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return\n\t\t\te.preventDefault()\n\t\t\te.redraw = false\n\t\t\tvar href = this.getAttribute(\"href\")\n\t\t\tif (href.indexOf(routeService.prefix) === 0) href = href.slice(routeService.prefix.length)\n\t\t\troute.set(href, undefined, undefined)\n\t\t}\n\t}\n\troute.param = function(key3) {\n\t\tif(typeof attrs3 !== \"undefined\" && typeof key3 !== \"undefined\") return attrs3[key3]\n\t\treturn attrs3\n\t}\n\treturn route\n}\nm.route = _20(window, redrawService)\nm.withAttr = function(attrName, callback1, context) {\n\treturn function(e) {\n\t\tcallback1.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName))\n\t}\n}\nvar _28 = coreRenderer(window)\nm.render = _28.render\nm.redraw = redrawService.redraw\nm.request = requestService.request\nm.jsonp = requestService.jsonp\nm.parseQueryString = parseQueryString\nm.buildQueryString = buildQueryString\nm.version = \"1.1.6\"\nm.vnode = Vnode\nif (typeof module !== \"undefined\") module[\"exports\"] = m\nelse window.m = m\n}());\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {},require(\"timers\").setImmediate)\n},{\"timers\":10}],9:[function(require,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],10:[function(require,module,exports){\n(function (setImmediate,clearImmediate){\nvar nextTick = require('process/browser.js').nextTick;\nvar apply = Function.prototype.apply;\nvar slice = Array.prototype.slice;\nvar immediateIds = {};\nvar nextImmediateId = 0;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) { timeout.close(); };\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(window, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// That's not how node.js implements it but the exposed api is the same.\nexports.setImmediate = typeof setImmediate === \"function\" ? setImmediate : function(fn) {\n var id = nextImmediateId++;\n var args = arguments.length < 2 ? false : slice.call(arguments, 1);\n\n immediateIds[id] = true;\n\n nextTick(function onNextTick() {\n if (immediateIds[id]) {\n // fn.call() is faster so we optimize for the common use-case\n // @see http://jsperf.com/call-apply-segu\n if (args) {\n fn.apply(null, args);\n } else {\n fn.call(null);\n }\n // Prevent ids from leaking\n exports.clearImmediate(id);\n }\n });\n\n return id;\n};\n\nexports.clearImmediate = typeof clearImmediate === \"function\" ? clearImmediate : function(id) {\n delete immediateIds[id];\n};\n}).call(this,require(\"timers\").setImmediate,require(\"timers\").clearImmediate)\n},{\"process/browser.js\":9,\"timers\":10}],11:[function(require,module,exports){\nfunction tlite(getTooltipOpts) {\n document.addEventListener('mouseover', function (e) {\n var el = e.target;\n var opts = getTooltipOpts(el);\n\n if (!opts) {\n el = el.parentElement;\n opts = el && getTooltipOpts(el);\n }\n\n opts && tlite.show(el, opts, true);\n });\n}\n\ntlite.show = function (el, opts, isAuto) {\n var fallbackAttrib = 'data-tlite';\n opts = opts || {};\n\n (el.tooltip || Tooltip(el, opts)).show();\n\n function Tooltip(el, opts) {\n var tooltipEl;\n var showTimer;\n var text;\n\n el.addEventListener('mousedown', autoHide);\n el.addEventListener('mouseleave', autoHide);\n\n function show() {\n text = el.title || el.getAttribute(fallbackAttrib) || text;\n el.title = '';\n el.setAttribute(fallbackAttrib, '');\n text && !showTimer && (showTimer = setTimeout(fadeIn, isAuto ? 150 : 1))\n }\n\n function autoHide() {\n tlite.hide(el, true);\n }\n\n function hide(isAutoHiding) {\n if (isAuto === isAutoHiding) {\n showTimer = clearTimeout(showTimer);\n var parent = tooltipEl && tooltipEl.parentNode;\n parent && parent.removeChild(tooltipEl);\n tooltipEl = undefined;\n }\n }\n\n function fadeIn() {\n if (!tooltipEl) {\n tooltipEl = createTooltip(el, text, opts);\n }\n }\n\n return el.tooltip = {\n show: show,\n hide: hide\n };\n }\n\n function createTooltip(el, text, opts) {\n var tooltipEl = document.createElement('span');\n var grav = opts.grav || el.getAttribute('data-tlite') || 'n';\n\n tooltipEl.innerHTML = text;\n\n el.appendChild(tooltipEl);\n\n var vertGrav = grav[0] || '';\n var horzGrav = grav[1] || '';\n\n function positionTooltip() {\n tooltipEl.className = 'tlite ' + 'tlite-' + vertGrav + horzGrav;\n\n var arrowSize = 10;\n var top = el.offsetTop;\n var left = el.offsetLeft;\n\n if (tooltipEl.offsetParent === el) {\n top = left = 0;\n }\n\n var width = el.offsetWidth;\n var height = el.offsetHeight;\n var tooltipHeight = tooltipEl.offsetHeight;\n var tooltipWidth = tooltipEl.offsetWidth;\n var centerEl = left + (width / 2);\n\n tooltipEl.style.top = (\n vertGrav === 's' ? (top - tooltipHeight - arrowSize) :\n vertGrav === 'n' ? (top + height + arrowSize) :\n (top + (height / 2) - (tooltipHeight / 2))\n ) + 'px';\n\n tooltipEl.style.left = (\n horzGrav === 'w' ? left :\n horzGrav === 'e' ? left + width - tooltipWidth :\n vertGrav === 'w' ? (left + width + arrowSize) :\n vertGrav === 'e' ? (left - tooltipWidth - arrowSize) :\n (centerEl - tooltipWidth / 2)\n ) + 'px';\n }\n\n positionTooltip();\n\n var rect = tooltipEl.getBoundingClientRect();\n\n if (vertGrav === 's' && rect.top < 0) {\n vertGrav = 'n';\n positionTooltip();\n } else if (vertGrav === 'n' && rect.bottom > window.innerHeight) {\n vertGrav = 's';\n positionTooltip();\n } else if (vertGrav === 'e' && rect.left < 0) {\n vertGrav = 'w';\n positionTooltip();\n } else if (vertGrav === 'w' && rect.right > window.innerWidth) {\n vertGrav = 'e';\n positionTooltip();\n }\n\n tooltipEl.className += ' tlite-visible';\n\n return tooltipEl;\n }\n};\n\ntlite.hide = function (el, isAuto) {\n el.tooltip && el.tooltip.hide(isAuto);\n};\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = tlite;\n}\n\n},{}],12:[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.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","obj","_tlite","__esModule","default","tabs","settings","m","window","EventEmitter","Tabs","Settings","helpers","context","document","getElementById","events","el","className","indexOf","ListFetcher","mount","mc4wp","deps","mithril","./admin/fields/mailchimp-api-key.js","./admin/helpers.js","./admin/list-fetcher.js","./admin/settings.js","./admin/tabs.js","tlite","wolfy87-eventemitter","2","field","validate","evt","node","createElement","innerText","mc4wp_vars","i18n","invalid_api_key","nextElementSibling","parentElement","removeChild","value","match","insertBefore","addEventListener","3","showIfElements","toggleElement","selector","elements","querySelectorAll","show","clientHeight","style","display","bindEventToElement","element","event","handler","attachEvent","bindEventToElements","Array","prototype","forEach","debounce","func","wait","immediate","timeout","this","args","arguments","callNow","clearTimeout","setTimeout","apply","config","JSON","parse","getAttribute","parentElements","inputs","hide","checked","conditionMet","visibility","opacity","inputElement","removeAttribute","setAttribute","4","$","jQuery","working","done","mailchimp","api_connected","lists","fetch","preventDefault","post","ajaxurl","action","data","success","location","reload","bind","fail","always","redraw","view","method","onsubmit","type","fetching_mailchimp_lists","renew_mailchimp_lists","disabled","trust","fetching_mailchimp_lists_can_take_a_while","fetching_mailchimp_lists_done","fetching_mailchimp_lists_error","5","_typeof","Symbol","iterator","constructor","querySelector","listInputs","selectedLists","updateSelectedLists","input","push","trigger","on","rows","searchKey","searchValue","listId","filter","replace","getSelectedLists","6","URL","$context","$tabs","find","$tabNavs","refererField","each","id","substring","title","first","text","nav","open","_open","click","switchTab","body","history","pushState","activeTab","get","tab","replaceState","state","init","updateState","removeClass","css","blur","url","setParameter","href","tb_remove","forms","editor","refresh","split","tabId","urlParams","returnValue","./url.js","7","query","hasOwnProperty","b","decodeURIComponent","build","ret","d","encodeURIComponent","join","key","8","global","setImmediate","Vnode","tag","attrs0","children","dom","attrs","domSize","_state","instance","skip","normalize","isArray","normalizeChildren","selectorParser","selectorCache","hasOwn","isEmpty","object","hyperscript","start","cached","classes","exec","attrValue","compileSelector","normalized","childList","hasAttrs","class","newAttrs","execSelector","html","fragment","attrs1","PromisePolyfill","executor","TypeError","self","resolvers","rejectors","resolveCurrent","rejectCurrent","_instance","callAsync","list","shouldAbsorb","execute","then","console","error","retry","executeOnce","runs","run","fn","onerror","onFulfilled","onRejection","resolveNext","rejectNext","handle","callback","next","promise","resolve","reject","catch","all","total","count","values","consume","race","Promise","buildQueryString","Object","toString","key0","destructure","FILE_PROTOCOL_REGEX","RegExp","requestService","$window","oncompletion","callbackCount","finalizer","complete","finalize","promise0","then0","extra","interpolate","tokens","slice","assemble","querystring","prefix","deserialize","extract","xhr","responseText","cast","type0","request","toUpperCase","useBody","serialize","FormData","stringify","XMLHttpRequest","aborted","_abort","abort","async","user","password","headers","setRequestHeader","withCredentials","onreadystatechange","readyState","response","status","test","send","background","jsonp","callbackName","Math","round","random","script","parentNode","callbackKey","src","documentElement","appendChild","setCompletionCallback","_8","coreRenderer","onevent","$doc","$emptyFragment","createDocumentFragment","nameSpace","svg","math","getNameSpace","vnode","xmlns","createNodes","parent","vnodes","end","hooks","nextSibling","ns","createNode","initComponent","insertNode","createComponent","initLifecycle","createTextNode","createHTML","firstChild","childNodes","createFragment","attrs2","is","createElementNS","key2","setAttr","setAttrs","contenteditable","setContentEditable","textContent","selectedIndex","parent1","caption","thead","tbody","tfoot","tr","th","td","colgroup","col","temp","innerHTML","child","sentinel","create","$$reentrantLock$$","updateNodes","old","recycling","removeNodes","isUnkeyed","getNextSibling","updateNode","pool","abs","oldChildrenLength","poolChildrenLength","vnodesChildrenLength","isRecyclable","concat","map","oldStart","oldEnd","v","shouldRecycle","toFragment","getKeyMap","oldIndex","movable","oldTag","forceVnodeUpdate","forceComponentUpdate","onbeforeupdate","shouldNotUpdate","updateLifecycle","nodeValue","updateText","updateFragment","isLifecycleMethod","updateEvent","updateAttrs","updateElement","removeNode","updateComponent","count0","content","result","expected","called","onbeforeremove","continuation","onremove","removeNodeFromDOM","source","oncreate","onupdate","attr","activeElement","nsLastIndex","substr","setAttributeNS","cssText","updateStyle","normalized0","eventName","removeEventListener","oninit","render","active","namespace","namespaceURI","focus","setEventCallback","redrawService","renderService","callbacks","unsubscribe","key1","index","splice","subscribe","last","pending","requestAnimationFrame","now","Date","_11","redrawService0","root","component","render1","attrs3","currentPath","lastUpdate","routeService","route","parseQueryString","string","charAt","entries","data0","counters","entry","key5","levels","cursor","pop","j","level","nextLevel","isNumber","isNaN","parseInt","isValue","coreRouter","asyncId","supportsPushState","callAsync0","normalize1","fragment0","parsePath","path","queryData","hashData","queryIndex","hashIndex","pathEnd","queryEnd","queryParams","key4","hashParams","router","getPath","setPath","options","match2","token","hash","onpopstate","defineRoutes","routes","resolveRoute","params","pathname","k","route0","matcher","keys","callback0","onhashchange","defaultRoute","run1","bail","payload","update","routeResolver","comp","onmatch","resolved","set","prefix0","link","vnode1","onclick","ctrlKey","metaKey","shiftKey","which","param","key3","withAttr","attrName","callback1","currentTarget","_28","version","timers","9","cachedSetTimeout","cachedClearTimeout","process","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","len","marker","runClearTimeout","Item","array","noop","nextTick","browser","env","argv","versions","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","name","binding","cwd","chdir","dir","umask","10","clearImmediate","Function","immediateIds","nextImmediateId","Timeout","clearFn","_id","_clearFn","setInterval","clearInterval","close","unref","ref","enroll","item","msecs","_idleTimeoutId","_idleTimeout","unenroll","_unrefActive","_onTimeout","process/browser.js","11","getTooltipOpts","target","opts","isAuto","fallbackAttrib","tooltip","tooltipEl","showTimer","autoHide","fadeIn","grav","vertGrav","horzGrav","positionTooltip","top","offsetTop","left","offsetLeft","offsetParent","width","offsetWidth","height","offsetHeight","tooltipHeight","tooltipWidth","centerEl","rect","getBoundingClientRect","bottom","innerHeight","right","innerWidth","createTooltip","isAutoHiding","Tooltip","12","proto","originalGlobalValue","indexOfListener","listener","alias","getListeners","_getEvents","flattenListeners","flatListeners","getListenersAsObject","isValidListener","listenerIsWrapped","addOnceListener","defineEvent","defineEvents","evts","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","_events","emitEvent","listenersMap","_getOnceReturnValue","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA6BA,OAASC,GA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5S,KAAK+E,UAAW,GACjD,OAAOF,KAAK0mB,UAAUhpB,EAAKuC,IAW/BilB,EAAM2B,mBAAqB,SAA4BzoB,GAEnD,OADA4B,KAAK8mB,iBAAmB1oB,EACjB4B,MAWXklB,EAAM0B,oBAAsB,WACxB,OAAI5mB,KAAKsH,eAAe,qBACbtH,KAAK8mB,kBAapB5B,EAAMM,WAAa,WACf,OAAOxlB,KAAKymB,UAAYzmB,KAAKymB,QAAU,KAQ3CzqB,EAAa+qB,WAAa,WAEtB,OADA7rB,EAAQc,aAAempB,EAChBnpB,GAIW,mBAAX7B,GAAyBA,EAAO6sB,IACvC7sB,EAAO,WACH,OAAO6B,IAGY,iBAAXT,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAUc,EAGjBd,EAAQc,aAAeA,EA5d9B,CA8dmB,oBAAXD,OAAyBA,OAASiE,MAAQ,KAEjD,KAAK,GAAG,CAAC,IA3lFX","file":"admin.min.js","sourcesContent":["(function () { var require = 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'; // dependencies\n\nvar _tlite = _interopRequireDefault(require(\"tlite\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar m = window.m = require('mithril');\n\nvar EventEmitter = require('wolfy87-eventemitter');\n\nvar Tabs = require('./admin/tabs.js');\n\nvar Settings = require('./admin/settings.js');\n\nvar helpers = require('./admin/helpers.js'); // vars\n\n\nvar context = document.getElementById('mc4wp-admin');\nvar tabs, settings;\nvar events = new EventEmitter();\n\nif (context !== null) {\n tabs = Tabs(context);\n settings = Settings(context, helpers, events);\n}\n\n(0, _tlite.default)(function (el) {\n return el.className.indexOf('mc4wp-tooltip') > -1;\n}); // list fetcher\n\nvar ListFetcher = require('./admin/list-fetcher.js');\n\nvar mount = document.getElementById('mc4wp-list-fetcher');\n\nif (mount) {\n m.mount(mount, new ListFetcher());\n}\n\nrequire('./admin/fields/mailchimp-api-key.js'); // expose some things\n\n\nwindow.mc4wp = window.mc4wp || {};\nwindow.mc4wp.deps = window.mc4wp.deps || {};\nwindow.mc4wp.deps.mithril = m;\nwindow.mc4wp.helpers = helpers;\nwindow.mc4wp.events = events;\nwindow.mc4wp.settings = settings;\nwindow.mc4wp.tabs = tabs;\n\n},{\"./admin/fields/mailchimp-api-key.js\":2,\"./admin/helpers.js\":3,\"./admin/list-fetcher.js\":4,\"./admin/settings.js\":5,\"./admin/tabs.js\":6,\"mithril\":8,\"tlite\":11,\"wolfy87-eventemitter\":12}],2:[function(require,module,exports){\n'use strict';\n\nvar field;\n\nfunction validate(evt) {\n var node = document.createElement('p');\n node.className = 'help red';\n node.innerText = window.mc4wp_vars.i18n.invalid_api_key;\n\n if (field.nextElementSibling.innerText === node.innerText) {\n field.nextElementSibling.parentElement.removeChild(field.nextElementSibling);\n }\n\n if (!field.value.match(/^[0-9a-zA-Z*]{32}-[a-z]{2}[0-9]{1,2}$/)) {\n field.parentElement.insertBefore(node, field.nextElementSibling);\n }\n}\n\n(function () {\n field = document.getElementById('mailchimp_api_key');\n\n if (!field) {\n return;\n }\n\n field.addEventListener('change', validate);\n})();\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar helpers = {};\n\nhelpers.toggleElement = function (selector) {\n var elements = document.querySelectorAll(selector);\n\n for (var i = 0; i < elements.length; i++) {\n var show = elements[i].clientHeight <= 0;\n elements[i].style.display = show ? '' : 'none';\n }\n};\n\nhelpers.bindEventToElement = function (element, event, handler) {\n if (element.addEventListener) {\n element.addEventListener(event, handler);\n } else if (element.attachEvent) {\n element.attachEvent('on' + event, handler);\n }\n};\n\nhelpers.bindEventToElements = function (elements, event, handler) {\n Array.prototype.forEach.call(elements, function (element) {\n helpers.bindEventToElement(element, event, handler);\n });\n}; // polling\n\n\nhelpers.debounce = function (func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n};\n/**\n * Showif.js\n */\n\n\n(function () {\n var showIfElements = document.querySelectorAll('[data-showif]'); // dependent elements\n\n Array.prototype.forEach.call(showIfElements, function (element) {\n var config = JSON.parse(element.getAttribute('data-showif'));\n var parentElements = document.querySelectorAll('[name=\"' + config.element + '\"]');\n var inputs = element.querySelectorAll('input,select,textarea:not([readonly])');\n var hide = config.hide === undefined || config.hide;\n\n function toggleElement() {\n // do nothing with unchecked radio inputs\n if (this.getAttribute('type') === \"radio\" && !this.checked) {\n return;\n }\n\n var value = this.getAttribute(\"type\") === \"checkbox\" ? this.checked : this.value;\n var conditionMet = value == config.value;\n\n if (hide) {\n element.style.display = conditionMet ? '' : 'none';\n element.style.visibility = conditionMet ? '' : 'hidden';\n } else {\n element.style.opacity = conditionMet ? '' : '0.4';\n } // disable input fields to stop sending their values to server\n\n\n Array.prototype.forEach.call(inputs, function (inputElement) {\n conditionMet ? inputElement.removeAttribute('readonly') : inputElement.setAttribute('readonly', 'readonly');\n });\n } // find checked element and call toggleElement function\n\n\n Array.prototype.forEach.call(parentElements, function (parentElement) {\n toggleElement.call(parentElement);\n }); // bind on all changes\n\n helpers.bindEventToElements(parentElements, 'change', toggleElement);\n });\n})();\n\nmodule.exports = helpers;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\nvar config = mc4wp_vars;\nvar i18n = config.i18n;\n\nfunction ListFetcher() {\n this.working = false;\n this.done = false; // start fetching right away when no lists but api key given\n\n if (config.mailchimp.api_connected && config.mailchimp.lists.length === 0) {\n this.fetch();\n }\n}\n\nListFetcher.prototype.fetch = function (e) {\n e && e.preventDefault();\n this.working = true;\n this.done = false;\n $.post(ajaxurl, {\n action: \"mc4wp_renew_mailchimp_lists\",\n timeout: 600000 // 10 minutes, matching max_execution_time\n\n }).done(function (data) {\n this.success = true;\n\n if (data) {\n window.setTimeout(function () {\n window.location.reload();\n }, 3000);\n }\n }.bind(this)).fail(function (data) {\n this.success = false;\n }.bind(this)).always(function (data) {\n this.working = false;\n this.done = true;\n m.redraw();\n }.bind(this));\n};\n\nListFetcher.prototype.view = function () {\n return m('form', {\n method: \"POST\",\n onsubmit: this.fetch.bind(this)\n }, [m('p', [m('input', {\n type: \"submit\",\n value: this.working ? i18n.fetching_mailchimp_lists : i18n.renew_mailchimp_lists,\n className: \"button\",\n disabled: !!this.working\n }), m.trust(' &nbsp; '), this.working ? [m('span.mc4wp-loader', \"Loading...\"), m.trust(' &nbsp; '), m('em.help', i18n.fetching_mailchimp_lists_can_take_a_while)] : '', this.done ? [this.success ? m('em.help.green', i18n.fetching_mailchimp_lists_done) : m('em.help.red', i18n.fetching_mailchimp_lists_error)] : ''])]);\n};\n\nmodule.exports = ListFetcher;\n\n},{}],5:[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 Settings = function Settings(context, helpers, events) {\n 'use strict'; // vars\n\n var form = context.querySelector('form');\n var listInputs = context.querySelectorAll('.mc4wp-list-input');\n var lists = mc4wp_vars.mailchimp.lists;\n var selectedLists = []; // functions\n\n function getSelectedListsWhere(searchKey, searchValue) {\n return selectedLists.filter(function (el) {\n return el[searchKey] === searchValue;\n });\n }\n\n function getSelectedLists() {\n return selectedLists;\n }\n\n function updateSelectedLists() {\n selectedLists = [];\n Array.prototype.forEach.call(listInputs, function (input) {\n // skip unchecked checkboxes\n if (typeof input.checked === \"boolean\" && !input.checked) {\n return;\n }\n\n if (_typeof(lists[input.value]) === \"object\") {\n selectedLists.push(lists[input.value]);\n }\n });\n events.trigger('selectedLists.change', [selectedLists]);\n return selectedLists;\n }\n\n function toggleVisibleLists() {\n var rows = document.querySelectorAll('.lists--only-selected > *');\n Array.prototype.forEach.call(rows, function (el) {\n var listId = el.getAttribute('data-list-id');\n var isSelected = getSelectedListsWhere('id', listId).length > 0;\n\n if (isSelected) {\n el.setAttribute('class', el.getAttribute('class').replace('hidden', ''));\n } else {\n el.setAttribute('class', el.getAttribute('class') + \" hidden\");\n }\n });\n }\n\n events.on('selectedLists.change', toggleVisibleLists);\n helpers.bindEventToElements(listInputs, 'change', updateSelectedLists);\n updateSelectedLists();\n return {\n getSelectedLists: getSelectedLists\n };\n};\n\nmodule.exports = Settings;\n\n},{}],6:[function(require,module,exports){\n'use strict';\n\nvar URL = require('./url.js'); // Tabs\n\n\nvar Tabs = function Tabs(context) {\n if (context === null) {\n return;\n } // TODO: last piece of jQuery... can we get rid of it?\n\n\n var $ = window.jQuery;\n var $context = $(context);\n var $tabs = $context.find('.tab');\n var $tabNavs = $context.find('.nav-tab');\n var refererField = context.querySelector('input[name=\"_wp_http_referer\"]');\n var tabs = [];\n $.each($tabs, function (i, t) {\n var id = t.id.substring(4);\n var title = $(t).find('h2').first().text();\n tabs.push({\n id: id,\n title: title,\n element: t,\n nav: context.querySelectorAll('.nav-tab-' + id),\n open: function open() {\n return _open(id);\n }\n });\n });\n\n function get(id) {\n for (var i = 0; i < tabs.length; i++) {\n if (tabs[i].id === id) {\n return tabs[i];\n }\n }\n\n return undefined;\n }\n\n function _open(tab, updateState) {\n // make sure we have a tab object\n if (typeof tab === \"string\") {\n tab = get(tab);\n }\n\n if (!tab) {\n return false;\n } // should we update state?\n\n\n if (updateState == undefined) {\n updateState = true;\n } // hide all tabs & remove active class\n\n\n $tabs.removeClass('tab-active').css('display', 'none');\n $tabNavs.removeClass('nav-tab-active'); // add `nav-tab-active` to this tab\n\n Array.prototype.forEach.call(tab.nav, function (nav) {\n nav.className += \" nav-tab-active\";\n nav.blur();\n }); // show target tab\n\n tab.element.style.display = 'block';\n tab.element.className += \" tab-active\"; // create new URL\n\n var url = URL.setParameter(window.location.href, \"tab\", tab.id); // update hash\n\n if (history.pushState && updateState) {\n history.pushState(tab.id, '', url);\n } // update document title\n\n\n title(tab); // update referer field\n\n refererField.value = url; // if thickbox is open, close it.\n\n if (typeof tb_remove === \"function\") {\n tb_remove();\n } // refresh editor after switching tabs\n // TODO: decouple this! law of demeter etc.\n\n\n if (tab.id === 'fields' && window.mc4wp && window.mc4wp.forms && window.mc4wp.forms.editor) {\n mc4wp.forms.editor.refresh();\n }\n\n return true;\n }\n\n function title(tab) {\n var title = document.title.split('-');\n document.title = document.title.replace(title[0], tab.title + \" \");\n }\n\n function switchTab(e) {\n e = e || window.event; // get from data attribute\n\n var tabId = this.getAttribute('data-tab'); // get from classname\n\n if (!tabId) {\n var match = this.className.match(/nav-tab-(\\w+)?/);\n\n if (match) {\n tabId = match[1];\n }\n } // get from href\n\n\n if (!tabId) {\n var urlParams = URL.parse(this.href);\n\n if (!urlParams.tab) {\n return;\n }\n\n tabId = urlParams.tab;\n }\n\n var opened = _open(tabId);\n\n if (opened) {\n e.preventDefault();\n e.returnValue = false;\n return false;\n }\n\n return true;\n }\n\n function init() {\n // check for current tab\n if (!history.pushState) {\n return;\n }\n\n var activeTab = $tabs.filter(':visible').get(0);\n\n if (!activeTab) {\n return;\n }\n\n var tab = get(activeTab.id.substring(4));\n if (!tab) return; // check if tab is in html5 history\n\n if (history.replaceState && history.state === null) {\n history.replaceState(tab.id, '');\n } // update document title\n\n\n title(tab);\n }\n\n $tabNavs.click(switchTab);\n $(document.body).on('click', '.tab-link', switchTab);\n init();\n\n if (window.addEventListener && history.pushState) {\n window.addEventListener('popstate', function (e) {\n if (!e.state) return true;\n var tabId = e.state;\n return _open(tabId, false);\n });\n }\n\n return {\n open: _open,\n get: get\n };\n};\n\nmodule.exports = Tabs;\n\n},{\"./url.js\":7}],7:[function(require,module,exports){\n'use strict';\n\nvar URL = {\n parse: function parse(url) {\n var query = {};\n var a = url.split('&');\n\n for (var i in a) {\n if (!a.hasOwnProperty(i)) {\n continue;\n }\n\n var b = a[i].split('=');\n query[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);\n }\n\n return query;\n },\n build: function build(data) {\n var ret = [];\n\n for (var d in data) {\n ret.push(d + \"=\" + encodeURIComponent(data[d]));\n }\n\n return ret.join(\"&\");\n },\n setParameter: function setParameter(url, key, value) {\n var data = URL.parse(url);\n data[key] = value;\n return URL.build(data);\n }\n};\nmodule.exports = URL;\n\n},{}],8:[function(require,module,exports){\n(function (global,setImmediate){\n;(function() {\n\"use strict\"\nfunction Vnode(tag, key, attrs0, children, text, dom) {\n\treturn {tag: tag, key: key, attrs: attrs0, children: children, text: text, dom: dom, domSize: undefined, state: undefined, _state: undefined, events: undefined, instance: undefined, skip: false}\n}\nVnode.normalize = function(node) {\n\tif (Array.isArray(node)) return Vnode(\"[\", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)\n\tif (node != null && typeof node !== \"object\") return Vnode(\"#\", undefined, undefined, node === false ? \"\" : node, undefined, undefined)\n\treturn node\n}\nVnode.normalizeChildren = function normalizeChildren(children) {\n\tfor (var i = 0; i < children.length; i++) {\n\t\tchildren[i] = Vnode.normalize(children[i])\n\t}\n\treturn children\n}\nvar selectorParser = /(?:(^|#|\\.)([^#\\.\\[\\]]+))|(\\[(.+?)(?:\\s*=\\s*(\"|'|)((?:\\\\[\"'\\]]|.)*?)\\5)?\\])/g\nvar selectorCache = {}\nvar hasOwn = {}.hasOwnProperty\nfunction isEmpty(object) {\n\tfor (var key in object) if (hasOwn.call(object, key)) return false\n\treturn true\n}\nfunction compileSelector(selector) {\n\tvar match, tag = \"div\", classes = [], attrs = {}\n\twhile (match = selectorParser.exec(selector)) {\n\t\tvar type = match[1], value = match[2]\n\t\tif (type === \"\" && value !== \"\") tag = value\n\t\telse if (type === \"#\") attrs.id = value\n\t\telse if (type === \".\") classes.push(value)\n\t\telse if (match[3][0] === \"[\") {\n\t\t\tvar attrValue = match[6]\n\t\t\tif (attrValue) attrValue = attrValue.replace(/\\\\([\"'])/g, \"$1\").replace(/\\\\\\\\/g, \"\\\\\")\n\t\t\tif (match[4] === \"class\") classes.push(attrValue)\n\t\t\telse attrs[match[4]] = attrValue === \"\" ? attrValue : attrValue || true\n\t\t}\n\t}\n\tif (classes.length > 0) attrs.className = classes.join(\" \")\n\treturn selectorCache[selector] = {tag: tag, attrs: attrs}\n}\nfunction execSelector(state, attrs, children) {\n\tvar hasAttrs = false, childList, text\n\tvar className = attrs.className || attrs.class\n\tif (!isEmpty(state.attrs) && !isEmpty(attrs)) {\n\t\tvar newAttrs = {}\n\t\tfor(var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key)) {\n\t\t\t\tnewAttrs[key] = attrs[key]\n\t\t\t}\n\t\t}\n\t\tattrs = newAttrs\n\t}\n\tfor (var key in state.attrs) {\n\t\tif (hasOwn.call(state.attrs, key)) {\n\t\t\tattrs[key] = state.attrs[key]\n\t\t}\n\t}\n\tif (className !== undefined) {\n\t\tif (attrs.class !== undefined) {\n\t\t\tattrs.class = undefined\n\t\t\tattrs.className = className\n\t\t}\n\t\tif (state.attrs.className != null) {\n\t\t\tattrs.className = state.attrs.className + \" \" + className\n\t\t}\n\t}\n\tfor (var key in attrs) {\n\t\tif (hasOwn.call(attrs, key) && key !== \"key\") {\n\t\t\thasAttrs = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === \"#\") {\n\t\ttext = children[0].children\n\t} else {\n\t\tchildList = children\n\t}\n\treturn Vnode(state.tag, attrs.key, hasAttrs ? attrs : undefined, childList, text)\n}\nfunction hyperscript(selector) {\n\t// Because sloppy mode sucks\n\tvar attrs = arguments[1], start = 2, children\n\tif (selector == null || typeof selector !== \"string\" && typeof selector !== \"function\" && typeof selector.view !== \"function\") {\n\t\tthrow Error(\"The selector must be either a string or a component.\");\n\t}\n\tif (typeof selector === \"string\") {\n\t\tvar cached = selectorCache[selector] || compileSelector(selector)\n\t}\n\tif (attrs == null) {\n\t\tattrs = {}\n\t} else if (typeof attrs !== \"object\" || attrs.tag != null || Array.isArray(attrs)) {\n\t\tattrs = {}\n\t\tstart = 1\n\t}\n\tif (arguments.length === start + 1) {\n\t\tchildren = arguments[start]\n\t\tif (!Array.isArray(children)) children = [children]\n\t} else {\n\t\tchildren = []\n\t\twhile (start < arguments.length) children.push(arguments[start++])\n\t}\n\tvar normalized = Vnode.normalizeChildren(children)\n\tif (typeof selector === \"string\") {\n\t\treturn execSelector(cached, attrs, normalized)\n\t} else {\n\t\treturn Vnode(selector, attrs.key, attrs, normalized)\n\t}\n}\nhyperscript.trust = function(html) {\n\tif (html == null) html = \"\"\n\treturn Vnode(\"<\", undefined, undefined, html, undefined, undefined)\n}\nhyperscript.fragment = function(attrs1, children) {\n\treturn Vnode(\"[\", attrs1.key, attrs1, Vnode.normalizeChildren(children), undefined, undefined)\n}\nvar m = hyperscript\n/** @constructor */\nvar PromisePolyfill = function(executor) {\n\tif (!(this instanceof PromisePolyfill)) throw new Error(\"Promise must be called with `new`\")\n\tif (typeof executor !== \"function\") throw new TypeError(\"executor must be a function\")\n\tvar self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false)\n\tvar instance = self._instance = {resolvers: resolvers, rejectors: rejectors}\n\tvar callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction handler(list, shouldAbsorb) {\n\t\treturn function execute(value) {\n\t\t\tvar then\n\t\t\ttry {\n\t\t\t\tif (shouldAbsorb && value != null && (typeof value === \"object\" || typeof value === \"function\") && typeof (then = value.then) === \"function\") {\n\t\t\t\t\tif (value === self) throw new TypeError(\"Promise can't be resolved w/ itself\")\n\t\t\t\t\texecuteOnce(then.bind(value))\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcallAsync(function() {\n\t\t\t\t\t\tif (!shouldAbsorb && list.length === 0) console.error(\"Possible unhandled promise rejection:\", value)\n\t\t\t\t\t\tfor (var i = 0; i < list.length; i++) list[i](value)\n\t\t\t\t\t\tresolvers.length = 0, rejectors.length = 0\n\t\t\t\t\t\tinstance.state = shouldAbsorb\n\t\t\t\t\t\tinstance.retry = function() {execute(value)}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\trejectCurrent(e)\n\t\t\t}\n\t\t}\n\t}\n\tfunction executeOnce(then) {\n\t\tvar runs = 0\n\t\tfunction run(fn) {\n\t\t\treturn function(value) {\n\t\t\t\tif (runs++ > 0) return\n\t\t\t\tfn(value)\n\t\t\t}\n\t\t}\n\t\tvar onerror = run(rejectCurrent)\n\t\ttry {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)}\n\t}\n\texecuteOnce(executor)\n}\nPromisePolyfill.prototype.then = function(onFulfilled, onRejection) {\n\tvar self = this, instance = self._instance\n\tfunction handle(callback, list, next, state) {\n\t\tlist.push(function(value) {\n\t\t\tif (typeof callback !== \"function\") next(value)\n\t\t\telse try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)}\n\t\t})\n\t\tif (typeof instance.retry === \"function\" && state === instance.state) instance.retry()\n\t}\n\tvar resolveNext, rejectNext\n\tvar promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject})\n\thandle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false)\n\treturn promise\n}\nPromisePolyfill.prototype.catch = function(onRejection) {\n\treturn this.then(null, onRejection)\n}\nPromisePolyfill.resolve = function(value) {\n\tif (value instanceof PromisePolyfill) return value\n\treturn new PromisePolyfill(function(resolve) {resolve(value)})\n}\nPromisePolyfill.reject = function(value) {\n\treturn new PromisePolyfill(function(resolve, reject) {reject(value)})\n}\nPromisePolyfill.all = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tvar total = list.length, count = 0, values = []\n\t\tif (list.length === 0) resolve([])\n\t\telse for (var i = 0; i < list.length; i++) {\n\t\t\t(function(i) {\n\t\t\t\tfunction consume(value) {\n\t\t\t\t\tcount++\n\t\t\t\t\tvalues[i] = value\n\t\t\t\t\tif (count === total) resolve(values)\n\t\t\t\t}\n\t\t\t\tif (list[i] != null && (typeof list[i] === \"object\" || typeof list[i] === \"function\") && typeof list[i].then === \"function\") {\n\t\t\t\t\tlist[i].then(consume, reject)\n\t\t\t\t}\n\t\t\t\telse consume(list[i])\n\t\t\t})(i)\n\t\t}\n\t})\n}\nPromisePolyfill.race = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\tlist[i].then(resolve, reject)\n\t\t}\n\t})\n}\nif (typeof window !== \"undefined\") {\n\tif (typeof window.Promise === \"undefined\") window.Promise = PromisePolyfill\n\tvar PromisePolyfill = window.Promise\n} else if (typeof global !== \"undefined\") {\n\tif (typeof global.Promise === \"undefined\") global.Promise = PromisePolyfill\n\tvar PromisePolyfill = global.Promise\n} else {\n}\nvar buildQueryString = function(object) {\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") return \"\"\n\tvar args = []\n\tfor (var key0 in object) {\n\t\tdestructure(key0, object[key0])\n\t}\n\treturn args.join(\"&\")\n\tfunction destructure(key0, value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tdestructure(key0 + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse if (Object.prototype.toString.call(value) === \"[object Object]\") {\n\t\t\tfor (var i in value) {\n\t\t\t\tdestructure(key0 + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse args.push(encodeURIComponent(key0) + (value != null && value !== \"\" ? \"=\" + encodeURIComponent(value) : \"\"))\n\t}\n}\nvar FILE_PROTOCOL_REGEX = new RegExp(\"^file://\", \"i\")\nvar _8 = function($window, Promise) {\n\tvar callbackCount = 0\n\tvar oncompletion\n\tfunction setCompletionCallback(callback) {oncompletion = callback}\n\tfunction finalizer() {\n\t\tvar count = 0\n\t\tfunction complete() {if (--count === 0 && typeof oncompletion === \"function\") oncompletion()}\n\t\treturn function finalize(promise0) {\n\t\t\tvar then0 = promise0.then\n\t\t\tpromise0.then = function() {\n\t\t\t\tcount++\n\t\t\t\tvar next = then0.apply(promise0, arguments)\n\t\t\t\tnext.then(complete, function(e) {\n\t\t\t\t\tcomplete()\n\t\t\t\t\tif (count === 0) throw e\n\t\t\t\t})\n\t\t\t\treturn finalize(next)\n\t\t\t}\n\t\t\treturn promise0\n\t\t}\n\t}\n\tfunction normalize(args, extra) {\n\t\tif (typeof args === \"string\") {\n\t\t\tvar url = args\n\t\t\targs = extra || {}\n\t\t\tif (args.url == null) args.url = url\n\t\t}\n\t\treturn args\n\t}\n\tfunction request(args, extra) {\n\t\tvar finalize = finalizer()\n\t\targs = normalize(args, extra)\n\t\tvar promise0 = new Promise(function(resolve, reject) {\n\t\t\tif (args.method == null) args.method = \"GET\"\n\t\t\targs.method = args.method.toUpperCase()\n\t\t\tvar useBody = (args.method === \"GET\" || args.method === \"TRACE\") ? false : (typeof args.useBody === \"boolean\" ? args.useBody : true)\n\t\t\tif (typeof args.serialize !== \"function\") args.serialize = typeof FormData !== \"undefined\" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify\n\t\t\tif (typeof args.deserialize !== \"function\") args.deserialize = deserialize\n\t\t\tif (typeof args.extract !== \"function\") args.extract = extract\n\t\t\targs.url = interpolate(args.url, args.data)\n\t\t\tif (useBody) args.data = args.serialize(args.data)\n\t\t\telse args.url = assemble(args.url, args.data)\n\t\t\tvar xhr = new $window.XMLHttpRequest(),\n\t\t\t\taborted = false,\n\t\t\t\t_abort = xhr.abort\n\t\t\txhr.abort = function abort() {\n\t\t\t\taborted = true\n\t\t\t\t_abort.call(xhr)\n\t\t\t}\n\t\t\txhr.open(args.method, args.url, typeof args.async === \"boolean\" ? args.async : true, typeof args.user === \"string\" ? args.user : undefined, typeof args.password === \"string\" ? args.password : undefined)\n\t\t\tif (args.serialize === JSON.stringify && useBody && !(args.headers && args.headers.hasOwnProperty(\"Content-Type\"))) {\n\t\t\t\txhr.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\t}\n\t\t\tif (args.deserialize === deserialize && !(args.headers && args.headers.hasOwnProperty(\"Accept\"))) {\n\t\t\t\txhr.setRequestHeader(\"Accept\", \"application/json, text/*\")\n\t\t\t}\n\t\t\tif (args.withCredentials) xhr.withCredentials = args.withCredentials\n\t\t\tfor (var key in args.headers) if ({}.hasOwnProperty.call(args.headers, key)) {\n\t\t\t\txhr.setRequestHeader(key, args.headers[key])\n\t\t\t}\n\t\t\tif (typeof args.config === \"function\") xhr = args.config(xhr, args) || xhr\n\t\t\txhr.onreadystatechange = function() {\n\t\t\t\t// Don't throw errors on xhr.abort().\n\t\t\t\tif(aborted) return\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))\n\t\t\t\t\t\tif ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) {\n\t\t\t\t\t\t\tresolve(cast(args.type, response))\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar error = new Error(xhr.responseText)\n\t\t\t\t\t\t\tfor (var key in response) error[key] = response[key]\n\t\t\t\t\t\t\treject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\treject(e)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (useBody && (args.data != null)) xhr.send(args.data)\n\t\t\telse xhr.send()\n\t\t})\n\t\treturn args.background === true ? promise0 : finalize(promise0)\n\t}\n\tfunction jsonp(args, extra) {\n\t\tvar finalize = finalizer()\n\t\targs = normalize(args, extra)\n\t\tvar promise0 = new Promise(function(resolve, reject) {\n\t\t\tvar callbackName = args.callbackName || \"_mithril_\" + Math.round(Math.random() * 1e16) + \"_\" + callbackCount++\n\t\t\tvar script = $window.document.createElement(\"script\")\n\t\t\t$window[callbackName] = function(data) {\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\tresolve(cast(args.type, data))\n\t\t\t\tdelete $window[callbackName]\n\t\t\t}\n\t\t\tscript.onerror = function() {\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\treject(new Error(\"JSONP request failed\"))\n\t\t\t\tdelete $window[callbackName]\n\t\t\t}\n\t\t\tif (args.data == null) args.data = {}\n\t\t\targs.url = interpolate(args.url, args.data)\n\t\t\targs.data[args.callbackKey || \"callback\"] = callbackName\n\t\t\tscript.src = assemble(args.url, args.data)\n\t\t\t$window.document.documentElement.appendChild(script)\n\t\t})\n\t\treturn args.background === true? promise0 : finalize(promise0)\n\t}\n\tfunction interpolate(url, data) {\n\t\tif (data == null) return url\n\t\tvar tokens = url.match(/:[^\\/]+/gi) || []\n\t\tfor (var i = 0; i < tokens.length; i++) {\n\t\t\tvar key = tokens[i].slice(1)\n\t\t\tif (data[key] != null) {\n\t\t\t\turl = url.replace(tokens[i], data[key])\n\t\t\t}\n\t\t}\n\t\treturn url\n\t}\n\tfunction assemble(url, data) {\n\t\tvar querystring = buildQueryString(data)\n\t\tif (querystring !== \"\") {\n\t\t\tvar prefix = url.indexOf(\"?\") < 0 ? \"?\" : \"&\"\n\t\t\turl += prefix + querystring\n\t\t}\n\t\treturn url\n\t}\n\tfunction deserialize(data) {\n\t\ttry {return data !== \"\" ? JSON.parse(data) : null}\n\t\tcatch (e) {throw new Error(data)}\n\t}\n\tfunction extract(xhr) {return xhr.responseText}\n\tfunction cast(type0, data) {\n\t\tif (typeof type0 === \"function\") {\n\t\t\tif (Array.isArray(data)) {\n\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\t\tdata[i] = new type0(data[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\telse return new type0(data)\n\t\t}\n\t\treturn data\n\t}\n\treturn {request: request, jsonp: jsonp, setCompletionCallback: setCompletionCallback}\n}\nvar requestService = _8(window, PromisePolyfill)\nvar coreRenderer = function($window) {\n\tvar $doc = $window.document\n\tvar $emptyFragment = $doc.createDocumentFragment()\n\tvar nameSpace = {\n\t\tsvg: \"http://www.w3.org/2000/svg\",\n\t\tmath: \"http://www.w3.org/1998/Math/MathML\"\n\t}\n\tvar onevent\n\tfunction setEventCallback(callback) {return onevent = callback}\n\tfunction getNameSpace(vnode) {\n\t\treturn vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag]\n\t}\n\t//create\n\tfunction createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t}\n\tfunction createNode(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tif (typeof tag === \"string\") {\n\t\t\tvnode.state = {}\n\t\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tswitch (tag) {\n\t\t\t\tcase \"#\": return createText(parent, vnode, nextSibling)\n\t\t\t\tcase \"<\": return createHTML(parent, vnode, nextSibling)\n\t\t\t\tcase \"[\": return createFragment(parent, vnode, hooks, ns, nextSibling)\n\t\t\t\tdefault: return createElement(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t\telse return createComponent(parent, vnode, hooks, ns, nextSibling)\n\t}\n\tfunction createText(parent, vnode, nextSibling) {\n\t\tvnode.dom = $doc.createTextNode(vnode.children)\n\t\tinsertNode(parent, vnode.dom, nextSibling)\n\t\treturn vnode.dom\n\t}\n\tfunction createHTML(parent, vnode, nextSibling) {\n\t\tvar match1 = vnode.children.match(/^\\s*?<(\\w+)/im) || []\n\t\tvar parent1 = {caption: \"table\", thead: \"table\", tbody: \"table\", tfoot: \"table\", tr: \"tbody\", th: \"tr\", td: \"tr\", colgroup: \"table\", col: \"colgroup\"}[match1[1]] || \"div\"\n\t\tvar temp = $doc.createElement(parent1)\n\t\ttemp.innerHTML = vnode.children\n\t\tvnode.dom = temp.firstChild\n\t\tvnode.domSize = temp.childNodes.length\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tvar child\n\t\twhile (child = temp.firstChild) {\n\t\t\tfragment.appendChild(child)\n\t\t}\n\t\tinsertNode(parent, fragment, nextSibling)\n\t\treturn fragment\n\t}\n\tfunction createFragment(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tif (vnode.children != null) {\n\t\t\tvar children = vnode.children\n\t\t\tcreateNodes(fragment, children, 0, children.length, hooks, null, ns)\n\t\t}\n\t\tvnode.dom = fragment.firstChild\n\t\tvnode.domSize = fragment.childNodes.length\n\t\tinsertNode(parent, fragment, nextSibling)\n\t\treturn fragment\n\t}\n\tfunction createElement(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tvar attrs2 = vnode.attrs\n\t\tvar is = attrs2 && attrs2.is\n\t\tns = getNameSpace(vnode) || ns\n\t\tvar element = ns ?\n\t\t\tis ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) :\n\t\t\tis ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag)\n\t\tvnode.dom = element\n\t\tif (attrs2 != null) {\n\t\t\tsetAttrs(vnode, attrs2, ns)\n\t\t}\n\t\tinsertNode(parent, element, nextSibling)\n\t\tif (vnode.attrs != null && vnode.attrs.contenteditable != null) {\n\t\t\tsetContentEditable(vnode)\n\t\t}\n\t\telse {\n\t\t\tif (vnode.text != null) {\n\t\t\t\tif (vnode.text !== \"\") element.textContent = vnode.text\n\t\t\t\telse vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\t}\n\t\t\tif (vnode.children != null) {\n\t\t\t\tvar children = vnode.children\n\t\t\t\tcreateNodes(element, children, 0, children.length, hooks, null, ns)\n\t\t\t\tsetLateAttrs(vnode)\n\t\t\t}\n\t\t}\n\t\treturn element\n\t}\n\tfunction initComponent(vnode, hooks) {\n\t\tvar sentinel\n\t\tif (typeof vnode.tag.view === \"function\") {\n\t\t\tvnode.state = Object.create(vnode.tag)\n\t\t\tsentinel = vnode.state.view\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return $emptyFragment\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t} else {\n\t\t\tvnode.state = void 0\n\t\t\tsentinel = vnode.tag\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return $emptyFragment\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t\tvnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === \"function\") ? new vnode.tag(vnode) : vnode.tag(vnode)\n\t\t}\n\t\tvnode._state = vnode.state\n\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\tinitLifecycle(vnode._state, vnode, hooks)\n\t\tvnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tsentinel.$$reentrantLock$$ = null\n\t}\n\tfunction createComponent(parent, vnode, hooks, ns, nextSibling) {\n\t\tinitComponent(vnode, hooks)\n\t\tif (vnode.instance != null) {\n\t\t\tvar element = createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0\n\t\t\tinsertNode(parent, element, nextSibling)\n\t\t\treturn element\n\t\t}\n\t\telse {\n\t\t\tvnode.domSize = 0\n\t\t\treturn $emptyFragment\n\t\t}\n\t}\n\t//update\n\tfunction updateNodes(parent, old, vnodes, recycling, hooks, nextSibling, ns) {\n\t\tif (old === vnodes || old == null && vnodes == null) return\n\t\telse if (old == null) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)\n\t\telse if (vnodes == null) removeNodes(old, 0, old.length, vnodes)\n\t\telse {\n\t\t\tif (old.length === vnodes.length) {\n\t\t\t\tvar isUnkeyed = false\n\t\t\t\tfor (var i = 0; i < vnodes.length; i++) {\n\t\t\t\t\tif (vnodes[i] != null && old[i] != null) {\n\t\t\t\t\t\tisUnkeyed = vnodes[i].key == null && old[i].key == null\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isUnkeyed) {\n\t\t\t\t\tfor (var i = 0; i < old.length; i++) {\n\t\t\t\t\t\tif (old[i] === vnodes[i]) continue\n\t\t\t\t\t\telse if (old[i] == null && vnodes[i] != null) createNode(parent, vnodes[i], hooks, ns, getNextSibling(old, i + 1, nextSibling))\n\t\t\t\t\t\telse if (vnodes[i] == null) removeNodes(old, i, i + 1, vnodes)\n\t\t\t\t\t\telse updateNode(parent, old[i], vnodes[i], hooks, getNextSibling(old, i + 1, nextSibling), recycling, ns)\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\trecycling = recycling || isRecyclable(old, vnodes)\n\t\t\tif (recycling) {\n\t\t\t\tvar pool = old.pool\n\t\t\t\told = old.concat(old.pool)\n\t\t\t}\n\t\t\tvar oldStart = 0, start = 0, oldEnd = old.length - 1, end = vnodes.length - 1, map\n\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\tvar o = old[oldStart], v = vnodes[start]\n\t\t\t\tif (o === v && !recycling) oldStart++, start++\n\t\t\t\telse if (o == null) oldStart++\n\t\t\t\telse if (v == null) start++\n\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\tvar shouldRecycle = (pool != null && oldStart >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\toldStart++, start++\n\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), shouldRecycle, ns)\n\t\t\t\t\tif (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar o = old[oldEnd]\n\t\t\t\t\tif (o === v && !recycling) oldEnd--, start++\n\t\t\t\t\telse if (o == null) oldEnd--\n\t\t\t\t\telse if (v == null) start++\n\t\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\t\tvar shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)\n\t\t\t\t\t\tif (recycling || start < end) insertNode(parent, toFragment(o), getNextSibling(old, oldStart, nextSibling))\n\t\t\t\t\t\toldEnd--, start++\n\t\t\t\t\t}\n\t\t\t\t\telse break\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\tvar o = old[oldEnd], v = vnodes[end]\n\t\t\t\tif (o === v && !recycling) oldEnd--, end--\n\t\t\t\telse if (o == null) oldEnd--\n\t\t\t\telse if (v == null) end--\n\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\tvar shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)\n\t\t\t\t\tif (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)\n\t\t\t\t\tif (o.dom != null) nextSibling = o.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!map) map = getKeyMap(old, oldEnd)\n\t\t\t\t\tif (v != null) {\n\t\t\t\t\t\tvar oldIndex = map[v.key]\n\t\t\t\t\t\tif (oldIndex != null) {\n\t\t\t\t\t\t\tvar movable = old[oldIndex]\n\t\t\t\t\t\t\tvar shouldRecycle = (pool != null && oldIndex >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\t\t\tupdateNode(parent, movable, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), recycling, ns)\n\t\t\t\t\t\t\tinsertNode(parent, toFragment(movable), nextSibling)\n\t\t\t\t\t\t\told[oldIndex].skip = true\n\t\t\t\t\t\t\tif (movable.dom != null) nextSibling = movable.dom\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar dom = createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\tnextSibling = dom\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tend--\n\t\t\t\t}\n\t\t\t\tif (end < start) break\n\t\t\t}\n\t\t\tcreateNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\tremoveNodes(old, oldStart, oldEnd + 1, vnodes)\n\t\t}\n\t}\n\tfunction updateNode(parent, old, vnode, hooks, nextSibling, recycling, ns) {\n\t\tvar oldTag = old.tag, tag = vnode.tag\n\t\tif (oldTag === tag) {\n\t\t\tvnode.state = old.state\n\t\t\tvnode._state = old._state\n\t\t\tvnode.events = old.events\n\t\t\tif (!recycling && shouldNotUpdate(vnode, old)) return\n\t\t\tif (typeof oldTag === \"string\") {\n\t\t\t\tif (vnode.attrs != null) {\n\t\t\t\t\tif (recycling) {\n\t\t\t\t\t\tvnode.state = {}\n\t\t\t\t\t\tinitLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t\t}\n\t\t\t\t\telse updateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t}\n\t\t\t\tswitch (oldTag) {\n\t\t\t\t\tcase \"#\": updateText(old, vnode); break\n\t\t\t\t\tcase \"<\": updateHTML(parent, old, vnode, nextSibling); break\n\t\t\t\t\tcase \"[\": updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns); break\n\t\t\t\t\tdefault: updateElement(old, vnode, recycling, hooks, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t\telse updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns)\n\t\t}\n\t\telse {\n\t\t\tremoveNode(old, null)\n\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t}\n\t}\n\tfunction updateText(old, vnode) {\n\t\tif (old.children.toString() !== vnode.children.toString()) {\n\t\t\told.dom.nodeValue = vnode.children\n\t\t}\n\t\tvnode.dom = old.dom\n\t}\n\tfunction updateHTML(parent, old, vnode, nextSibling) {\n\t\tif (old.children !== vnode.children) {\n\t\t\ttoFragment(old)\n\t\t\tcreateHTML(parent, vnode, nextSibling)\n\t\t}\n\t\telse vnode.dom = old.dom, vnode.domSize = old.domSize\n\t}\n\tfunction updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns) {\n\t\tupdateNodes(parent, old.children, vnode.children, recycling, hooks, nextSibling, ns)\n\t\tvar domSize = 0, children = vnode.children\n\t\tvnode.dom = null\n\t\tif (children != null) {\n\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\tvar child = children[i]\n\t\t\t\tif (child != null && child.dom != null) {\n\t\t\t\t\tif (vnode.dom == null) vnode.dom = child.dom\n\t\t\t\t\tdomSize += child.domSize || 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (domSize !== 1) vnode.domSize = domSize\n\t\t}\n\t}\n\tfunction updateElement(old, vnode, recycling, hooks, ns) {\n\t\tvar element = vnode.dom = old.dom\n\t\tns = getNameSpace(vnode) || ns\n\t\tif (vnode.tag === \"textarea\") {\n\t\t\tif (vnode.attrs == null) vnode.attrs = {}\n\t\t\tif (vnode.text != null) {\n\t\t\t\tvnode.attrs.value = vnode.text //FIXME handle0 multiple children\n\t\t\t\tvnode.text = undefined\n\t\t\t}\n\t\t}\n\t\tupdateAttrs(vnode, old.attrs, vnode.attrs, ns)\n\t\tif (vnode.attrs != null && vnode.attrs.contenteditable != null) {\n\t\t\tsetContentEditable(vnode)\n\t\t}\n\t\telse if (old.text != null && vnode.text != null && vnode.text !== \"\") {\n\t\t\tif (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text\n\t\t}\n\t\telse {\n\t\t\tif (old.text != null) old.children = [Vnode(\"#\", undefined, undefined, old.text, undefined, old.dom.firstChild)]\n\t\t\tif (vnode.text != null) vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\tupdateNodes(element, old.children, vnode.children, recycling, hooks, null, ns)\n\t\t}\n\t}\n\tfunction updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) {\n\t\tif (recycling) {\n\t\t\tinitComponent(vnode, hooks)\n\t\t} else {\n\t\t\tvnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))\n\t\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\t\tif (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tupdateLifecycle(vnode._state, vnode, hooks)\n\t\t}\n\t\tif (vnode.instance != null) {\n\t\t\tif (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\telse updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.instance.domSize\n\t\t}\n\t\telse if (old.instance != null) {\n\t\t\tremoveNode(old.instance, null)\n\t\t\tvnode.dom = undefined\n\t\t\tvnode.domSize = 0\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t}\n\t}\n\tfunction isRecyclable(old, vnodes) {\n\t\tif (old.pool != null && Math.abs(old.pool.length - vnodes.length) <= Math.abs(old.length - vnodes.length)) {\n\t\t\tvar oldChildrenLength = old[0] && old[0].children && old[0].children.length || 0\n\t\t\tvar poolChildrenLength = old.pool[0] && old.pool[0].children && old.pool[0].children.length || 0\n\t\t\tvar vnodesChildrenLength = vnodes[0] && vnodes[0].children && vnodes[0].children.length || 0\n\t\t\tif (Math.abs(poolChildrenLength - vnodesChildrenLength) <= Math.abs(oldChildrenLength - vnodesChildrenLength)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n\tfunction getKeyMap(vnodes, end) {\n\t\tvar map = {}, i = 0\n\t\tfor (var i = 0; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tvar key2 = vnode.key\n\t\t\t\tif (key2 != null) map[key2] = i\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}\n\tfunction toFragment(vnode) {\n\t\tvar count0 = vnode.domSize\n\t\tif (count0 != null || vnode.dom == null) {\n\t\t\tvar fragment = $doc.createDocumentFragment()\n\t\t\tif (count0 > 0) {\n\t\t\t\tvar dom = vnode.dom\n\t\t\t\twhile (--count0) fragment.appendChild(dom.nextSibling)\n\t\t\t\tfragment.insertBefore(dom, fragment.firstChild)\n\t\t\t}\n\t\t\treturn fragment\n\t\t}\n\t\telse return vnode.dom\n\t}\n\tfunction getNextSibling(vnodes, i, nextSibling) {\n\t\tfor (; i < vnodes.length; i++) {\n\t\t\tif (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom\n\t\t}\n\t\treturn nextSibling\n\t}\n\tfunction insertNode(parent, dom, nextSibling) {\n\t\tif (nextSibling && nextSibling.parentNode) parent.insertBefore(dom, nextSibling)\n\t\telse parent.appendChild(dom)\n\t}\n\tfunction setContentEditable(vnode) {\n\t\tvar children = vnode.children\n\t\tif (children != null && children.length === 1 && children[0].tag === \"<\") {\n\t\t\tvar content = children[0].children\n\t\t\tif (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content\n\t\t}\n\t\telse if (vnode.text != null || children != null && children.length !== 0) throw new Error(\"Child node of a contenteditable must be trusted\")\n\t}\n\t//remove\n\tfunction removeNodes(vnodes, start, end, context) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tif (vnode.skip) vnode.skip = false\n\t\t\t\telse removeNode(vnode, context)\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeNode(vnode, context) {\n\t\tvar expected = 1, called = 0\n\t\tif (vnode.attrs && typeof vnode.attrs.onbeforeremove === \"function\") {\n\t\t\tvar result = vnode.attrs.onbeforeremove.call(vnode.state, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\texpected++\n\t\t\t\tresult.then(continuation, continuation)\n\t\t\t}\n\t\t}\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onbeforeremove === \"function\") {\n\t\t\tvar result = vnode._state.onbeforeremove.call(vnode.state, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\texpected++\n\t\t\t\tresult.then(continuation, continuation)\n\t\t\t}\n\t\t}\n\t\tcontinuation()\n\t\tfunction continuation() {\n\t\t\tif (++called === expected) {\n\t\t\t\tonremove(vnode)\n\t\t\t\tif (vnode.dom) {\n\t\t\t\t\tvar count0 = vnode.domSize || 1\n\t\t\t\t\tif (count0 > 1) {\n\t\t\t\t\t\tvar dom = vnode.dom\n\t\t\t\t\t\twhile (--count0) {\n\t\t\t\t\t\t\tremoveNodeFromDOM(dom.nextSibling)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tremoveNodeFromDOM(vnode.dom)\n\t\t\t\t\tif (context != null && vnode.domSize == null && !hasIntegrationMethods(vnode.attrs) && typeof vnode.tag === \"string\") { //TODO test custom elements\n\t\t\t\t\t\tif (!context.pool) context.pool = [vnode]\n\t\t\t\t\t\telse context.pool.push(vnode)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeNodeFromDOM(node) {\n\t\tvar parent = node.parentNode\n\t\tif (parent != null) parent.removeChild(node)\n\t}\n\tfunction onremove(vnode) {\n\t\tif (vnode.attrs && typeof vnode.attrs.onremove === \"function\") vnode.attrs.onremove.call(vnode.state, vnode)\n\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\tif (typeof vnode._state.onremove === \"function\") vnode._state.onremove.call(vnode.state, vnode)\n\t\t\tif (vnode.instance != null) onremove(vnode.instance)\n\t\t} else {\n\t\t\tvar children = vnode.children\n\t\t\tif (Array.isArray(children)) {\n\t\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\t\tvar child = children[i]\n\t\t\t\t\tif (child != null) onremove(child)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//attrs2\n\tfunction setAttrs(vnode, attrs2, ns) {\n\t\tfor (var key2 in attrs2) {\n\t\t\tsetAttr(vnode, key2, null, attrs2[key2], ns)\n\t\t}\n\t}\n\tfunction setAttr(vnode, key2, old, value, ns) {\n\t\tvar element = vnode.dom\n\t\tif (key2 === \"key\" || key2 === \"is\" || (old === value && !isFormAttribute(vnode, key2)) && typeof value !== \"object\" || typeof value === \"undefined\" || isLifecycleMethod(key2)) return\n\t\tvar nsLastIndex = key2.indexOf(\":\")\n\t\tif (nsLastIndex > -1 && key2.substr(0, nsLastIndex) === \"xlink\") {\n\t\t\telement.setAttributeNS(\"http://www.w3.org/1999/xlink\", key2.slice(nsLastIndex + 1), value)\n\t\t}\n\t\telse if (key2[0] === \"o\" && key2[1] === \"n\" && typeof value === \"function\") updateEvent(vnode, key2, value)\n\t\telse if (key2 === \"style\") updateStyle(element, old, value)\n\t\telse if (key2 in element && !isAttribute(key2) && ns === undefined && !isCustomElement(vnode)) {\n\t\t\tif (key2 === \"value\") {\n\t\t\t\tvar normalized0 = \"\" + value // eslint-disable-line no-implicit-coercion\n\t\t\t\t//setting input[value] to same value by typing on focused element moves cursor to end in Chrome\n\t\t\t\tif ((vnode.tag === \"input\" || vnode.tag === \"textarea\") && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return\n\t\t\t\t//setting select[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"select\") {\n\t\t\t\t\tif (value === null) {\n\t\t\t\t\t\tif (vnode.dom.selectedIndex === -1 && vnode.dom === $doc.activeElement) return\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (old !== null && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//setting option[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"option\" && old != null && vnode.dom.value === normalized0) return\n\t\t\t}\n\t\t\t// If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur.\n\t\t\tif (vnode.tag === \"input\" && key2 === \"type\") {\n\t\t\t\telement.setAttribute(key2, value)\n\t\t\t\treturn\n\t\t\t}\n\t\t\telement[key2] = value\n\t\t}\n\t\telse {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tif (value) element.setAttribute(key2, \"\")\n\t\t\t\telse element.removeAttribute(key2)\n\t\t\t}\n\t\t\telse element.setAttribute(key2 === \"className\" ? \"class\" : key2, value)\n\t\t}\n\t}\n\tfunction setLateAttrs(vnode) {\n\t\tvar attrs2 = vnode.attrs\n\t\tif (vnode.tag === \"select\" && attrs2 != null) {\n\t\t\tif (\"value\" in attrs2) setAttr(vnode, \"value\", null, attrs2.value, undefined)\n\t\t\tif (\"selectedIndex\" in attrs2) setAttr(vnode, \"selectedIndex\", null, attrs2.selectedIndex, undefined)\n\t\t}\n\t}\n\tfunction updateAttrs(vnode, old, attrs2, ns) {\n\t\tif (attrs2 != null) {\n\t\t\tfor (var key2 in attrs2) {\n\t\t\t\tsetAttr(vnode, key2, old && old[key2], attrs2[key2], ns)\n\t\t\t}\n\t\t}\n\t\tif (old != null) {\n\t\t\tfor (var key2 in old) {\n\t\t\t\tif (attrs2 == null || !(key2 in attrs2)) {\n\t\t\t\t\tif (key2 === \"className\") key2 = \"class\"\n\t\t\t\t\tif (key2[0] === \"o\" && key2[1] === \"n\" && !isLifecycleMethod(key2)) updateEvent(vnode, key2, undefined)\n\t\t\t\t\telse if (key2 !== \"key\") vnode.dom.removeAttribute(key2)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction isFormAttribute(vnode, attr) {\n\t\treturn attr === \"value\" || attr === \"checked\" || attr === \"selectedIndex\" || attr === \"selected\" && vnode.dom === $doc.activeElement\n\t}\n\tfunction isLifecycleMethod(attr) {\n\t\treturn attr === \"oninit\" || attr === \"oncreate\" || attr === \"onupdate\" || attr === \"onremove\" || attr === \"onbeforeremove\" || attr === \"onbeforeupdate\"\n\t}\n\tfunction isAttribute(attr) {\n\t\treturn attr === \"href\" || attr === \"list\" || attr === \"form\" || attr === \"width\" || attr === \"height\"// || attr === \"type\"\n\t}\n\tfunction isCustomElement(vnode){\n\t\treturn vnode.attrs.is || vnode.tag.indexOf(\"-\") > -1\n\t}\n\tfunction hasIntegrationMethods(source) {\n\t\treturn source != null && (source.oncreate || source.onupdate || source.onbeforeremove || source.onremove)\n\t}\n\t//style\n\tfunction updateStyle(element, old, style) {\n\t\tif (old === style) element.style.cssText = \"\", old = null\n\t\tif (style == null) element.style.cssText = \"\"\n\t\telse if (typeof style === \"string\") element.style.cssText = style\n\t\telse {\n\t\t\tif (typeof old === \"string\") element.style.cssText = \"\"\n\t\t\tfor (var key2 in style) {\n\t\t\t\telement.style[key2] = style[key2]\n\t\t\t}\n\t\t\tif (old != null && typeof old !== \"string\") {\n\t\t\t\tfor (var key2 in old) {\n\t\t\t\t\tif (!(key2 in style)) element.style[key2] = \"\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//event\n\tfunction updateEvent(vnode, key2, value) {\n\t\tvar element = vnode.dom\n\t\tvar callback = typeof onevent !== \"function\" ? value : function(e) {\n\t\t\tvar result = value.call(element, e)\n\t\t\tonevent.call(element, e)\n\t\t\treturn result\n\t\t}\n\t\tif (key2 in element) element[key2] = typeof value === \"function\" ? callback : null\n\t\telse {\n\t\t\tvar eventName = key2.slice(2)\n\t\t\tif (vnode.events === undefined) vnode.events = {}\n\t\t\tif (vnode.events[key2] === callback) return\n\t\t\tif (vnode.events[key2] != null) element.removeEventListener(eventName, vnode.events[key2], false)\n\t\t\tif (typeof value === \"function\") {\n\t\t\t\tvnode.events[key2] = callback\n\t\t\t\telement.addEventListener(eventName, vnode.events[key2], false)\n\t\t\t}\n\t\t}\n\t}\n\t//lifecycle\n\tfunction initLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.oninit === \"function\") source.oninit.call(vnode.state, vnode)\n\t\tif (typeof source.oncreate === \"function\") hooks.push(source.oncreate.bind(vnode.state, vnode))\n\t}\n\tfunction updateLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.onupdate === \"function\") hooks.push(source.onupdate.bind(vnode.state, vnode))\n\t}\n\tfunction shouldNotUpdate(vnode, old) {\n\t\tvar forceVnodeUpdate, forceComponentUpdate\n\t\tif (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === \"function\") forceVnodeUpdate = vnode.attrs.onbeforeupdate.call(vnode.state, vnode, old)\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onbeforeupdate === \"function\") forceComponentUpdate = vnode._state.onbeforeupdate.call(vnode.state, vnode, old)\n\t\tif (!(forceVnodeUpdate === undefined && forceComponentUpdate === undefined) && !forceVnodeUpdate && !forceComponentUpdate) {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t\tvnode.instance = old.instance\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\tfunction render(dom, vnodes) {\n\t\tif (!dom) throw new Error(\"Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.\")\n\t\tvar hooks = []\n\t\tvar active = $doc.activeElement\n\t\tvar namespace = dom.namespaceURI\n\t\t// First time0 rendering into a node clears it out\n\t\tif (dom.vnodes == null) dom.textContent = \"\"\n\t\tif (!Array.isArray(vnodes)) vnodes = [vnodes]\n\t\tupdateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, namespace === \"http://www.w3.org/1999/xhtml\" ? undefined : namespace)\n\t\tdom.vnodes = vnodes\n\t\t// document.activeElement can return null in IE https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement\n\t\tif (active != null && $doc.activeElement !== active) active.focus()\n\t\tfor (var i = 0; i < hooks.length; i++) hooks[i]()\n\t}\n\treturn {render: render, setEventCallback: setEventCallback}\n}\nfunction throttle(callback) {\n\t//60fps translates to 16.6ms, round it down since setTimeout requires int\n\tvar time = 16\n\tvar last = 0, pending = null\n\tvar timeout = typeof requestAnimationFrame === \"function\" ? requestAnimationFrame : setTimeout\n\treturn function() {\n\t\tvar now = Date.now()\n\t\tif (last === 0 || now - last >= time) {\n\t\t\tlast = now\n\t\t\tcallback()\n\t\t}\n\t\telse if (pending === null) {\n\t\t\tpending = timeout(function() {\n\t\t\t\tpending = null\n\t\t\t\tcallback()\n\t\t\t\tlast = Date.now()\n\t\t\t}, time - (now - last))\n\t\t}\n\t}\n}\nvar _11 = function($window) {\n\tvar renderService = coreRenderer($window)\n\trenderService.setEventCallback(function(e) {\n\t\tif (e.redraw === false) e.redraw = undefined\n\t\telse redraw()\n\t})\n\tvar callbacks = []\n\tfunction subscribe(key1, callback) {\n\t\tunsubscribe(key1)\n\t\tcallbacks.push(key1, throttle(callback))\n\t}\n\tfunction unsubscribe(key1) {\n\t\tvar index = callbacks.indexOf(key1)\n\t\tif (index > -1) callbacks.splice(index, 2)\n\t}\n\tfunction redraw() {\n\t\tfor (var i = 1; i < callbacks.length; i += 2) {\n\t\t\tcallbacks[i]()\n\t\t}\n\t}\n\treturn {subscribe: subscribe, unsubscribe: unsubscribe, redraw: redraw, render: renderService.render}\n}\nvar redrawService = _11(window)\nrequestService.setCompletionCallback(redrawService.redraw)\nvar _16 = function(redrawService0) {\n\treturn function(root, component) {\n\t\tif (component === null) {\n\t\t\tredrawService0.render(root, [])\n\t\t\tredrawService0.unsubscribe(root)\n\t\t\treturn\n\t\t}\n\t\t\n\t\tif (component.view == null && typeof component !== \"function\") throw new Error(\"m.mount(element, component) expects a component, not a vnode\")\n\t\t\n\t\tvar run0 = function() {\n\t\t\tredrawService0.render(root, Vnode(component))\n\t\t}\n\t\tredrawService0.subscribe(root, run0)\n\t\tredrawService0.redraw()\n\t}\n}\nm.mount = _16(redrawService)\nvar Promise = PromisePolyfill\nvar parseQueryString = function(string) {\n\tif (string === \"\" || string == null) return {}\n\tif (string.charAt(0) === \"?\") string = string.slice(1)\n\tvar entries = string.split(\"&\"), data0 = {}, counters = {}\n\tfor (var i = 0; i < entries.length; i++) {\n\t\tvar entry = entries[i].split(\"=\")\n\t\tvar key5 = decodeURIComponent(entry[0])\n\t\tvar value = entry.length === 2 ? decodeURIComponent(entry[1]) : \"\"\n\t\tif (value === \"true\") value = true\n\t\telse if (value === \"false\") value = false\n\t\tvar levels = key5.split(/\\]\\[?|\\[/)\n\t\tvar cursor = data0\n\t\tif (key5.indexOf(\"[\") > -1) levels.pop()\n\t\tfor (var j = 0; j < levels.length; j++) {\n\t\t\tvar level = levels[j], nextLevel = levels[j + 1]\n\t\t\tvar isNumber = nextLevel == \"\" || !isNaN(parseInt(nextLevel, 10))\n\t\t\tvar isValue = j === levels.length - 1\n\t\t\tif (level === \"\") {\n\t\t\t\tvar key5 = levels.slice(0, j).join()\n\t\t\t\tif (counters[key5] == null) counters[key5] = 0\n\t\t\t\tlevel = counters[key5]++\n\t\t\t}\n\t\t\tif (cursor[level] == null) {\n\t\t\t\tcursor[level] = isValue ? value : isNumber ? [] : {}\n\t\t\t}\n\t\t\tcursor = cursor[level]\n\t\t}\n\t}\n\treturn data0\n}\nvar coreRouter = function($window) {\n\tvar supportsPushState = typeof $window.history.pushState === \"function\"\n\tvar callAsync0 = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction normalize1(fragment0) {\n\t\tvar data = $window.location[fragment0].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)\n\t\tif (fragment0 === \"pathname\" && data[0] !== \"/\") data = \"/\" + data\n\t\treturn data\n\t}\n\tvar asyncId\n\tfunction debounceAsync(callback0) {\n\t\treturn function() {\n\t\t\tif (asyncId != null) return\n\t\t\tasyncId = callAsync0(function() {\n\t\t\t\tasyncId = null\n\t\t\t\tcallback0()\n\t\t\t})\n\t\t}\n\t}\n\tfunction parsePath(path, queryData, hashData) {\n\t\tvar queryIndex = path.indexOf(\"?\")\n\t\tvar hashIndex = path.indexOf(\"#\")\n\t\tvar pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length\n\t\tif (queryIndex > -1) {\n\t\t\tvar queryEnd = hashIndex > -1 ? hashIndex : path.length\n\t\t\tvar queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd))\n\t\t\tfor (var key4 in queryParams) queryData[key4] = queryParams[key4]\n\t\t}\n\t\tif (hashIndex > -1) {\n\t\t\tvar hashParams = parseQueryString(path.slice(hashIndex + 1))\n\t\t\tfor (var key4 in hashParams) hashData[key4] = hashParams[key4]\n\t\t}\n\t\treturn path.slice(0, pathEnd)\n\t}\n\tvar router = {prefix: \"#!\"}\n\trouter.getPath = function() {\n\t\tvar type2 = router.prefix.charAt(0)\n\t\tswitch (type2) {\n\t\t\tcase \"#\": return normalize1(\"hash\").slice(router.prefix.length)\n\t\t\tcase \"?\": return normalize1(\"search\").slice(router.prefix.length) + normalize1(\"hash\")\n\t\t\tdefault: return normalize1(\"pathname\").slice(router.prefix.length) + normalize1(\"search\") + normalize1(\"hash\")\n\t\t}\n\t}\n\trouter.setPath = function(path, data, options) {\n\t\tvar queryData = {}, hashData = {}\n\t\tpath = parsePath(path, queryData, hashData)\n\t\tif (data != null) {\n\t\t\tfor (var key4 in data) queryData[key4] = data[key4]\n\t\t\tpath = path.replace(/:([^\\/]+)/g, function(match2, token) {\n\t\t\t\tdelete queryData[token]\n\t\t\t\treturn data[token]\n\t\t\t})\n\t\t}\n\t\tvar query = buildQueryString(queryData)\n\t\tif (query) path += \"?\" + query\n\t\tvar hash = buildQueryString(hashData)\n\t\tif (hash) path += \"#\" + hash\n\t\tif (supportsPushState) {\n\t\t\tvar state = options ? options.state : null\n\t\t\tvar title = options ? options.title : null\n\t\t\t$window.onpopstate()\n\t\t\tif (options && options.replace) $window.history.replaceState(state, title, router.prefix + path)\n\t\t\telse $window.history.pushState(state, title, router.prefix + path)\n\t\t}\n\t\telse $window.location.href = router.prefix + path\n\t}\n\trouter.defineRoutes = function(routes, resolve, reject) {\n\t\tfunction resolveRoute() {\n\t\t\tvar path = router.getPath()\n\t\t\tvar params = {}\n\t\t\tvar pathname = parsePath(path, params, params)\n\t\t\tvar state = $window.history.state\n\t\t\tif (state != null) {\n\t\t\t\tfor (var k in state) params[k] = state[k]\n\t\t\t}\n\t\t\tfor (var route0 in routes) {\n\t\t\t\tvar matcher = new RegExp(\"^\" + route0.replace(/:[^\\/]+?\\.{3}/g, \"(.*?)\").replace(/:[^\\/]+/g, \"([^\\\\/]+)\") + \"\\/?$\")\n\t\t\t\tif (matcher.test(pathname)) {\n\t\t\t\t\tpathname.replace(matcher, function() {\n\t\t\t\t\t\tvar keys = route0.match(/:[^\\/]+/g) || []\n\t\t\t\t\t\tvar values = [].slice.call(arguments, 1, -2)\n\t\t\t\t\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\t\t\t\t\tparams[keys[i].replace(/:|\\./g, \"\")] = decodeURIComponent(values[i])\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresolve(routes[route0], params, path, route0)\n\t\t\t\t\t})\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\treject(path, params)\n\t\t}\n\t\tif (supportsPushState) $window.onpopstate = debounceAsync(resolveRoute)\n\t\telse if (router.prefix.charAt(0) === \"#\") $window.onhashchange = resolveRoute\n\t\tresolveRoute()\n\t}\n\treturn router\n}\nvar _20 = function($window, redrawService0) {\n\tvar routeService = coreRouter($window)\n\tvar identity = function(v) {return v}\n\tvar render1, component, attrs3, currentPath, lastUpdate\n\tvar route = function(root, defaultRoute, routes) {\n\t\tif (root == null) throw new Error(\"Ensure the DOM element that was passed to `m.route` is not undefined\")\n\t\tvar run1 = function() {\n\t\t\tif (render1 != null) redrawService0.render(root, render1(Vnode(component, attrs3.key, attrs3)))\n\t\t}\n\t\tvar bail = function(path) {\n\t\t\tif (path !== defaultRoute) routeService.setPath(defaultRoute, null, {replace: true})\n\t\t\telse throw new Error(\"Could not resolve default route \" + defaultRoute)\n\t\t}\n\t\trouteService.defineRoutes(routes, function(payload, params, path) {\n\t\t\tvar update = lastUpdate = function(routeResolver, comp) {\n\t\t\t\tif (update !== lastUpdate) return\n\t\t\t\tcomponent = comp != null && (typeof comp.view === \"function\" || typeof comp === \"function\")? comp : \"div\"\n\t\t\t\tattrs3 = params, currentPath = path, lastUpdate = null\n\t\t\t\trender1 = (routeResolver.render || identity).bind(routeResolver)\n\t\t\t\trun1()\n\t\t\t}\n\t\t\tif (payload.view || typeof payload === \"function\") update({}, payload)\n\t\t\telse {\n\t\t\t\tif (payload.onmatch) {\n\t\t\t\t\tPromise.resolve(payload.onmatch(params, path)).then(function(resolved) {\n\t\t\t\t\t\tupdate(payload, resolved)\n\t\t\t\t\t}, bail)\n\t\t\t\t}\n\t\t\t\telse update(payload, \"div\")\n\t\t\t}\n\t\t}, bail)\n\t\tredrawService0.subscribe(root, run1)\n\t}\n\troute.set = function(path, data, options) {\n\t\tif (lastUpdate != null) {\n\t\t\toptions = options || {}\n\t\t\toptions.replace = true\n\t\t}\n\t\tlastUpdate = null\n\t\trouteService.setPath(path, data, options)\n\t}\n\troute.get = function() {return currentPath}\n\troute.prefix = function(prefix0) {routeService.prefix = prefix0}\n\troute.link = function(vnode1) {\n\t\tvnode1.dom.setAttribute(\"href\", routeService.prefix + vnode1.attrs.href)\n\t\tvnode1.dom.onclick = function(e) {\n\t\t\tif (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return\n\t\t\te.preventDefault()\n\t\t\te.redraw = false\n\t\t\tvar href = this.getAttribute(\"href\")\n\t\t\tif (href.indexOf(routeService.prefix) === 0) href = href.slice(routeService.prefix.length)\n\t\t\troute.set(href, undefined, undefined)\n\t\t}\n\t}\n\troute.param = function(key3) {\n\t\tif(typeof attrs3 !== \"undefined\" && typeof key3 !== \"undefined\") return attrs3[key3]\n\t\treturn attrs3\n\t}\n\treturn route\n}\nm.route = _20(window, redrawService)\nm.withAttr = function(attrName, callback1, context) {\n\treturn function(e) {\n\t\tcallback1.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName))\n\t}\n}\nvar _28 = coreRenderer(window)\nm.render = _28.render\nm.redraw = redrawService.redraw\nm.request = requestService.request\nm.jsonp = requestService.jsonp\nm.parseQueryString = parseQueryString\nm.buildQueryString = buildQueryString\nm.version = \"1.1.6\"\nm.vnode = Vnode\nif (typeof module !== \"undefined\") module[\"exports\"] = m\nelse window.m = m\n}());\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {},require(\"timers\").setImmediate)\n},{\"timers\":10}],9:[function(require,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],10:[function(require,module,exports){\n(function (setImmediate,clearImmediate){\nvar nextTick = require('process/browser.js').nextTick;\nvar apply = Function.prototype.apply;\nvar slice = Array.prototype.slice;\nvar immediateIds = {};\nvar nextImmediateId = 0;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) { timeout.close(); };\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(window, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// That's not how node.js implements it but the exposed api is the same.\nexports.setImmediate = typeof setImmediate === \"function\" ? setImmediate : function(fn) {\n var id = nextImmediateId++;\n var args = arguments.length < 2 ? false : slice.call(arguments, 1);\n\n immediateIds[id] = true;\n\n nextTick(function onNextTick() {\n if (immediateIds[id]) {\n // fn.call() is faster so we optimize for the common use-case\n // @see http://jsperf.com/call-apply-segu\n if (args) {\n fn.apply(null, args);\n } else {\n fn.call(null);\n }\n // Prevent ids from leaking\n exports.clearImmediate(id);\n }\n });\n\n return id;\n};\n\nexports.clearImmediate = typeof clearImmediate === \"function\" ? clearImmediate : function(id) {\n delete immediateIds[id];\n};\n}).call(this,require(\"timers\").setImmediate,require(\"timers\").clearImmediate)\n},{\"process/browser.js\":9,\"timers\":10}],11:[function(require,module,exports){\nfunction tlite(getTooltipOpts) {\n document.addEventListener('mouseover', function (e) {\n var el = e.target;\n var opts = getTooltipOpts(el);\n\n if (!opts) {\n el = el.parentElement;\n opts = el && getTooltipOpts(el);\n }\n\n opts && tlite.show(el, opts, true);\n });\n}\n\ntlite.show = function (el, opts, isAuto) {\n var fallbackAttrib = 'data-tlite';\n opts = opts || {};\n\n (el.tooltip || Tooltip(el, opts)).show();\n\n function Tooltip(el, opts) {\n var tooltipEl;\n var showTimer;\n var text;\n\n el.addEventListener('mousedown', autoHide);\n el.addEventListener('mouseleave', autoHide);\n\n function show() {\n text = el.title || el.getAttribute(fallbackAttrib) || text;\n el.title = '';\n el.setAttribute(fallbackAttrib, '');\n text && !showTimer && (showTimer = setTimeout(fadeIn, isAuto ? 150 : 1))\n }\n\n function autoHide() {\n tlite.hide(el, true);\n }\n\n function hide(isAutoHiding) {\n if (isAuto === isAutoHiding) {\n showTimer = clearTimeout(showTimer);\n var parent = tooltipEl && tooltipEl.parentNode;\n parent && parent.removeChild(tooltipEl);\n tooltipEl = undefined;\n }\n }\n\n function fadeIn() {\n if (!tooltipEl) {\n tooltipEl = createTooltip(el, text, opts);\n }\n }\n\n return el.tooltip = {\n show: show,\n hide: hide\n };\n }\n\n function createTooltip(el, text, opts) {\n var tooltipEl = document.createElement('span');\n var grav = opts.grav || el.getAttribute('data-tlite') || 'n';\n\n tooltipEl.innerHTML = text;\n\n el.appendChild(tooltipEl);\n\n var vertGrav = grav[0] || '';\n var horzGrav = grav[1] || '';\n\n function positionTooltip() {\n tooltipEl.className = 'tlite ' + 'tlite-' + vertGrav + horzGrav;\n\n var arrowSize = 10;\n var top = el.offsetTop;\n var left = el.offsetLeft;\n\n if (tooltipEl.offsetParent === el) {\n top = left = 0;\n }\n\n var width = el.offsetWidth;\n var height = el.offsetHeight;\n var tooltipHeight = tooltipEl.offsetHeight;\n var tooltipWidth = tooltipEl.offsetWidth;\n var centerEl = left + (width / 2);\n\n tooltipEl.style.top = (\n vertGrav === 's' ? (top - tooltipHeight - arrowSize) :\n vertGrav === 'n' ? (top + height + arrowSize) :\n (top + (height / 2) - (tooltipHeight / 2))\n ) + 'px';\n\n tooltipEl.style.left = (\n horzGrav === 'w' ? left :\n horzGrav === 'e' ? left + width - tooltipWidth :\n vertGrav === 'w' ? (left + width + arrowSize) :\n vertGrav === 'e' ? (left - tooltipWidth - arrowSize) :\n (centerEl - tooltipWidth / 2)\n ) + 'px';\n }\n\n positionTooltip();\n\n var rect = tooltipEl.getBoundingClientRect();\n\n if (vertGrav === 's' && rect.top < 0) {\n vertGrav = 'n';\n positionTooltip();\n } else if (vertGrav === 'n' && rect.bottom > window.innerHeight) {\n vertGrav = 's';\n positionTooltip();\n } else if (vertGrav === 'e' && rect.left < 0) {\n vertGrav = 'w';\n positionTooltip();\n } else if (vertGrav === 'w' && rect.right > window.innerWidth) {\n vertGrav = 'e';\n positionTooltip();\n }\n\n tooltipEl.className += ' tlite-visible';\n\n return tooltipEl;\n }\n};\n\ntlite.hide = function (el, isAuto) {\n el.tooltip && el.tooltip.hide(isAuto);\n};\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = tlite;\n}\n\n},{}],12:[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 })();"]}
assets/js/forms-api.js CHANGED
@@ -40,23 +40,23 @@ function handleFormRequest(form, eventName, errors, data) {
40
 
41
  window.addEventListener('load', function () {
42
  // trigger events
43
- forms.trigger('submitted', [form]);
44
  forms.trigger(form.id + '.submitted', [form]);
 
45
 
46
  if (errors) {
47
- forms.trigger('error', [form, errors]);
48
  forms.trigger(form.id + '.error', [form, errors]);
 
49
  } else {
50
  // form was successfully submitted
51
- forms.trigger('success', [form, data]);
52
- forms.trigger(form.id + '.success', [form, data]); // subscribed / unsubscribed
53
 
54
- forms.trigger(eventName, [form, data]);
55
- forms.trigger(form.id + "." + eventName, [form, data]); // for BC: always trigger "subscribed" event when firing "updated_subscriber" event
56
 
57
  if (eventName === 'updated_subscriber') {
58
- forms.trigger('subscribed', [form, data, true]);
59
  forms.trigger(form.id + "." + "subscribed", [form, data, true]);
 
60
  }
61
  } // scroll to form again if page height changed since last scroll, eg because of slow loading images
62
  // (only if load didn't take more than 0.8 seconds to prevent overtaking user scroll)
@@ -64,7 +64,7 @@ function handleFormRequest(form, eventName, errors, data) {
64
 
65
  var timeElapsed = Date.now() - timeStart;
66
 
67
- if (config.auto_scroll && timeElapsed > 1000 && timeElapsed < 2000 && document.body.clientHeight != pageHeight) {
68
  scrollToForm(form);
69
  }
70
  });
@@ -73,15 +73,21 @@ function handleFormRequest(form, eventName, errors, data) {
73
 
74
  Gator(document.body).on('submit', '.mc4wp-form', function (event) {
75
  var form = forms.getByElement(event.target || event.srcElement);
76
- forms.trigger('submit', [form, event]);
77
- forms.trigger(form.id + '.submit', [form, event]);
 
 
 
 
 
 
78
  });
79
  Gator(document.body).on('focus', '.mc4wp-form', function (event) {
80
  var form = forms.getByElement(event.target || event.srcElement);
81
 
82
  if (!form.started) {
83
- forms.trigger('started', [form, event]);
84
  forms.trigger(form.id + '.started', [form, event]);
 
85
  form.started = true;
86
  }
87
  });
@@ -291,9 +297,10 @@ var forms = []; // get form by its id
291
  // please note that this will get the FIRST occurence of the form with that ID on the page
292
 
293
  function get(formId) {
294
- // do we have form for this one already?
 
295
  for (var i = 0; i < forms.length; i++) {
296
- if (forms[i].id == formId) {
297
  return forms[i];
298
  }
299
  } // try to create from first occurence of this element
@@ -308,7 +315,7 @@ function getByElement(element) {
308
  var formElement = element.form || element;
309
 
310
  for (var i = 0; i < forms.length; i++) {
311
- if (forms[i].element == formElement) {
312
  return forms[i];
313
  }
314
  }
@@ -329,9 +336,8 @@ function all() {
329
  }
330
 
331
  function triggerEvent(eventName, eventArgs) {
332
- if (eventName === 'submit') {
333
  // don't spin up new thread for submit event as we want to preventDefault()...
334
- // TODO: Fix that in Premium.
335
  events.trigger(eventName, eventArgs);
336
  } else {
337
  // process in separate thread to prevent errors from breaking core functionality
40
 
41
  window.addEventListener('load', function () {
42
  // trigger events
 
43
  forms.trigger(form.id + '.submitted', [form]);
44
+ forms.trigger('submitted', [form]);
45
 
46
  if (errors) {
 
47
  forms.trigger(form.id + '.error', [form, errors]);
48
+ forms.trigger('error', [form, errors]);
49
  } else {
50
  // form was successfully submitted
51
+ forms.trigger(form.id + '.success', [form, data]);
52
+ forms.trigger('success', [form, data]); // subscribed / unsubscribed
53
 
54
+ forms.trigger(form.id + "." + eventName, [form, data]);
55
+ forms.trigger(eventName, [form, data]); // for BC: always trigger "subscribed" event when firing "updated_subscriber" event
56
 
57
  if (eventName === 'updated_subscriber') {
 
58
  forms.trigger(form.id + "." + "subscribed", [form, data, true]);
59
+ forms.trigger('subscribed', [form, data, true]);
60
  }
61
  } // scroll to form again if page height changed since last scroll, eg because of slow loading images
62
  // (only if load didn't take more than 0.8 seconds to prevent overtaking user scroll)
64
 
65
  var timeElapsed = Date.now() - timeStart;
66
 
67
+ if (config.auto_scroll && timeElapsed > 1000 && timeElapsed < 2000 && document.body.clientHeight !== pageHeight) {
68
  scrollToForm(form);
69
  }
70
  });
73
 
74
  Gator(document.body).on('submit', '.mc4wp-form', function (event) {
75
  var form = forms.getByElement(event.target || event.srcElement);
76
+
77
+ if (!event.defaultPrevented) {
78
+ forms.trigger(form.id + '.submit', [form, event]);
79
+ }
80
+
81
+ if (!event.defaultPrevented) {
82
+ forms.trigger('submit', [form, event]);
83
+ }
84
  });
85
  Gator(document.body).on('focus', '.mc4wp-form', function (event) {
86
  var form = forms.getByElement(event.target || event.srcElement);
87
 
88
  if (!form.started) {
 
89
  forms.trigger(form.id + '.started', [form, event]);
90
+ forms.trigger('started', [form, event]);
91
  form.started = true;
92
  }
93
  });
297
  // please note that this will get the FIRST occurence of the form with that ID on the page
298
 
299
  function get(formId) {
300
+ formId = parseInt(formId); // do we have form for this one already?
301
+
302
  for (var i = 0; i < forms.length; i++) {
303
+ if (forms[i].id === formId) {
304
  return forms[i];
305
  }
306
  } // try to create from first occurence of this element
315
  var formElement = element.form || element;
316
 
317
  for (var i = 0; i < forms.length; i++) {
318
+ if (forms[i].element === formElement) {
319
  return forms[i];
320
  }
321
  }
336
  }
337
 
338
  function triggerEvent(eventName, eventArgs) {
339
+ if (eventName === 'submit' || eventName.indexOf('.submit') > 0) {
340
  // don't spin up new thread for submit event as we want to preventDefault()...
 
341
  events.trigger(eventName, eventArgs);
342
  } else {
343
  // process in separate thread to prevent errors from breaking core functionality
assets/js/forms-api.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var s=void 0;!function o(u,s,a){function c(e,t){if(!s[e]){if(!u[e]){var n=!1;if(!t&&n)return n(e,!0);if(f)return f(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var i=s[e]={exports:{}};u[e][0].call(i.exports,function(t){return c(u[e][1][t]||t)},i,i.exports,o,u,s,a)}return s[e].exports}for(var f=!1,t=0;t<a.length;t++)c(a[t]);return c}({1:[function(t,e,n){"use strict";var r,i=(r=t("./forms/conditional-elements.js"))&&r.__esModule?r:{default:r};var o,u,s,a,c,f,l=window.mc4wp||{},h=t("gator"),d=t("./forms/forms.js"),p=window.mc4wp_forms_config||{},m=t("scroll-to-element");function v(t){var e="animated"===p.auto_scroll;m(t.element,{duration:e?800:1,alignment:"middle"})}if(h(document.body).on("submit",".mc4wp-form",function(t){var e=d.getByElement(t.target||t.srcElement);d.trigger("submit",[e,t]),d.trigger(e.id+".submit",[e,t])}),h(document.body).on("focus",".mc4wp-form",function(t){var e=d.getByElement(t.target||t.srcElement);e.started||(d.trigger("started",[e,t]),d.trigger(e.id+".started",[e,t]),e.started=!0)}),h(document.body).on("change",".mc4wp-form",function(t){var e=d.getByElement(t.target||t.srcElement);d.trigger("change",[e,t]),d.trigger(e.id+".change",[e,t])}),i.default.init(),l.listeners){for(var g=l.listeners,y=0;y<g.length;y++)d.on(g[y].event,g[y].callback);delete l.listeners}if(l.forms=d,p.submitted_form){var w=p.submitted_form,b=document.getElementById(w.element_id),_=d.getByElement(b);o=_,u=w.event,s=w.errors,a=w.data,c=Date.now(),f=document.body.clientHeight,s&&o.setData(a),window.scrollY<=10&&p.auto_scroll&&v(o),window.addEventListener("load",function(){d.trigger("submitted",[o]),d.trigger(o.id+".submitted",[o]),s?(d.trigger("error",[o,s]),d.trigger(o.id+".error",[o,s])):(d.trigger("success",[o,a]),d.trigger(o.id+".success",[o,a]),d.trigger(u,[o,a]),d.trigger(o.id+"."+u,[o,a]),"updated_subscriber"===u&&(d.trigger("subscribed",[o,a,!0]),d.trigger(o.id+".subscribed",[o,a,!0])));var t=Date.now()-c;p.auto_scroll&&1e3<t&&t<2e3&&document.body.clientHeight!=f&&v(o)})}window.mc4wp=l},{"./forms/conditional-elements.js":2,"./forms/forms.js":4,gator:6,"scroll-to-element":13}],2:[function(t,e,n){"use strict";function r(t){for(var e=!!t.getAttribute("data-show-if"),n=e?t.getAttribute("data-show-if").split(":"):t.getAttribute("data-hide-if").split(":"),r=n[0],i=(1<n.length?n[1]:"*").split("|"),o=function(t,e){for(var n=[],r=t.querySelectorAll('input[name="'+e+'"], select[name="'+e+'"], textarea[name="'+e+'"]'),i=0;i<r.length;i++){var o=r[i],u=o.getAttribute("type");("radio"!==u&&"checkbox"!==u||o.checked)&&n.push(o.value)}return n}(function(t){for(var e=t;e.parentElement;)if("FORM"===(e=e.parentElement).tagName)return e;return null}(t),r),u=!1,s=0;s<o.length;s++){var a=o[s];if(u=-1<i.indexOf(a)||-1<i.indexOf("*")&&0<a.length)break}t.style.display=e?u?"":"none":u?"none":"";var c=t.querySelectorAll("input, select, textarea");[].forEach.call(c,function(t){(u||e)&&t.getAttribute("data-was-required")&&(t.required=!0,t.removeAttribute("data-was-required")),u&&e||!t.required||(t.setAttribute("data-was-required","true"),t.required=!1)})}function i(){var t=document.querySelectorAll(".mc4wp-form [data-show-if], .mc4wp-form [data-hide-if]");[].forEach.call(t,r)}function o(t){if(t.target&&t.target.form&&!(t.target.form.className.indexOf("mc4wp-form")<0)){var e=t.target.form.querySelectorAll("[data-show-if], [data-hide-if]");[].forEach.call(e,r)}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var u={init:function(){document.addEventListener("keyup",o,!0),document.addEventListener("change",o,!0),document.addEventListener("mc4wp-refresh",i,!0),window.addEventListener("load",i),i()}};n.default=u},{}],3:[function(t,e,n){"use strict";var r=t("form-serialize"),i=t("populate.js"),o=function(t,e){this.id=t,this.element=e||document.createElement("form"),this.name=this.element.getAttribute("data-name")||"Form #"+this.id,this.errors=[],this.started=!1};o.prototype.setData=function(t){try{i(this.element,t)}catch(t){console.error(t)}},o.prototype.getData=function(){return r(this.element,{hash:!0,empty:!0})},o.prototype.getSerializedData=function(){return r(this.element,{hash:!1,empty:!0})},o.prototype.setResponse=function(t){this.element.querySelector(".mc4wp-response").innerHTML=t},o.prototype.reset=function(){this.setResponse(""),this.element.querySelector(".mc4wp-form-fields").style.display="",this.element.reset()},e.exports=o},{"form-serialize":5,"populate.js":7}],4:[function(t,e,n){"use strict";var r=t("wolfy87-eventemitter"),i=t("./form.js"),o=new r,u=[];function s(t,e){e=e||parseInt(t.getAttribute("data-id"))||0;var n=new i(e,t);return u.push(n),n}e.exports={all:function(){return u},get:function(t){for(var e=0;e<u.length;e++)if(u[e].id==t)return u[e];return s(document.querySelector(".mc4wp-form-"+t),t)},getByElement:function(t){for(var e=t.form||t,n=0;n<u.length;n++)if(u[n].element==e)return u[n];return s(e)},on:o.on.bind(o),trigger:function(t,e){"submit"===t?o.trigger(t,e):window.setTimeout(function(){o.trigger(t,e)},1)},off:o.off.bind(o)}},{"./form.js":3,"wolfy87-eventemitter":16}],5:[function(t,e,n){var v=/^(?:submit|button|image|reset|file)$/i,g=/^(?:input|select|textarea|keygen)/i,i=/(\[[^\[\]]*\])/g;function y(t,e,n){if(e.match(i)){!function t(e,n,r){if(0===n.length)return e=r;var i=n.shift(),o=i.match(/^\[(.+?)\]$/);if("[]"===i)return e=e||[],Array.isArray(e)?e.push(t(null,n,r)):(e._values=e._values||[],e._values.push(t(null,n,r))),e;if(o){var u=o[1],s=+u;isNaN(s)?(e=e||{})[u]=t(e[u],n,r):(e=e||[])[s]=t(e[s],n,r)}else e[i]=t(e[i],n,r);return e}(t,function(t){var e=[],n=new RegExp(i),r=/^([^\[\]]*)/.exec(t);for(r[1]&&e.push(r[1]);null!==(r=n.exec(t));)e.push(r[1]);return e}(e),n)}else{var r=t[e];r?(Array.isArray(r)||(t[e]=[r]),t[e].push(n)):t[e]=n}return t}function w(t,e,n){return n=n.replace(/(\r)?\n/g,"\r\n"),n=(n=encodeURIComponent(n)).replace(/%20/g,"+"),t+(t?"&":"")+encodeURIComponent(e)+"="+n}e.exports=function(t,e){"object"!=typeof e?e={hash:!!e}:void 0===e.hash&&(e.hash=!0);for(var n=e.hash?{}:"",r=e.serializer||(e.hash?y:w),i=t&&t.elements?t.elements:[],o=Object.create(null),u=0;u<i.length;++u){var s=i[u];if((e.disabled||!s.disabled)&&s.name&&g.test(s.nodeName)&&!v.test(s.type)){var a=s.name,c=s.value;if("checkbox"!==s.type&&"radio"!==s.type||s.checked||(c=void 0),e.empty){if("checkbox"!==s.type||s.checked||(c=""),"radio"===s.type&&(o[s.name]||s.checked?s.checked&&(o[s.name]=!0):o[s.name]=!1),null==c&&"radio"==s.type)continue}else if(!c)continue;if("select-multiple"!==s.type)n=r(n,a,c);else{c=[];for(var f=s.options,l=!1,h=0;h<f.length;++h){var d=f[h],p=e.empty&&!d.value,m=d.value||p;d.selected&&m&&(l=!0,n=e.hash&&"[]"!==a.slice(a.length-2)?r(n,a+"[]",d.value):r(n,a,d.value))}!l&&e.empty&&(n=r(n,a,""))}}}if(e.empty)for(var a in o)o[a]||(n=r(n,a,""));return n}},{}],6:[function(t,e,n){!function(){var i,l=0,r=0,h={},d={};function p(t,e,n){return"_root"==e?n:t!==n?(r=t,i||(i=r.matches?r.matches:r.webkitMatchesSelector?r.webkitMatchesSelector:r.mozMatchesSelector?r.mozMatchesSelector:r.msMatchesSelector?r.msMatchesSelector:r.oMatchesSelector?r.oMatchesSelector:v.matchesSelector)).call(t,e)?t:t.parentNode?(l++,p(t.parentNode,e,n)):void 0:void 0;var r}function m(t,e,n,r){if(h[t.id])if(e)if(r||n)if(r){if(h[t.id][e][n])for(var i=0;i<h[t.id][e][n].length;i++)if(h[t.id][e][n][i]===r){h[t.id][e][n].splice(i,1);break}}else delete h[t.id][e][n];else h[t.id][e]={};else for(var o in h[t.id])h[t.id].hasOwnProperty(o)&&(h[t.id][o]={})}function o(t,e,n,r){if(this.element){t instanceof Array||(t=[t]),n||"function"!=typeof e||(n=e,e="_root");var i,o,u,s,a,c=this.id;for(i=0;i<t.length;i++)r?m(this,t[i],e,n):(h[c]&&h[c][t[i]]||v.addEvent(this,t[i],f(t[i])),o=this,u=t[i],s=e,a=n,h[o.id]||(h[o.id]={}),h[o.id][u]||(h[o.id][u]={}),h[o.id][u][s]||(h[o.id][u][s]=[]),h[o.id][u][s].push(a));return this}function f(e){return function(t){!function(t,e,n){if(h[t][n]){var r,i,o=e.target||e.srcElement,u={},s=0,a=0;for(r in l=0,h[t][n])h[t][n].hasOwnProperty(r)&&(i=p(o,r,d[t].element))&&v.matchesEvent(n,d[t].element,i,"_root"==r,e)&&(l++,h[t][n][r].match=i,u[l]=h[t][n][r]);for(e.stopPropagation=function(){e.cancelBubble=!0},s=0;s<=l;s++)if(u[s])for(a=0;a<u[s].length;a++){if(!1===u[s][a].call(u[s].match,e))return v.cancel(e);if(e.cancelBubble)return}}}(c,t,e)}}}function v(t,e){if(!(this instanceof v)){for(var n in d)if(d[n].element===t)return d[n];return d[++r]=new v(t,r),d[r]}this.element=t,this.id=e}v.prototype.on=function(t,e,n){return o.call(this,t,e,n)},v.prototype.off=function(t,e,n){return o.call(this,t,e,n,!0)},v.matchesSelector=function(){},v.cancel=function(t){t.preventDefault(),t.stopPropagation()},v.addEvent=function(t,e,n){var r="blur"==e||"focus"==e;t.element.addEventListener(e,n,r)},v.matchesEvent=function(){return!0},void 0!==e&&e.exports&&(e.exports=v),window.Gator=v}()},{}],7:[function(t,e,n){var r,f;r=this,f=function(t,e,n){for(var r in e)if(e.hasOwnProperty(r)){var i=r,o=e[r];if(void 0===o&&(o=""),null===o&&(o=""),void 0!==n&&(i=n+"["+r+"]"),o.constructor===Array)i+="[]";else if("object"==typeof o){f(t,o,i);continue}var u=t.elements.namedItem(i);if(u)switch(u.type||u[0].type){default:u.value=o;break;case"radio":case"checkbox":for(var s=0;s<u.length;s++)u[s].checked=-1<o.indexOf(u[s].value);break;case"select-multiple":for(var a=o.constructor==Array?o:[o],c=0;c<u.options.length;c++)u.options[c].selected|=-1<a.indexOf(u.options[c].value);break;case"select":case"select-one":u.value=o.toString()||o;break;case"date":u.value=new Date(o).toISOString().split("T")[0]}}},"function"==typeof s&&"object"==typeof s.amd&&s.amd?s(function(){return f}):void 0!==e&&e.exports?e.exports=f:r.populate=f},{}],8:[function(t,e,n){var r,i,o=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var c,f=[],l=!1,h=-1;function d(){l&&c&&(l=!1,c.length?f=c.concat(f):h=-1,f.length&&p())}function p(){if(!l){var t=a(d);l=!0;for(var e=f.length;e;){for(c=f,f=[];++h<e;)c&&c[h].run();h=-1,e=f.length}c=null,l=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function v(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];f.push(new m(t,e)),1!==f.length||l||a(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],9:[function(l,h,t){(function(t){for(var r=l("performance-now"),e="undefined"==typeof window?t:window,n=["moz","webkit"],i="AnimationFrame",o=e["request"+i],u=e["cancel"+i]||e["cancelRequest"+i],s=0;!o&&s<n.length;s++)o=e[n[s]+"Request"+i],u=e[n[s]+"Cancel"+i]||e[n[s]+"CancelRequest"+i];if(!o||!u){var a=0,c=0,f=[];o=function(t){if(0===f.length){var e=r(),n=Math.max(0,1e3/60-(e-a));a=n+e,setTimeout(function(){for(var t=f.slice(0),e=f.length=0;e<t.length;e++)if(!t[e].cancelled)try{t[e].callback(a)}catch(t){setTimeout(function(){throw t},0)}},Math.round(n))}return f.push({handle:++c,callback:t,cancelled:!1}),c},u=function(t){for(var e=0;e<f.length;e++)f[e].handle===t&&(f[e].cancelled=!0)}}h.exports=function(t){return o.call(e,t)},h.exports.cancel=function(){u.apply(e,arguments)},h.exports.polyfill=function(t){t||(t=e),t.requestAnimationFrame=o,t.cancelAnimationFrame=u}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"performance-now":10}],10:[function(t,s,e){(function(u){(function(){var t,e,n,r,i,o;"undefined"!=typeof performance&&null!==performance&&performance.now?s.exports=function(){return performance.now()}:null!=u&&u.hrtime?(s.exports=function(){return(t()-i)/1e6},e=u.hrtime,r=(t=function(){var t;return 1e9*(t=e())[0]+t[1]})(),o=1e9*u.uptime(),i=r-o):n=Date.now?(s.exports=function(){return Date.now()-n},Date.now()):(s.exports=function(){return(new Date).getTime()-n},(new Date).getTime())}).call(this)}).call(this,t("_process"))},{_process:8}],11:[function(t,e,n){n.linear=function(t){return t},n.inQuad=function(t){return t*t},n.outQuad=function(t){return t*(2-t)},n.inOutQuad=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},n.inCube=function(t){return t*t*t},n.outCube=function(t){return--t*t*t+1},n.inOutCube=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},n.inQuart=function(t){return t*t*t*t},n.outQuart=function(t){return 1- --t*t*t*t},n.inOutQuart=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},n.inQuint=function(t){return t*t*t*t*t},n.outQuint=function(t){return--t*t*t*t*t+1},n.inOutQuint=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},n.inSine=function(t){return 1-Math.cos(t*Math.PI/2)},n.outSine=function(t){return Math.sin(t*Math.PI/2)},n.inOutSine=function(t){return.5*(1-Math.cos(Math.PI*t))},n.inExpo=function(t){return 0==t?0:Math.pow(1024,t-1)},n.outExpo=function(t){return 1==t?t:1-Math.pow(2,-10*t)},n.inOutExpo=function(t){return 0==t?0:1==t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},n.inCirc=function(t){return 1-Math.sqrt(1-t*t)},n.outCirc=function(t){return Math.sqrt(1- --t*t)},n.inOutCirc=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},n.inBack=function(t){return t*t*(2.70158*t-1.70158)},n.outBack=function(t){return--t*t*(2.70158*t+1.70158)+1},n.inOutBack=function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},n.inBounce=function(t){return 1-n.outBounce(1-t)},n.outBounce=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},n.inOutBounce=function(t){return t<.5?.5*n.inBounce(2*t):.5*n.outBounce(2*t-1)+.5},n.inElastic=function(t){var e,n=.1;return 0===t?0:1===t?1:(e=!n||n<1?(n=1,.1):.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},n.outElastic=function(t){var e,n=.1;return 0===t?0:1===t?1:(e=!n||n<1?(n=1,.1):.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},n.inOutElastic=function(t){var e,n=.1;return 0===t?0:1===t?1:(e=!n||n<1?(n=1,.1):.4*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},n["in-quad"]=n.inQuad,n["out-quad"]=n.outQuad,n["in-out-quad"]=n.inOutQuad,n["in-cube"]=n.inCube,n["out-cube"]=n.outCube,n["in-out-cube"]=n.inOutCube,n["in-quart"]=n.inQuart,n["out-quart"]=n.outQuart,n["in-out-quart"]=n.inOutQuart,n["in-quint"]=n.inQuint,n["out-quint"]=n.outQuint,n["in-out-quint"]=n.inOutQuint,n["in-sine"]=n.inSine,n["out-sine"]=n.outSine,n["in-out-sine"]=n.inOutSine,n["in-expo"]=n.inExpo,n["out-expo"]=n.outExpo,n["in-out-expo"]=n.inOutExpo,n["in-circ"]=n.inCirc,n["out-circ"]=n.outCirc,n["in-out-circ"]=n.inOutCirc,n["in-back"]=n.inBack,n["out-back"]=n.outBack,n["in-out-back"]=n.inOutBack,n["in-bounce"]=n.inBounce,n["out-bounce"]=n.outBounce,n["in-out-bounce"]=n.inOutBounce,n["in-elastic"]=n.inElastic,n["out-elastic"]=n.outElastic,n["in-out-elastic"]=n.inOutElastic},{}],12:[function(t,e,n){function r(t){if(t)return function(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}(t)}r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<r.length;i++)if((n=r[i])===e||n.fn===e){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks["$"+t];if(n)for(var r=0,i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,e);return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length},void 0!==e&&(e.exports=r)},{}],13:[function(t,e,n){var r=t("./scroll-to");e.exports=function(t,e){if(e=e||{},"string"==typeof t&&(t=document.querySelector(t)),t)return r(0,function(t,e,n){var r,i=document.body,o=document.documentElement,u=t.getBoundingClientRect(),s=o.clientHeight,a=Math.max(i.scrollHeight,i.offsetHeight,o.clientHeight,o.scrollHeight,o.offsetHeight);e=e||0,r="bottom"===n?u.bottom-s:"middle"===n?u.bottom-s/2-u.height/2:u.top;var c=a-s;return Math.min(r+e+window.pageYOffset,c)}(t,e.offset,e.align),e)}},{"./scroll-to":14}],14:[function(t,e,n){var u=t("./tween"),s=t("raf");e.exports=function(t,e,n){n=n||{};var r={top:window.pageYOffset||document.documentElement.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft},i=u(r).ease(n.ease||"out-circ").to({top:e,left:t}).duration(n.duration||1e3);function o(){s(o),i.update()}return i.update(function(t){window.scrollTo(0|t.left,0|t.top)}),i.on("end",function(){o=function(){}}),o(),i}},{"./tween":15,raf:9}],15:[function(t,e,n){var r=t("./ease");function i(t){if(!(this instanceof i))return new i(t);this._from=t,this.ease("linear"),this.duration(500)}t("./emitter")(i.prototype),i.prototype.reset=function(){return this.isArray="[object Array]"===Object.prototype.toString.call(this._from),this._curr=Object.assign({},this._from),this._done=!1,this._start=Date.now(),this},i.prototype.to=function(t){return this.reset(),this._to=t,this},i.prototype.duration=function(t){return this._duration=t,this},i.prototype.ease=function(t){if(!(t="function"==typeof t?t:r[t]))throw new TypeError("invalid easing function");return this._ease=t,this},i.prototype.stop=function(){return this.stopped=!0,this._done=!0,this.emit("stop"),this.emit("end"),this},i.prototype.step=function(){if(!this._done){var t=this._duration,e=Date.now();if(t<=e-this._start)return this._from=this._to,this._update(this._to),this._done=!0,this.emit("end"),this;var n=this._from,r=this._to,i=this._curr,o=(0,this._ease)((e-this._start)/t);if(this.isArray){for(var u=0;u<n.length;++u)i[u]=n[u]+(r[u]-n[u])*o;return this._update(i),this}for(var s in n)i[s]=n[s]+(r[s]-n[s])*o;return this._update(i),this}},i.prototype.update=function(t){return 0==arguments.length?this.step():(this._update=t,this)},e.exports=i},{"./ease":11,"./emitter":12}],16:[function(t,u,e){!function(t){"use strict";function e(){}var n=e.prototype,r=t.EventEmitter;function o(t,e){for(var n=t.length;n--;)if(t[n].listener===e)return n;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}n.getListeners=function(t){var e,n,r=this._getEvents();if(t instanceof RegExp)for(n in e={},r)r.hasOwnProperty(n)&&t.test(n)&&(e[n]=r[n]);else e=r[t]||(r[t]=[]);return e},n.flattenListeners=function(t){var e,n=[];for(e=0;e<t.length;e+=1)n.push(t[e].listener);return n},n.getListenersAsObject=function(t){var e,n=this.getListeners(t);return n instanceof Array&&((e={})[t]=n),e||n},n.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 n,r=this.getListenersAsObject(t),i="object"==typeof e;for(n in r)r.hasOwnProperty(n)&&-1===o(r[n],e)&&r[n].push(i?e:{listener:e,once:!1});return this},n.on=i("addListener"),n.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},n.once=i("addOnceListener"),n.defineEvent=function(t){return this.getListeners(t),this},n.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},n.removeListener=function(t,e){var n,r,i=this.getListenersAsObject(t);for(r in i)i.hasOwnProperty(r)&&-1!==(n=o(i[r],e))&&i[r].splice(n,1);return this},n.off=i("removeListener"),n.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},n.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},n.manipulateListeners=function(t,e,n){var r,i,o=t?this.removeListener:this.addListener,u=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(r=n.length;r--;)o.call(this,e,n[r]);else for(r in e)e.hasOwnProperty(r)&&(i=e[r])&&("function"==typeof i?o.call(this,r,i):u.call(this,r,i));return this},n.removeEvent=function(t){var e,n=typeof t,r=this._getEvents();if("string"===n)delete r[t];else if(t instanceof RegExp)for(e in r)r.hasOwnProperty(e)&&t.test(e)&&delete r[e];else delete this._events;return this},n.removeAllListeners=i("removeEvent"),n.emitEvent=function(t,e){var n,r,i,o,u=this.getListenersAsObject(t);for(o in u)if(u.hasOwnProperty(o))for(n=u[o].slice(0),i=0;i<n.length;i++)!0===(r=n[i]).once&&this.removeListener(t,r.listener),r.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,r.listener);return this},n.trigger=i("emitEvent"),n.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},n.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},n._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},n._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return t.EventEmitter=r,e},"function"==typeof s&&s.amd?s(function(){return e}):"object"==typeof u&&u.exports?u.exports=e:t.EventEmitter=e}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=forms-api.min.js.map
1
+ !function(){var s=void 0;!function o(u,s,a){function c(e,t){if(!s[e]){if(!u[e]){var n=!1;if(!t&&n)return n(e,!0);if(f)return f(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var i=s[e]={exports:{}};u[e][0].call(i.exports,function(t){return c(u[e][1][t]||t)},i,i.exports,o,u,s,a)}return s[e].exports}for(var f=!1,t=0;t<a.length;t++)c(a[t]);return c}({1:[function(t,e,n){"use strict";var r,i=(r=t("./forms/conditional-elements.js"))&&r.__esModule?r:{default:r};var o,u,s,a,c,f,l=window.mc4wp||{},h=t("gator"),d=t("./forms/forms.js"),p=window.mc4wp_forms_config||{},m=t("scroll-to-element");function v(t){var e="animated"===p.auto_scroll;m(t.element,{duration:e?800:1,alignment:"middle"})}if(h(document.body).on("submit",".mc4wp-form",function(t){var e=d.getByElement(t.target||t.srcElement);t.defaultPrevented||d.trigger(e.id+".submit",[e,t]),t.defaultPrevented||d.trigger("submit",[e,t])}),h(document.body).on("focus",".mc4wp-form",function(t){var e=d.getByElement(t.target||t.srcElement);e.started||(d.trigger(e.id+".started",[e,t]),d.trigger("started",[e,t]),e.started=!0)}),h(document.body).on("change",".mc4wp-form",function(t){var e=d.getByElement(t.target||t.srcElement);d.trigger("change",[e,t]),d.trigger(e.id+".change",[e,t])}),i.default.init(),l.listeners){for(var g=l.listeners,y=0;y<g.length;y++)d.on(g[y].event,g[y].callback);delete l.listeners}if(l.forms=d,p.submitted_form){var w=p.submitted_form,b=document.getElementById(w.element_id),_=d.getByElement(b);o=_,u=w.event,s=w.errors,a=w.data,c=Date.now(),f=document.body.clientHeight,s&&o.setData(a),window.scrollY<=10&&p.auto_scroll&&v(o),window.addEventListener("load",function(){d.trigger(o.id+".submitted",[o]),d.trigger("submitted",[o]),s?(d.trigger(o.id+".error",[o,s]),d.trigger("error",[o,s])):(d.trigger(o.id+".success",[o,a]),d.trigger("success",[o,a]),d.trigger(o.id+"."+u,[o,a]),d.trigger(u,[o,a]),"updated_subscriber"===u&&(d.trigger(o.id+".subscribed",[o,a,!0]),d.trigger("subscribed",[o,a,!0])));var t=Date.now()-c;p.auto_scroll&&1e3<t&&t<2e3&&document.body.clientHeight!==f&&v(o)})}window.mc4wp=l},{"./forms/conditional-elements.js":2,"./forms/forms.js":4,gator:6,"scroll-to-element":13}],2:[function(t,e,n){"use strict";function r(t){for(var e=!!t.getAttribute("data-show-if"),n=e?t.getAttribute("data-show-if").split(":"):t.getAttribute("data-hide-if").split(":"),r=n[0],i=(1<n.length?n[1]:"*").split("|"),o=function(t,e){for(var n=[],r=t.querySelectorAll('input[name="'+e+'"], select[name="'+e+'"], textarea[name="'+e+'"]'),i=0;i<r.length;i++){var o=r[i],u=o.getAttribute("type");("radio"!==u&&"checkbox"!==u||o.checked)&&n.push(o.value)}return n}(function(t){for(var e=t;e.parentElement;)if("FORM"===(e=e.parentElement).tagName)return e;return null}(t),r),u=!1,s=0;s<o.length;s++){var a=o[s];if(u=-1<i.indexOf(a)||-1<i.indexOf("*")&&0<a.length)break}t.style.display=e?u?"":"none":u?"none":"";var c=t.querySelectorAll("input, select, textarea");[].forEach.call(c,function(t){(u||e)&&t.getAttribute("data-was-required")&&(t.required=!0,t.removeAttribute("data-was-required")),u&&e||!t.required||(t.setAttribute("data-was-required","true"),t.required=!1)})}function i(){var t=document.querySelectorAll(".mc4wp-form [data-show-if], .mc4wp-form [data-hide-if]");[].forEach.call(t,r)}function o(t){if(t.target&&t.target.form&&!(t.target.form.className.indexOf("mc4wp-form")<0)){var e=t.target.form.querySelectorAll("[data-show-if], [data-hide-if]");[].forEach.call(e,r)}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var u={init:function(){document.addEventListener("keyup",o,!0),document.addEventListener("change",o,!0),document.addEventListener("mc4wp-refresh",i,!0),window.addEventListener("load",i),i()}};n.default=u},{}],3:[function(t,e,n){"use strict";var r=t("form-serialize"),i=t("populate.js"),o=function(t,e){this.id=t,this.element=e||document.createElement("form"),this.name=this.element.getAttribute("data-name")||"Form #"+this.id,this.errors=[],this.started=!1};o.prototype.setData=function(t){try{i(this.element,t)}catch(t){console.error(t)}},o.prototype.getData=function(){return r(this.element,{hash:!0,empty:!0})},o.prototype.getSerializedData=function(){return r(this.element,{hash:!1,empty:!0})},o.prototype.setResponse=function(t){this.element.querySelector(".mc4wp-response").innerHTML=t},o.prototype.reset=function(){this.setResponse(""),this.element.querySelector(".mc4wp-form-fields").style.display="",this.element.reset()},e.exports=o},{"form-serialize":5,"populate.js":7}],4:[function(t,e,n){"use strict";var r=t("wolfy87-eventemitter"),i=t("./form.js"),o=new r,u=[];function s(t,e){e=e||parseInt(t.getAttribute("data-id"))||0;var n=new i(e,t);return u.push(n),n}e.exports={all:function(){return u},get:function(t){t=parseInt(t);for(var e=0;e<u.length;e++)if(u[e].id===t)return u[e];return s(document.querySelector(".mc4wp-form-"+t),t)},getByElement:function(t){for(var e=t.form||t,n=0;n<u.length;n++)if(u[n].element===e)return u[n];return s(e)},on:o.on.bind(o),trigger:function(t,e){"submit"===t||0<t.indexOf(".submit")?o.trigger(t,e):window.setTimeout(function(){o.trigger(t,e)},1)},off:o.off.bind(o)}},{"./form.js":3,"wolfy87-eventemitter":16}],5:[function(t,e,n){var v=/^(?:submit|button|image|reset|file)$/i,g=/^(?:input|select|textarea|keygen)/i,i=/(\[[^\[\]]*\])/g;function y(t,e,n){if(e.match(i)){!function t(e,n,r){if(0===n.length)return e=r;var i=n.shift(),o=i.match(/^\[(.+?)\]$/);if("[]"===i)return e=e||[],Array.isArray(e)?e.push(t(null,n,r)):(e._values=e._values||[],e._values.push(t(null,n,r))),e;if(o){var u=o[1],s=+u;isNaN(s)?(e=e||{})[u]=t(e[u],n,r):(e=e||[])[s]=t(e[s],n,r)}else e[i]=t(e[i],n,r);return e}(t,function(t){var e=[],n=new RegExp(i),r=/^([^\[\]]*)/.exec(t);for(r[1]&&e.push(r[1]);null!==(r=n.exec(t));)e.push(r[1]);return e}(e),n)}else{var r=t[e];r?(Array.isArray(r)||(t[e]=[r]),t[e].push(n)):t[e]=n}return t}function w(t,e,n){return n=n.replace(/(\r)?\n/g,"\r\n"),n=(n=encodeURIComponent(n)).replace(/%20/g,"+"),t+(t?"&":"")+encodeURIComponent(e)+"="+n}e.exports=function(t,e){"object"!=typeof e?e={hash:!!e}:void 0===e.hash&&(e.hash=!0);for(var n=e.hash?{}:"",r=e.serializer||(e.hash?y:w),i=t&&t.elements?t.elements:[],o=Object.create(null),u=0;u<i.length;++u){var s=i[u];if((e.disabled||!s.disabled)&&s.name&&g.test(s.nodeName)&&!v.test(s.type)){var a=s.name,c=s.value;if("checkbox"!==s.type&&"radio"!==s.type||s.checked||(c=void 0),e.empty){if("checkbox"!==s.type||s.checked||(c=""),"radio"===s.type&&(o[s.name]||s.checked?s.checked&&(o[s.name]=!0):o[s.name]=!1),null==c&&"radio"==s.type)continue}else if(!c)continue;if("select-multiple"!==s.type)n=r(n,a,c);else{c=[];for(var f=s.options,l=!1,h=0;h<f.length;++h){var d=f[h],p=e.empty&&!d.value,m=d.value||p;d.selected&&m&&(l=!0,n=e.hash&&"[]"!==a.slice(a.length-2)?r(n,a+"[]",d.value):r(n,a,d.value))}!l&&e.empty&&(n=r(n,a,""))}}}if(e.empty)for(var a in o)o[a]||(n=r(n,a,""));return n}},{}],6:[function(t,e,n){!function(){var i,l=0,r=0,h={},d={};function p(t,e,n){return"_root"==e?n:t!==n?(r=t,i||(i=r.matches?r.matches:r.webkitMatchesSelector?r.webkitMatchesSelector:r.mozMatchesSelector?r.mozMatchesSelector:r.msMatchesSelector?r.msMatchesSelector:r.oMatchesSelector?r.oMatchesSelector:v.matchesSelector)).call(t,e)?t:t.parentNode?(l++,p(t.parentNode,e,n)):void 0:void 0;var r}function m(t,e,n,r){if(h[t.id])if(e)if(r||n)if(r){if(h[t.id][e][n])for(var i=0;i<h[t.id][e][n].length;i++)if(h[t.id][e][n][i]===r){h[t.id][e][n].splice(i,1);break}}else delete h[t.id][e][n];else h[t.id][e]={};else for(var o in h[t.id])h[t.id].hasOwnProperty(o)&&(h[t.id][o]={})}function o(t,e,n,r){if(this.element){t instanceof Array||(t=[t]),n||"function"!=typeof e||(n=e,e="_root");var i,o,u,s,a,c=this.id;for(i=0;i<t.length;i++)r?m(this,t[i],e,n):(h[c]&&h[c][t[i]]||v.addEvent(this,t[i],f(t[i])),o=this,u=t[i],s=e,a=n,h[o.id]||(h[o.id]={}),h[o.id][u]||(h[o.id][u]={}),h[o.id][u][s]||(h[o.id][u][s]=[]),h[o.id][u][s].push(a));return this}function f(e){return function(t){!function(t,e,n){if(h[t][n]){var r,i,o=e.target||e.srcElement,u={},s=0,a=0;for(r in l=0,h[t][n])h[t][n].hasOwnProperty(r)&&(i=p(o,r,d[t].element))&&v.matchesEvent(n,d[t].element,i,"_root"==r,e)&&(l++,h[t][n][r].match=i,u[l]=h[t][n][r]);for(e.stopPropagation=function(){e.cancelBubble=!0},s=0;s<=l;s++)if(u[s])for(a=0;a<u[s].length;a++){if(!1===u[s][a].call(u[s].match,e))return v.cancel(e);if(e.cancelBubble)return}}}(c,t,e)}}}function v(t,e){if(!(this instanceof v)){for(var n in d)if(d[n].element===t)return d[n];return d[++r]=new v(t,r),d[r]}this.element=t,this.id=e}v.prototype.on=function(t,e,n){return o.call(this,t,e,n)},v.prototype.off=function(t,e,n){return o.call(this,t,e,n,!0)},v.matchesSelector=function(){},v.cancel=function(t){t.preventDefault(),t.stopPropagation()},v.addEvent=function(t,e,n){var r="blur"==e||"focus"==e;t.element.addEventListener(e,n,r)},v.matchesEvent=function(){return!0},void 0!==e&&e.exports&&(e.exports=v),window.Gator=v}()},{}],7:[function(t,e,n){var r,f;r=this,f=function(t,e,n){for(var r in e)if(e.hasOwnProperty(r)){var i=r,o=e[r];if(void 0===o&&(o=""),null===o&&(o=""),void 0!==n&&(i=n+"["+r+"]"),o.constructor===Array)i+="[]";else if("object"==typeof o){f(t,o,i);continue}var u=t.elements.namedItem(i);if(u)switch(u.type||u[0].type){default:u.value=o;break;case"radio":case"checkbox":for(var s=0;s<u.length;s++)u[s].checked=-1<o.indexOf(u[s].value);break;case"select-multiple":for(var a=o.constructor==Array?o:[o],c=0;c<u.options.length;c++)u.options[c].selected|=-1<a.indexOf(u.options[c].value);break;case"select":case"select-one":u.value=o.toString()||o;break;case"date":u.value=new Date(o).toISOString().split("T")[0]}}},"function"==typeof s&&"object"==typeof s.amd&&s.amd?s(function(){return f}):void 0!==e&&e.exports?e.exports=f:r.populate=f},{}],8:[function(t,e,n){var r,i,o=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var c,f=[],l=!1,h=-1;function d(){l&&c&&(l=!1,c.length?f=c.concat(f):h=-1,f.length&&p())}function p(){if(!l){var t=a(d);l=!0;for(var e=f.length;e;){for(c=f,f=[];++h<e;)c&&c[h].run();h=-1,e=f.length}c=null,l=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function v(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];f.push(new m(t,e)),1!==f.length||l||a(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],9:[function(l,h,t){(function(t){for(var r=l("performance-now"),e="undefined"==typeof window?t:window,n=["moz","webkit"],i="AnimationFrame",o=e["request"+i],u=e["cancel"+i]||e["cancelRequest"+i],s=0;!o&&s<n.length;s++)o=e[n[s]+"Request"+i],u=e[n[s]+"Cancel"+i]||e[n[s]+"CancelRequest"+i];if(!o||!u){var a=0,c=0,f=[];o=function(t){if(0===f.length){var e=r(),n=Math.max(0,1e3/60-(e-a));a=n+e,setTimeout(function(){for(var t=f.slice(0),e=f.length=0;e<t.length;e++)if(!t[e].cancelled)try{t[e].callback(a)}catch(t){setTimeout(function(){throw t},0)}},Math.round(n))}return f.push({handle:++c,callback:t,cancelled:!1}),c},u=function(t){for(var e=0;e<f.length;e++)f[e].handle===t&&(f[e].cancelled=!0)}}h.exports=function(t){return o.call(e,t)},h.exports.cancel=function(){u.apply(e,arguments)},h.exports.polyfill=function(t){t||(t=e),t.requestAnimationFrame=o,t.cancelAnimationFrame=u}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"performance-now":10}],10:[function(t,s,e){(function(u){(function(){var t,e,n,r,i,o;"undefined"!=typeof performance&&null!==performance&&performance.now?s.exports=function(){return performance.now()}:null!=u&&u.hrtime?(s.exports=function(){return(t()-i)/1e6},e=u.hrtime,r=(t=function(){var t;return 1e9*(t=e())[0]+t[1]})(),o=1e9*u.uptime(),i=r-o):n=Date.now?(s.exports=function(){return Date.now()-n},Date.now()):(s.exports=function(){return(new Date).getTime()-n},(new Date).getTime())}).call(this)}).call(this,t("_process"))},{_process:8}],11:[function(t,e,n){n.linear=function(t){return t},n.inQuad=function(t){return t*t},n.outQuad=function(t){return t*(2-t)},n.inOutQuad=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},n.inCube=function(t){return t*t*t},n.outCube=function(t){return--t*t*t+1},n.inOutCube=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},n.inQuart=function(t){return t*t*t*t},n.outQuart=function(t){return 1- --t*t*t*t},n.inOutQuart=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},n.inQuint=function(t){return t*t*t*t*t},n.outQuint=function(t){return--t*t*t*t*t+1},n.inOutQuint=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},n.inSine=function(t){return 1-Math.cos(t*Math.PI/2)},n.outSine=function(t){return Math.sin(t*Math.PI/2)},n.inOutSine=function(t){return.5*(1-Math.cos(Math.PI*t))},n.inExpo=function(t){return 0==t?0:Math.pow(1024,t-1)},n.outExpo=function(t){return 1==t?t:1-Math.pow(2,-10*t)},n.inOutExpo=function(t){return 0==t?0:1==t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},n.inCirc=function(t){return 1-Math.sqrt(1-t*t)},n.outCirc=function(t){return Math.sqrt(1- --t*t)},n.inOutCirc=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},n.inBack=function(t){return t*t*(2.70158*t-1.70158)},n.outBack=function(t){return--t*t*(2.70158*t+1.70158)+1},n.inOutBack=function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},n.inBounce=function(t){return 1-n.outBounce(1-t)},n.outBounce=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},n.inOutBounce=function(t){return t<.5?.5*n.inBounce(2*t):.5*n.outBounce(2*t-1)+.5},n.inElastic=function(t){var e,n=.1;return 0===t?0:1===t?1:(e=!n||n<1?(n=1,.1):.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},n.outElastic=function(t){var e,n=.1;return 0===t?0:1===t?1:(e=!n||n<1?(n=1,.1):.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},n.inOutElastic=function(t){var e,n=.1;return 0===t?0:1===t?1:(e=!n||n<1?(n=1,.1):.4*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},n["in-quad"]=n.inQuad,n["out-quad"]=n.outQuad,n["in-out-quad"]=n.inOutQuad,n["in-cube"]=n.inCube,n["out-cube"]=n.outCube,n["in-out-cube"]=n.inOutCube,n["in-quart"]=n.inQuart,n["out-quart"]=n.outQuart,n["in-out-quart"]=n.inOutQuart,n["in-quint"]=n.inQuint,n["out-quint"]=n.outQuint,n["in-out-quint"]=n.inOutQuint,n["in-sine"]=n.inSine,n["out-sine"]=n.outSine,n["in-out-sine"]=n.inOutSine,n["in-expo"]=n.inExpo,n["out-expo"]=n.outExpo,n["in-out-expo"]=n.inOutExpo,n["in-circ"]=n.inCirc,n["out-circ"]=n.outCirc,n["in-out-circ"]=n.inOutCirc,n["in-back"]=n.inBack,n["out-back"]=n.outBack,n["in-out-back"]=n.inOutBack,n["in-bounce"]=n.inBounce,n["out-bounce"]=n.outBounce,n["in-out-bounce"]=n.inOutBounce,n["in-elastic"]=n.inElastic,n["out-elastic"]=n.outElastic,n["in-out-elastic"]=n.inOutElastic},{}],12:[function(t,e,n){function r(t){if(t)return function(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}(t)}r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<r.length;i++)if((n=r[i])===e||n.fn===e){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks["$"+t];if(n)for(var r=0,i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,e);return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length},void 0!==e&&(e.exports=r)},{}],13:[function(t,e,n){var r=t("./scroll-to");e.exports=function(t,e){if(e=e||{},"string"==typeof t&&(t=document.querySelector(t)),t)return r(0,function(t,e,n){var r,i=document.body,o=document.documentElement,u=t.getBoundingClientRect(),s=o.clientHeight,a=Math.max(i.scrollHeight,i.offsetHeight,o.clientHeight,o.scrollHeight,o.offsetHeight);e=e||0,r="bottom"===n?u.bottom-s:"middle"===n?u.bottom-s/2-u.height/2:u.top;var c=a-s;return Math.min(r+e+window.pageYOffset,c)}(t,e.offset,e.align),e)}},{"./scroll-to":14}],14:[function(t,e,n){var u=t("./tween"),s=t("raf");e.exports=function(t,e,n){n=n||{};var r={top:window.pageYOffset||document.documentElement.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft},i=u(r).ease(n.ease||"out-circ").to({top:e,left:t}).duration(n.duration||1e3);function o(){s(o),i.update()}return i.update(function(t){window.scrollTo(0|t.left,0|t.top)}),i.on("end",function(){o=function(){}}),o(),i}},{"./tween":15,raf:9}],15:[function(t,e,n){var r=t("./ease");function i(t){if(!(this instanceof i))return new i(t);this._from=t,this.ease("linear"),this.duration(500)}t("./emitter")(i.prototype),i.prototype.reset=function(){return this.isArray="[object Array]"===Object.prototype.toString.call(this._from),this._curr=Object.assign({},this._from),this._done=!1,this._start=Date.now(),this},i.prototype.to=function(t){return this.reset(),this._to=t,this},i.prototype.duration=function(t){return this._duration=t,this},i.prototype.ease=function(t){if(!(t="function"==typeof t?t:r[t]))throw new TypeError("invalid easing function");return this._ease=t,this},i.prototype.stop=function(){return this.stopped=!0,this._done=!0,this.emit("stop"),this.emit("end"),this},i.prototype.step=function(){if(!this._done){var t=this._duration,e=Date.now();if(t<=e-this._start)return this._from=this._to,this._update(this._to),this._done=!0,this.emit("end"),this;var n=this._from,r=this._to,i=this._curr,o=(0,this._ease)((e-this._start)/t);if(this.isArray){for(var u=0;u<n.length;++u)i[u]=n[u]+(r[u]-n[u])*o;return this._update(i),this}for(var s in n)i[s]=n[s]+(r[s]-n[s])*o;return this._update(i),this}},i.prototype.update=function(t){return 0==arguments.length?this.step():(this._update=t,this)},e.exports=i},{"./ease":11,"./emitter":12}],16:[function(t,u,e){!function(t){"use strict";function e(){}var n=e.prototype,r=t.EventEmitter;function o(t,e){for(var n=t.length;n--;)if(t[n].listener===e)return n;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}n.getListeners=function(t){var e,n,r=this._getEvents();if(t instanceof RegExp)for(n in e={},r)r.hasOwnProperty(n)&&t.test(n)&&(e[n]=r[n]);else e=r[t]||(r[t]=[]);return e},n.flattenListeners=function(t){var e,n=[];for(e=0;e<t.length;e+=1)n.push(t[e].listener);return n},n.getListenersAsObject=function(t){var e,n=this.getListeners(t);return n instanceof Array&&((e={})[t]=n),e||n},n.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 n,r=this.getListenersAsObject(t),i="object"==typeof e;for(n in r)r.hasOwnProperty(n)&&-1===o(r[n],e)&&r[n].push(i?e:{listener:e,once:!1});return this},n.on=i("addListener"),n.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},n.once=i("addOnceListener"),n.defineEvent=function(t){return this.getListeners(t),this},n.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},n.removeListener=function(t,e){var n,r,i=this.getListenersAsObject(t);for(r in i)i.hasOwnProperty(r)&&-1!==(n=o(i[r],e))&&i[r].splice(n,1);return this},n.off=i("removeListener"),n.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},n.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},n.manipulateListeners=function(t,e,n){var r,i,o=t?this.removeListener:this.addListener,u=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(r=n.length;r--;)o.call(this,e,n[r]);else for(r in e)e.hasOwnProperty(r)&&(i=e[r])&&("function"==typeof i?o.call(this,r,i):u.call(this,r,i));return this},n.removeEvent=function(t){var e,n=typeof t,r=this._getEvents();if("string"===n)delete r[t];else if(t instanceof RegExp)for(e in r)r.hasOwnProperty(e)&&t.test(e)&&delete r[e];else delete this._events;return this},n.removeAllListeners=i("removeEvent"),n.emitEvent=function(t,e){var n,r,i,o,u=this.getListenersAsObject(t);for(o in u)if(u.hasOwnProperty(o))for(n=u[o].slice(0),i=0;i<n.length;i++)!0===(r=n[i]).once&&this.removeListener(t,r.listener),r.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,r.listener);return this},n.trigger=i("emitEvent"),n.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},n.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},n._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},n._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return t.EventEmitter=r,e},"function"==typeof s&&s.amd?s(function(){return e}):"object"==typeof u&&u.exports?u.exports=e:t.EventEmitter=e}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=forms-api.min.js.map
assets/js/forms-api.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["forms-api.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","obj","_conditionalElements","__esModule","default","form","eventName","errors","data","timeStart","pageHeight","mc4wp","window","Gator","forms","config","mc4wp_forms_config","scrollToElement","scrollToForm","animate","auto_scroll","element","duration","alignment","document","body","on","event","getByElement","target","srcElement","trigger","id","started","init","listeners","callback","submitted_form","formConfig","getElementById","element_id","Date","now","clientHeight","setData","scrollY","addEventListener","timeElapsed","./forms/conditional-elements.js","./forms/forms.js","gator","scroll-to-element","2","toggleElement","el","show","getAttribute","conditions","split","fieldName","expectedValues","values","inputs","querySelectorAll","input","type","checked","push","value","getFieldValues","bubbleElement","parentElement","tagName","findForm","conditionMet","indexOf","style","display","forEach","required","removeAttribute","setAttribute","evaluate","elements","handleInputEvent","evt","className","Object","defineProperty","_default","3","serialize","populate","Form","this","createElement","name","prototype","console","error","getData","hash","empty","getSerializedData","setResponse","msg","querySelector","innerHTML","reset","form-serialize","populate.js","4","EventEmitter","events","createFromElement","formElement","parseInt","all","get","formId","bind","eventArgs","setTimeout","off","./form.js","wolfy87-eventemitter","5","k_r_submitter","k_r_success_contrls","brackets","hash_serializer","result","key","match","hash_assign","keys","shift","between","Array","isArray","_values","string","index","isNaN","children","RegExp","exec","parse_keys","existing","str_serialize","replace","encodeURIComponent","options","serializer","radio_store","create","disabled","test","nodeName","val","selectOptions","isSelectedOptions","j","option","allowedEmpty","hasValue","selected","slice","6","_matcher","_level","_id","_handlers","_gatorInstances","_matchesSelector","selector","boundElement","matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","matchesSelector","parentNode","_removeHandler","splice","hasOwnProperty","_bind","remove","addEvent","_getGlobalCallback","matchesEvent","stopPropagation","cancelBubble","cancel","_handleEvent","preventDefault","useCapture","7","root","basename","constructor","namedItem","k","toString","toISOString","amd","8","cachedSetTimeout","cachedClearTimeout","process","defaultSetTimout","defaultClearTimeout","runTimeout","fun","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","concat","drainQueue","timeout","len","run","marker","runClearTimeout","Item","array","noop","nextTick","args","arguments","apply","title","browser","env","argv","version","versions","addListener","once","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","binding","cwd","chdir","dir","umask","9","global","vendors","suffix","raf","caf","last","_now","next","Math","max","cp","cancelled","round","handle","fn","polyfill","object","requestAnimationFrame","cancelAnimationFrame","self","performance-now","10","getNanoSeconds","hrtime","loadTime","moduleLoadTime","nodeLoadTime","upTime","performance","hr","uptime","getTime","_process","11","linear","inQuad","outQuad","inOutQuad","inCube","outCube","inOutCube","inQuart","outQuart","inOutQuart","inQuint","outQuint","inOutQuint","inSine","cos","PI","outSine","sin","inOutSine","inExpo","pow","outExpo","inOutExpo","inCirc","sqrt","outCirc","inOutCirc","inBack","outBack","inOutBack","s","inBounce","outBounce","inOutBounce","inElastic","asin","outElastic","inOutElastic","12","Emitter","mixin","_callbacks","removeEventListener","cb","callbacks","hasListeners","13","scroll","elem","additionalOffset","scrollPosition","html","documentElement","elemRect","getBoundingClientRect","documentHeight","scrollHeight","offsetHeight","bottom","height","top","maxScrollPosition","min","pageYOffset","calculateScrollOffset","offset","align","./scroll-to","14","Tween","x","y","start","scrollTop","left","pageXOffset","scrollLeft","tween","ease","to","update","scrollTo","./tween","15","_from","_curr","assign","_done","_start","_to","ms","_duration","TypeError","_ease","stop","stopped","step","_update","from","curr","./ease","./emitter","16","proto","originalGlobalValue","indexOfListener","listener","alias","getListeners","response","_getEvents","flattenListeners","flatListeners","getListenersAsObject","isValidListener","listenerIsWrapped","addOnceListener","defineEvent","defineEvents","evts","addListeners","manipulateListeners","removeListeners","single","multiple","removeEvent","_events","emitEvent","listenersMap","_getOnceReturnValue","setOnceReturnValue","_onceReturnValue","noConflict"],"mappings":"CAAA,WAAe,IAA6BA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAA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= 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'; // deps & vars\n\nvar _conditionalElements = _interopRequireDefault(require(\"./forms/conditional-elements.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mc4wp = window.mc4wp || {};\n\nvar Gator = require('gator');\n\nvar forms = require('./forms/forms.js');\n\nvar config = window.mc4wp_forms_config || {};\n\nvar scrollToElement = require('scroll-to-element');\n\n// funcs\nfunction scrollToForm(form) {\n var animate = config.auto_scroll === 'animated';\n scrollToElement(form.element, {\n duration: animate ? 800 : 1,\n alignment: 'middle'\n });\n}\n\nfunction handleFormRequest(form, eventName, errors, data) {\n var timeStart = Date.now();\n var pageHeight = document.body.clientHeight; // re-populate form\n\n if (errors) {\n form.setData(data);\n } // scroll to form\n\n\n if (window.scrollY <= 10 && config.auto_scroll) {\n scrollToForm(form);\n } // trigger events on window.load so all other scripts have loaded\n\n\n window.addEventListener('load', function () {\n // trigger events\n forms.trigger('submitted', [form]);\n forms.trigger(form.id + '.submitted', [form]);\n\n if (errors) {\n forms.trigger('error', [form, errors]);\n forms.trigger(form.id + '.error', [form, errors]);\n } else {\n // form was successfully submitted\n forms.trigger('success', [form, data]);\n forms.trigger(form.id + '.success', [form, data]); // subscribed / unsubscribed\n\n forms.trigger(eventName, [form, data]);\n forms.trigger(form.id + \".\" + eventName, [form, data]); // for BC: always trigger \"subscribed\" event when firing \"updated_subscriber\" event\n\n if (eventName === 'updated_subscriber') {\n forms.trigger('subscribed', [form, data, true]);\n forms.trigger(form.id + \".\" + \"subscribed\", [form, data, true]);\n }\n } // scroll to form again if page height changed since last scroll, eg because of slow loading images\n // (only if load didn't take more than 0.8 seconds to prevent overtaking user scroll)\n\n\n var timeElapsed = Date.now() - timeStart;\n\n if (config.auto_scroll && timeElapsed > 1000 && timeElapsed < 2000 && document.body.clientHeight != pageHeight) {\n scrollToForm(form);\n }\n });\n} // Bind browser events to form events (using delegation)\n\n\nGator(document.body).on('submit', '.mc4wp-form', function (event) {\n var form = forms.getByElement(event.target || event.srcElement);\n forms.trigger('submit', [form, event]);\n forms.trigger(form.id + '.submit', [form, event]);\n});\nGator(document.body).on('focus', '.mc4wp-form', function (event) {\n var form = forms.getByElement(event.target || event.srcElement);\n\n if (!form.started) {\n forms.trigger('started', [form, event]);\n forms.trigger(form.id + '.started', [form, event]);\n form.started = true;\n }\n});\nGator(document.body).on('change', '.mc4wp-form', function (event) {\n var form = forms.getByElement(event.target || event.srcElement);\n forms.trigger('change', [form, event]);\n forms.trigger(form.id + '.change', [form, event]);\n}); // init conditional elements\n\n_conditionalElements.default.init(); // register early listeners\n\n\nif (mc4wp.listeners) {\n var listeners = mc4wp.listeners;\n\n for (var i = 0; i < listeners.length; i++) {\n forms.on(listeners[i].event, listeners[i].callback);\n } // delete temp listeners array, so we don't bind twice\n\n\n delete mc4wp[\"listeners\"];\n} // expose forms object\n\n\nmc4wp.forms = forms; // handle submitted form\n\nif (config.submitted_form) {\n var formConfig = config.submitted_form,\n element = document.getElementById(formConfig.element_id),\n form = forms.getByElement(element);\n handleFormRequest(form, formConfig.event, formConfig.errors, formConfig.data);\n} // expose mc4wp object globally\n\n\nwindow.mc4wp = mc4wp;\n\n},{\"./forms/conditional-elements.js\":2,\"./forms/forms.js\":4,\"gator\":6,\"scroll-to-element\":13}],2:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction getFieldValues(form, fieldName) {\n var values = [];\n var inputs = form.querySelectorAll('input[name=\"' + fieldName + '\"], select[name=\"' + fieldName + '\"], textarea[name=\"' + fieldName + '\"]');\n\n for (var i = 0; i < inputs.length; i++) {\n var input = inputs[i];\n var type = input.getAttribute(\"type\");\n\n if ((type === \"radio\" || type === \"checkbox\") && !input.checked) {\n continue;\n }\n\n values.push(input.value);\n }\n\n return values;\n}\n\nfunction findForm(element) {\n var bubbleElement = element;\n\n while (bubbleElement.parentElement) {\n bubbleElement = bubbleElement.parentElement;\n\n if (bubbleElement.tagName === 'FORM') {\n return bubbleElement;\n }\n }\n\n return null;\n}\n\nfunction toggleElement(el) {\n var show = !!el.getAttribute('data-show-if');\n var conditions = show ? el.getAttribute('data-show-if').split(':') : el.getAttribute('data-hide-if').split(':');\n var fieldName = conditions[0];\n var expectedValues = (conditions.length > 1 ? conditions[1] : \"*\").split('|');\n var form = findForm(el);\n var values = getFieldValues(form, fieldName); // determine whether condition is met\n\n var conditionMet = false;\n\n for (var i = 0; i < values.length; i++) {\n var value = values[i]; // condition is met when value is in array of expected values OR expected values contains a wildcard and value is not empty\n\n conditionMet = expectedValues.indexOf(value) > -1 || expectedValues.indexOf('*') > -1 && value.length > 0;\n\n if (conditionMet) {\n break;\n }\n } // toggle element display\n\n\n if (show) {\n el.style.display = conditionMet ? '' : 'none';\n } else {\n el.style.display = conditionMet ? 'none' : '';\n } // find all inputs inside this element and toggle [required] attr (to prevent HTML5 validation on hidden elements)\n\n\n var inputs = el.querySelectorAll('input, select, textarea');\n [].forEach.call(inputs, function (el) {\n if ((conditionMet || show) && el.getAttribute('data-was-required')) {\n el.required = true;\n el.removeAttribute('data-was-required');\n }\n\n if ((!conditionMet || !show) && el.required) {\n el.setAttribute('data-was-required', \"true\");\n el.required = false;\n }\n });\n} // evaluate conditional elements globally\n\n\nfunction evaluate() {\n var elements = document.querySelectorAll('.mc4wp-form [data-show-if], .mc4wp-form [data-hide-if]');\n [].forEach.call(elements, toggleElement);\n} // re-evaluate conditional elements for change events on forms\n\n\nfunction handleInputEvent(evt) {\n if (!evt.target || !evt.target.form || evt.target.form.className.indexOf('mc4wp-form') < 0) {\n return;\n }\n\n var form = evt.target.form;\n var elements = form.querySelectorAll('[data-show-if], [data-hide-if]');\n [].forEach.call(elements, toggleElement);\n}\n\nvar _default = {\n 'init': function init() {\n document.addEventListener('keyup', handleInputEvent, true);\n document.addEventListener('change', handleInputEvent, true);\n document.addEventListener('mc4wp-refresh', evaluate, true);\n window.addEventListener('load', evaluate);\n evaluate();\n }\n};\nexports.default = _default;\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar serialize = require('form-serialize');\n\nvar populate = require('populate.js');\n\nvar Form = function Form(id, element) {\n this.id = id;\n this.element = element || document.createElement('form');\n this.name = this.element.getAttribute('data-name') || \"Form #\" + this.id;\n this.errors = [];\n this.started = false;\n};\n\nForm.prototype.setData = function (data) {\n try {\n populate(this.element, data);\n } catch (e) {\n console.error(e);\n }\n};\n\nForm.prototype.getData = function () {\n return serialize(this.element, {\n hash: true,\n empty: true\n });\n};\n\nForm.prototype.getSerializedData = function () {\n return serialize(this.element, {\n hash: false,\n empty: true\n });\n};\n\nForm.prototype.setResponse = function (msg) {\n this.element.querySelector('.mc4wp-response').innerHTML = msg;\n}; // revert back to original state\n\n\nForm.prototype.reset = function () {\n this.setResponse('');\n this.element.querySelector('.mc4wp-form-fields').style.display = '';\n this.element.reset();\n};\n\nmodule.exports = Form;\n\n},{\"form-serialize\":5,\"populate.js\":7}],4:[function(require,module,exports){\n'use strict'; // deps\n\nvar EventEmitter = require('wolfy87-eventemitter');\n\nvar Form = require('./form.js'); // variables\n\n\nvar events = new EventEmitter();\nvar forms = []; // get form by its id\n// please note that this will get the FIRST occurence of the form with that ID on the page\n\nfunction get(formId) {\n // do we have form for this one already?\n for (var i = 0; i < forms.length; i++) {\n if (forms[i].id == formId) {\n return forms[i];\n }\n } // try to create from first occurence of this element\n\n\n var formElement = document.querySelector('.mc4wp-form-' + formId);\n return createFromElement(formElement, formId);\n} // get form by <form> element (or any input in form)\n\n\nfunction getByElement(element) {\n var formElement = element.form || element;\n\n for (var i = 0; i < forms.length; i++) {\n if (forms[i].element == formElement) {\n return forms[i];\n }\n }\n\n return createFromElement(formElement);\n} // create form object from <form> element\n\n\nfunction createFromElement(formElement, id) {\n id = id || parseInt(formElement.getAttribute('data-id')) || 0;\n var form = new Form(id, formElement);\n forms.push(form);\n return form;\n}\n\nfunction all() {\n return forms;\n}\n\nfunction triggerEvent(eventName, eventArgs) {\n if (eventName === 'submit') {\n // don't spin up new thread for submit event as we want to preventDefault()... \n // TODO: Fix that in Premium.\n events.trigger(eventName, eventArgs);\n } else {\n // process in separate thread to prevent errors from breaking core functionality\n window.setTimeout(function () {\n events.trigger(eventName, eventArgs);\n }, 1);\n }\n}\n\nmodule.exports = {\n \"all\": all,\n \"get\": get,\n \"getByElement\": getByElement,\n \"on\": events.on.bind(events),\n \"trigger\": triggerEvent,\n \"off\": events.off.bind(events)\n};\n\n},{\"./form.js\":3,\"wolfy87-eventemitter\":16}],5:[function(require,module,exports){\n// get successful control from form and assemble into object\n// http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2\n\n// types which indicate a submit action and are not successful controls\n// these will be ignored\nvar k_r_submitter = /^(?:submit|button|image|reset|file)$/i;\n\n// node names which could be successful controls\nvar k_r_success_contrls = /^(?:input|select|textarea|keygen)/i;\n\n// Matches bracket notation.\nvar brackets = /(\\[[^\\[\\]]*\\])/g;\n\n// serializes form fields\n// @param form MUST be an HTMLForm element\n// @param options is an optional argument to configure the serialization. Default output\n// with no options specified is a url encoded string\n// - hash: [true | false] Configure the output type. If true, the output will\n// be a js object.\n// - serializer: [function] Optional serializer function to override the default one.\n// The function takes 3 arguments (result, key, value) and should return new result\n// hash and url encoded str serializers are provided with this module\n// - disabled: [true | false]. If true serialize disabled fields.\n// - empty: [true | false]. If true serialize empty fields\nfunction serialize(form, options) {\n if (typeof options != 'object') {\n options = { hash: !!options };\n }\n else if (options.hash === undefined) {\n options.hash = true;\n }\n\n var result = (options.hash) ? {} : '';\n var serializer = options.serializer || ((options.hash) ? hash_serializer : str_serialize);\n\n var elements = form && form.elements ? form.elements : [];\n\n //Object store each radio and set if it's empty or not\n var radio_store = Object.create(null);\n\n for (var i=0 ; i<elements.length ; ++i) {\n var element = elements[i];\n\n // ingore disabled fields\n if ((!options.disabled && element.disabled) || !element.name) {\n continue;\n }\n // ignore anyhting that is not considered a success field\n if (!k_r_success_contrls.test(element.nodeName) ||\n k_r_submitter.test(element.type)) {\n continue;\n }\n\n var key = element.name;\n var val = element.value;\n\n // we can't just use element.value for checkboxes cause some browsers lie to us\n // they say \"on\" for value when the box isn't checked\n if ((element.type === 'checkbox' || element.type === 'radio') && !element.checked) {\n val = undefined;\n }\n\n // If we want empty elements\n if (options.empty) {\n // for checkbox\n if (element.type === 'checkbox' && !element.checked) {\n val = '';\n }\n\n // for radio\n if (element.type === 'radio') {\n if (!radio_store[element.name] && !element.checked) {\n radio_store[element.name] = false;\n }\n else if (element.checked) {\n radio_store[element.name] = true;\n }\n }\n\n // if options empty is true, continue only if its radio\n if (val == undefined && element.type == 'radio') {\n continue;\n }\n }\n else {\n // value-less fields are ignored unless options.empty is true\n if (!val) {\n continue;\n }\n }\n\n // multi select boxes\n if (element.type === 'select-multiple') {\n val = [];\n\n var selectOptions = element.options;\n var isSelectedOptions = false;\n for (var j=0 ; j<selectOptions.length ; ++j) {\n var option = selectOptions[j];\n var allowedEmpty = options.empty && !option.value;\n var hasValue = (option.value || allowedEmpty);\n if (option.selected && hasValue) {\n isSelectedOptions = true;\n\n // If using a hash serializer be sure to add the\n // correct notation for an array in the multi-select\n // context. Here the name attribute on the select element\n // might be missing the trailing bracket pair. Both names\n // \"foo\" and \"foo[]\" should be arrays.\n if (options.hash && key.slice(key.length - 2) !== '[]') {\n result = serializer(result, key + '[]', option.value);\n }\n else {\n result = serializer(result, key, option.value);\n }\n }\n }\n\n // Serialize if no selected options and options.empty is true\n if (!isSelectedOptions && options.empty) {\n result = serializer(result, key, '');\n }\n\n continue;\n }\n\n result = serializer(result, key, val);\n }\n\n // Check for all empty radio buttons and serialize them with key=\"\"\n if (options.empty) {\n for (var key in radio_store) {\n if (!radio_store[key]) {\n result = serializer(result, key, '');\n }\n }\n }\n\n return result;\n}\n\nfunction parse_keys(string) {\n var keys = [];\n var prefix = /^([^\\[\\]]*)/;\n var children = new RegExp(brackets);\n var match = prefix.exec(string);\n\n if (match[1]) {\n keys.push(match[1]);\n }\n\n while ((match = children.exec(string)) !== null) {\n keys.push(match[1]);\n }\n\n return keys;\n}\n\nfunction hash_assign(result, keys, value) {\n if (keys.length === 0) {\n result = value;\n return result;\n }\n\n var key = keys.shift();\n var between = key.match(/^\\[(.+?)\\]$/);\n\n if (key === '[]') {\n result = result || [];\n\n if (Array.isArray(result)) {\n result.push(hash_assign(null, keys, value));\n }\n else {\n // This might be the result of bad name attributes like \"[][foo]\",\n // in this case the original `result` object will already be\n // assigned to an object literal. Rather than coerce the object to\n // an array, or cause an exception the attribute \"_values\" is\n // assigned as an array.\n result._values = result._values || [];\n result._values.push(hash_assign(null, keys, value));\n }\n\n return result;\n }\n\n // Key is an attribute name and can be assigned directly.\n if (!between) {\n result[key] = hash_assign(result[key], keys, value);\n }\n else {\n var string = between[1];\n // +var converts the variable into a number\n // better than parseInt because it doesn't truncate away trailing\n // letters and actually fails if whole thing is not a number\n var index = +string;\n\n // If the characters between the brackets is not a number it is an\n // attribute name and can be assigned directly.\n if (isNaN(index)) {\n result = result || {};\n result[string] = hash_assign(result[string], keys, value);\n }\n else {\n result = result || [];\n result[index] = hash_assign(result[index], keys, value);\n }\n }\n\n return result;\n}\n\n// Object/hash encoding serializer.\nfunction hash_serializer(result, key, value) {\n var matches = key.match(brackets);\n\n // Has brackets? Use the recursive assignment function to walk the keys,\n // construct any missing objects in the result tree and make the assignment\n // at the end of the chain.\n if (matches) {\n var keys = parse_keys(key);\n hash_assign(result, keys, value);\n }\n else {\n // Non bracket notation can make assignments directly.\n var existing = result[key];\n\n // If the value has been assigned already (for instance when a radio and\n // a checkbox have the same name attribute) convert the previous value\n // into an array before pushing into it.\n //\n // NOTE: If this requirement were removed all hash creation and\n // assignment could go through `hash_assign`.\n if (existing) {\n if (!Array.isArray(existing)) {\n result[key] = [ existing ];\n }\n\n result[key].push(value);\n }\n else {\n result[key] = value;\n }\n }\n\n return result;\n}\n\n// urlform encoding serializer\nfunction str_serialize(result, key, value) {\n // encode newlines as \\r\\n cause the html spec says so\n value = value.replace(/(\\r)?\\n/g, '\\r\\n');\n value = encodeURIComponent(value);\n\n // spaces should be '+' rather than '%20'.\n value = value.replace(/%20/g, '+');\n return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + value;\n}\n\nmodule.exports = serialize;\n\n},{}],6:[function(require,module,exports){\n/**\n * Copyright 2014 Craig Campbell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * GATOR.JS\n * Simple Event Delegation\n *\n * @version 1.2.4\n *\n * Compatible with IE 9+, FF 3.6+, Safari 5+, Chrome\n *\n * Include legacy.js for compatibility with older browsers\n *\n * .-._ _ _ _ _ _ _ _ _\n * .-''-.__.-'00 '-' ' ' ' ' ' ' ' '-.\n * '.___ ' . .--_'-' '-' '-' _'-' '._\n * V: V 'vv-' '_ '. .' _..' '.'.\n * '=.____.=_.--' :_.__.__:_ '. : :\n * (((____.-' '-. / : :\n * (((-'\\ .' /\n * _____..' .'\n * '-._____.-'\n */\n(function() {\n var _matcher,\n _level = 0,\n _id = 0,\n _handlers = {},\n _gatorInstances = {};\n\n function _addEvent(gator, type, callback) {\n\n // blur and focus do not bubble up but if you use event capturing\n // then you will get them\n var useCapture = type == 'blur' || type == 'focus';\n gator.element.addEventListener(type, callback, useCapture);\n }\n\n function _cancel(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n /**\n * returns function to use for determining if an element\n * matches a query selector\n *\n * @returns {Function}\n */\n function _getMatcher(element) {\n if (_matcher) {\n return _matcher;\n }\n\n if (element.matches) {\n _matcher = element.matches;\n return _matcher;\n }\n\n if (element.webkitMatchesSelector) {\n _matcher = element.webkitMatchesSelector;\n return _matcher;\n }\n\n if (element.mozMatchesSelector) {\n _matcher = element.mozMatchesSelector;\n return _matcher;\n }\n\n if (element.msMatchesSelector) {\n _matcher = element.msMatchesSelector;\n return _matcher;\n }\n\n if (element.oMatchesSelector) {\n _matcher = element.oMatchesSelector;\n return _matcher;\n }\n\n // if it doesn't match a native browser method\n // fall back to the gator function\n _matcher = Gator.matchesSelector;\n return _matcher;\n }\n\n /**\n * determines if the specified element matches a given selector\n *\n * @param {Node} element - the element to compare against the selector\n * @param {string} selector\n * @param {Node} boundElement - the element the listener was attached to\n * @returns {void|Node}\n */\n function _matchesSelector(element, selector, boundElement) {\n\n // no selector means this event was bound directly to this element\n if (selector == '_root') {\n return boundElement;\n }\n\n // if we have moved up to the element you bound the event to\n // then we have come too far\n if (element === boundElement) {\n return;\n }\n\n // if this is a match then we are done!\n if (_getMatcher(element).call(element, selector)) {\n return element;\n }\n\n // if this element did not match but has a parent we should try\n // going up the tree to see if any of the parent elements match\n // for example if you are looking for a click on an <a> tag but there\n // is a <span> inside of the a tag that it is the target,\n // it should still work\n if (element.parentNode) {\n _level++;\n return _matchesSelector(element.parentNode, selector, boundElement);\n }\n }\n\n function _addHandler(gator, event, selector, callback) {\n if (!_handlers[gator.id]) {\n _handlers[gator.id] = {};\n }\n\n if (!_handlers[gator.id][event]) {\n _handlers[gator.id][event] = {};\n }\n\n if (!_handlers[gator.id][event][selector]) {\n _handlers[gator.id][event][selector] = [];\n }\n\n _handlers[gator.id][event][selector].push(callback);\n }\n\n function _removeHandler(gator, event, selector, callback) {\n\n // if there are no events tied to this element at all\n // then don't do anything\n if (!_handlers[gator.id]) {\n return;\n }\n\n // if there is no event type specified then remove all events\n // example: Gator(element).off()\n if (!event) {\n for (var type in _handlers[gator.id]) {\n if (_handlers[gator.id].hasOwnProperty(type)) {\n _handlers[gator.id][type] = {};\n }\n }\n return;\n }\n\n // if no callback or selector is specified remove all events of this type\n // example: Gator(element).off('click')\n if (!callback && !selector) {\n _handlers[gator.id][event] = {};\n return;\n }\n\n // if a selector is specified but no callback remove all events\n // for this selector\n // example: Gator(element).off('click', '.sub-element')\n if (!callback) {\n delete _handlers[gator.id][event][selector];\n return;\n }\n\n // if we have specified an event type, selector, and callback then we\n // need to make sure there are callbacks tied to this selector to\n // begin with. if there aren't then we can stop here\n if (!_handlers[gator.id][event][selector]) {\n return;\n }\n\n // if there are then loop through all the callbacks and if we find\n // one that matches remove it from the array\n for (var i = 0; i < _handlers[gator.id][event][selector].length; i++) {\n if (_handlers[gator.id][event][selector][i] === callback) {\n _handlers[gator.id][event][selector].splice(i, 1);\n break;\n }\n }\n }\n\n function _handleEvent(id, e, type) {\n if (!_handlers[id][type]) {\n return;\n }\n\n var target = e.target || e.srcElement,\n selector,\n match,\n matches = {},\n i = 0,\n j = 0;\n\n // find all events that match\n _level = 0;\n for (selector in _handlers[id][type]) {\n if (_handlers[id][type].hasOwnProperty(selector)) {\n match = _matchesSelector(target, selector, _gatorInstances[id].element);\n\n if (match && Gator.matchesEvent(type, _gatorInstances[id].element, match, selector == '_root', e)) {\n _level++;\n _handlers[id][type][selector].match = match;\n matches[_level] = _handlers[id][type][selector];\n }\n }\n }\n\n // stopPropagation() fails to set cancelBubble to true in Webkit\n // @see http://code.google.com/p/chromium/issues/detail?id=162270\n e.stopPropagation = function() {\n e.cancelBubble = true;\n };\n\n for (i = 0; i <= _level; i++) {\n if (matches[i]) {\n for (j = 0; j < matches[i].length; j++) {\n if (matches[i][j].call(matches[i].match, e) === false) {\n Gator.cancel(e);\n return;\n }\n\n if (e.cancelBubble) {\n return;\n }\n }\n }\n }\n }\n\n /**\n * binds the specified events to the element\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @param {boolean=} remove\n * @returns {Object}\n */\n function _bind(events, selector, callback, remove) {\n\n // fail silently if you pass null or undefined as an alement\n // in the Gator constructor\n if (!this.element) {\n return;\n }\n\n if (!(events instanceof Array)) {\n events = [events];\n }\n\n if (!callback && typeof(selector) == 'function') {\n callback = selector;\n selector = '_root';\n }\n\n var id = this.id,\n i;\n\n function _getGlobalCallback(type) {\n return function(e) {\n _handleEvent(id, e, type);\n };\n }\n\n for (i = 0; i < events.length; i++) {\n if (remove) {\n _removeHandler(this, events[i], selector, callback);\n continue;\n }\n\n if (!_handlers[id] || !_handlers[id][events[i]]) {\n Gator.addEvent(this, events[i], _getGlobalCallback(events[i]));\n }\n\n _addHandler(this, events[i], selector, callback);\n }\n\n return this;\n }\n\n /**\n * Gator object constructor\n *\n * @param {Node} element\n */\n function Gator(element, id) {\n\n // called as function\n if (!(this instanceof Gator)) {\n // only keep one Gator instance per node to make sure that\n // we don't create a ton of new objects if you want to delegate\n // multiple events from the same node\n //\n // for example: Gator(document).on(...\n for (var key in _gatorInstances) {\n if (_gatorInstances[key].element === element) {\n return _gatorInstances[key];\n }\n }\n\n _id++;\n _gatorInstances[_id] = new Gator(element, _id);\n\n return _gatorInstances[_id];\n }\n\n this.element = element;\n this.id = id;\n }\n\n /**\n * adds an event\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @returns {Object}\n */\n Gator.prototype.on = function(events, selector, callback) {\n return _bind.call(this, events, selector, callback);\n };\n\n /**\n * removes an event\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @returns {Object}\n */\n Gator.prototype.off = function(events, selector, callback) {\n return _bind.call(this, events, selector, callback, true);\n };\n\n Gator.matchesSelector = function() {};\n Gator.cancel = _cancel;\n Gator.addEvent = _addEvent;\n Gator.matchesEvent = function() {\n return true;\n };\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Gator;\n }\n\n window.Gator = Gator;\n}) ();\n\n},{}],7:[function(require,module,exports){\n/*! populate.js v1.0.2 by @dannyvankooten | MIT license */\n;(function(root) {\n\n\t/**\n\t * Populate form fields from a JSON object.\n\t *\n\t * @param form object The form element containing your input fields.\n\t * @param data array JSON data to populate the fields with.\n\t * @param basename string Optional basename which is added to `name` attributes\n\t */\n\tvar populate = function( form, data, basename) {\n\n\t\tfor(var key in data) {\n\n\t\t\tif( ! data.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar name = key;\n\t\t\tvar value = data[key];\n\n if ('undefined' === typeof value) {\n value = '';\n }\n\n if (null === value) {\n value = '';\n }\n\n\t\t\t// handle array name attributes\n\t\t\tif(typeof(basename) !== \"undefined\") {\n\t\t\t\tname = basename + \"[\" + key + \"]\";\n\t\t\t}\n\n\t\t\tif(value.constructor === Array) {\n\t\t\t\tname += '[]';\n\t\t\t} else if(typeof value == \"object\") {\n\t\t\t\tpopulate( form, value, name);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// only proceed if element is set\n\t\t\tvar element = form.elements.namedItem( name );\n\t\t\tif( ! element ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar type = element.type || element[0].type;\n\n\t\t\tswitch(type ) {\n\t\t\t\tdefault:\n\t\t\t\t\telement.value = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'radio':\n\t\t\t\tcase 'checkbox':\n\t\t\t\t\tfor( var j=0; j < element.length; j++ ) {\n\t\t\t\t\t\telement[j].checked = ( value.indexOf(element[j].value) > -1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'select-multiple':\n\t\t\t\t\tvar values = value.constructor == Array ? value : [value];\n\n\t\t\t\t\tfor(var k = 0; k < element.options.length; k++) {\n\t\t\t\t\t\telement.options[k].selected |= (values.indexOf(element.options[k].value) > -1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'select':\n\t\t\t\tcase 'select-one':\n\t\t\t\t\telement.value = value.toString() || value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'date':\n \t\t\t\telement.value = new Date(value).toISOString().split('T')[0];\t\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\t// Play nice with AMD, CommonJS or a plain global object.\n\tif ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) {\n\t\tdefine(function() {\n\t\t\treturn populate;\n\t\t});\n\t}\telse if ( typeof module !== 'undefined' && module.exports ) {\n\t\tmodule.exports = populate;\n\t} else {\n\t\troot.populate = populate;\n\t}\n\n}(this));\n\n},{}],8:[function(require,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],9:[function(require,module,exports){\n(function (global){\nvar now = require('performance-now')\n , root = typeof window === 'undefined' ? global : window\n , vendors = ['moz', 'webkit']\n , suffix = 'AnimationFrame'\n , raf = root['request' + suffix]\n , caf = root['cancel' + suffix] || root['cancelRequest' + suffix]\n\nfor(var i = 0; !raf && i < vendors.length; i++) {\n raf = root[vendors[i] + 'Request' + suffix]\n caf = root[vendors[i] + 'Cancel' + suffix]\n || root[vendors[i] + 'CancelRequest' + suffix]\n}\n\n// Some versions of FF have rAF but not cAF\nif(!raf || !caf) {\n var last = 0\n , id = 0\n , queue = []\n , frameDuration = 1000 / 60\n\n raf = function(callback) {\n if(queue.length === 0) {\n var _now = now()\n , next = Math.max(0, frameDuration - (_now - last))\n last = next + _now\n setTimeout(function() {\n var cp = queue.slice(0)\n // Clear queue here to prevent\n // callbacks from appending listeners\n // to the current frame's queue\n queue.length = 0\n for(var i = 0; i < cp.length; i++) {\n if(!cp[i].cancelled) {\n try{\n cp[i].callback(last)\n } catch(e) {\n setTimeout(function() { throw e }, 0)\n }\n }\n }\n }, Math.round(next))\n }\n queue.push({\n handle: ++id,\n callback: callback,\n cancelled: false\n })\n return id\n }\n\n caf = function(handle) {\n for(var i = 0; i < queue.length; i++) {\n if(queue[i].handle === handle) {\n queue[i].cancelled = true\n }\n }\n }\n}\n\nmodule.exports = function(fn) {\n // Wrap in a new function to prevent\n // `cancel` potentially being assigned\n // to the native rAF function\n return raf.call(root, fn)\n}\nmodule.exports.cancel = function() {\n caf.apply(root, arguments)\n}\nmodule.exports.polyfill = function(object) {\n if (!object) {\n object = root;\n }\n object.requestAnimationFrame = raf\n object.cancelAnimationFrame = caf\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"performance-now\":10}],10:[function(require,module,exports){\n(function (process){\n// Generated by CoffeeScript 1.12.2\n(function() {\n var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;\n\n if ((typeof performance !== \"undefined\" && performance !== null) && performance.now) {\n module.exports = function() {\n return performance.now();\n };\n } else if ((typeof process !== \"undefined\" && process !== null) && process.hrtime) {\n module.exports = function() {\n return (getNanoSeconds() - nodeLoadTime) / 1e6;\n };\n hrtime = process.hrtime;\n getNanoSeconds = function() {\n var hr;\n hr = hrtime();\n return hr[0] * 1e9 + hr[1];\n };\n moduleLoadTime = getNanoSeconds();\n upTime = process.uptime() * 1e9;\n nodeLoadTime = moduleLoadTime - upTime;\n } else if (Date.now) {\n module.exports = function() {\n return Date.now() - loadTime;\n };\n loadTime = Date.now();\n } else {\n module.exports = function() {\n return new Date().getTime() - loadTime;\n };\n loadTime = new Date().getTime();\n }\n\n}).call(this);\n\n\n\n}).call(this,require('_process'))\n},{\"_process\":8}],11:[function(require,module,exports){\n// easing functions from \"Tween.js\"\nexports.linear = function(n){\n return n;\n};\n\nexports.inQuad = function(n){\n return n * n;\n};\n\nexports.outQuad = function(n){\n return n * (2 - n);\n};\n\nexports.inOutQuad = function(n){\n n *= 2;\n if (n < 1) return 0.5 * n * n;\n return - 0.5 * (--n * (n - 2) - 1);\n};\n\nexports.inCube = function(n){\n return n * n * n;\n};\n\nexports.outCube = function(n){\n return --n * n * n + 1;\n};\n\nexports.inOutCube = function(n){\n n *= 2;\n if (n < 1) return 0.5 * n * n * n;\n return 0.5 * ((n -= 2 ) * n * n + 2);\n};\n\nexports.inQuart = function(n){\n return n * n * n * n;\n};\n\nexports.outQuart = function(n){\n return 1 - (--n * n * n * n);\n};\n\nexports.inOutQuart = function(n){\n n *= 2;\n if (n < 1) return 0.5 * n * n * n * n;\n return -0.5 * ((n -= 2) * n * n * n - 2);\n};\n\nexports.inQuint = function(n){\n return n * n * n * n * n;\n}\n\nexports.outQuint = function(n){\n return --n * n * n * n * n + 1;\n}\n\nexports.inOutQuint = function(n){\n n *= 2;\n if (n < 1) return 0.5 * n * n * n * n * n;\n return 0.5 * ((n -= 2) * n * n * n * n + 2);\n};\n\nexports.inSine = function(n){\n return 1 - Math.cos(n * Math.PI / 2 );\n};\n\nexports.outSine = function(n){\n return Math.sin(n * Math.PI / 2);\n};\n\nexports.inOutSine = function(n){\n return .5 * (1 - Math.cos(Math.PI * n));\n};\n\nexports.inExpo = function(n){\n return 0 == n ? 0 : Math.pow(1024, n - 1);\n};\n\nexports.outExpo = function(n){\n return 1 == n ? n : 1 - Math.pow(2, -10 * n);\n};\n\nexports.inOutExpo = function(n){\n if (0 == n) return 0;\n if (1 == n) return 1;\n if ((n *= 2) < 1) return .5 * Math.pow(1024, n - 1);\n return .5 * (-Math.pow(2, -10 * (n - 1)) + 2);\n};\n\nexports.inCirc = function(n){\n return 1 - Math.sqrt(1 - n * n);\n};\n\nexports.outCirc = function(n){\n return Math.sqrt(1 - (--n * n));\n};\n\nexports.inOutCirc = function(n){\n n *= 2\n if (n < 1) return -0.5 * (Math.sqrt(1 - n * n) - 1);\n return 0.5 * (Math.sqrt(1 - (n -= 2) * n) + 1);\n};\n\nexports.inBack = function(n){\n var s = 1.70158;\n return n * n * (( s + 1 ) * n - s);\n};\n\nexports.outBack = function(n){\n var s = 1.70158;\n return --n * n * ((s + 1) * n + s) + 1;\n};\n\nexports.inOutBack = function(n){\n var s = 1.70158 * 1.525;\n if ( ( n *= 2 ) < 1 ) return 0.5 * ( n * n * ( ( s + 1 ) * n - s ) );\n return 0.5 * ( ( n -= 2 ) * n * ( ( s + 1 ) * n + s ) + 2 );\n};\n\nexports.inBounce = function(n){\n return 1 - exports.outBounce(1 - n);\n};\n\nexports.outBounce = function(n){\n if ( n < ( 1 / 2.75 ) ) {\n return 7.5625 * n * n;\n } else if ( n < ( 2 / 2.75 ) ) {\n return 7.5625 * ( n -= ( 1.5 / 2.75 ) ) * n + 0.75;\n } else if ( n < ( 2.5 / 2.75 ) ) {\n return 7.5625 * ( n -= ( 2.25 / 2.75 ) ) * n + 0.9375;\n } else {\n return 7.5625 * ( n -= ( 2.625 / 2.75 ) ) * n + 0.984375;\n }\n};\n\nexports.inOutBounce = function(n){\n if (n < .5) return exports.inBounce(n * 2) * .5;\n return exports.outBounce(n * 2 - 1) * .5 + .5;\n};\n\nexports.inElastic = function(n){\n var s, a = 0.1, p = 0.4;\n if ( n === 0 ) return 0;\n if ( n === 1 ) return 1;\n if ( !a || a < 1 ) { a = 1; s = p / 4; }\n else s = p * Math.asin( 1 / a ) / ( 2 * Math.PI );\n return - ( a * Math.pow( 2, 10 * ( n -= 1 ) ) * Math.sin( ( n - s ) * ( 2 * Math.PI ) / p ) );\n};\n\nexports.outElastic = function(n){\n var s, a = 0.1, p = 0.4;\n if ( n === 0 ) return 0;\n if ( n === 1 ) return 1;\n if ( !a || a < 1 ) { a = 1; s = p / 4; }\n else s = p * Math.asin( 1 / a ) / ( 2 * Math.PI );\n return ( a * Math.pow( 2, - 10 * n) * Math.sin( ( n - s ) * ( 2 * Math.PI ) / p ) + 1 );\n};\n\nexports.inOutElastic = function(n){\n var s, a = 0.1, p = 0.4;\n if ( n === 0 ) return 0;\n if ( n === 1 ) return 1;\n if ( !a || a < 1 ) { a = 1; s = p / 4; }\n else s = p * Math.asin( 1 / a ) / ( 2 * Math.PI );\n if ( ( n *= 2 ) < 1 ) return - 0.5 * ( a * Math.pow( 2, 10 * ( n -= 1 ) ) * Math.sin( ( n - s ) * ( 2 * Math.PI ) / p ) );\n return a * Math.pow( 2, -10 * ( n -= 1 ) ) * Math.sin( ( n - s ) * ( 2 * Math.PI ) / p ) * 0.5 + 1;\n};\n\n// aliases\nexports['in-quad'] = exports.inQuad;\nexports['out-quad'] = exports.outQuad;\nexports['in-out-quad'] = exports.inOutQuad;\nexports['in-cube'] = exports.inCube;\nexports['out-cube'] = exports.outCube;\nexports['in-out-cube'] = exports.inOutCube;\nexports['in-quart'] = exports.inQuart;\nexports['out-quart'] = exports.outQuart;\nexports['in-out-quart'] = exports.inOutQuart;\nexports['in-quint'] = exports.inQuint;\nexports['out-quint'] = exports.outQuint;\nexports['in-out-quint'] = exports.inOutQuint;\nexports['in-sine'] = exports.inSine;\nexports['out-sine'] = exports.outSine;\nexports['in-out-sine'] = exports.inOutSine;\nexports['in-expo'] = exports.inExpo;\nexports['out-expo'] = exports.outExpo;\nexports['in-out-expo'] = exports.inOutExpo;\nexports['in-circ'] = exports.inCirc;\nexports['out-circ'] = exports.outCirc;\nexports['in-out-circ'] = exports.inOutCirc;\nexports['in-back'] = exports.inBack;\nexports['out-back'] = exports.outBack;\nexports['in-out-back'] = exports.inOutBack;\nexports['in-bounce'] = exports.inBounce;\nexports['out-bounce'] = exports.outBounce;\nexports['in-out-bounce'] = exports.inOutBounce;\nexports['in-elastic'] = exports.inElastic;\nexports['out-elastic'] = exports.outElastic;\nexports['in-out-elastic'] = exports.inOutElastic;\n\n},{}],12:[function(require,module,exports){\nfunction Emitter(obj) {\n if (obj) return mixin(obj);\n};\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n // Remove event specific arrays for event types that no\n // one is subscribed for to avoid memory leak.\n if (callbacks.length === 0) {\n delete this._callbacks['$' + event];\n }\n\n return this;\n};\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n var args = [].slice.call(arguments, 1)\n , callbacks = this._callbacks['$' + event];\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n\nif (typeof module !== 'undefined') {\n module.exports = Emitter;\n}\n\n},{}],13:[function(require,module,exports){\nvar scroll = require('./scroll-to');\n\nfunction calculateScrollOffset(elem, additionalOffset, alignment) {\n var body = document.body,\n html = document.documentElement;\n\n var elemRect = elem.getBoundingClientRect();\n var clientHeight = html.clientHeight;\n var documentHeight = Math.max( body.scrollHeight, body.offsetHeight,\n html.clientHeight, html.scrollHeight, html.offsetHeight );\n\n additionalOffset = additionalOffset || 0;\n\n var scrollPosition;\n if (alignment === 'bottom') {\n scrollPosition = elemRect.bottom - clientHeight;\n } else if (alignment === 'middle') {\n scrollPosition = elemRect.bottom - clientHeight / 2 - elemRect.height / 2;\n } else { // top and default\n scrollPosition = elemRect.top;\n }\n\n var maxScrollPosition = documentHeight - clientHeight;\n return Math.min(scrollPosition + additionalOffset + window.pageYOffset,\n maxScrollPosition);\n}\n\nmodule.exports = function (elem, options) {\n options = options || {};\n if (typeof elem === 'string') elem = document.querySelector(elem);\n if (elem) return scroll(0, calculateScrollOffset(elem, options.offset, options.align), options);\n};\n\n},{\"./scroll-to\":14}],14:[function(require,module,exports){\nvar Tween = require('./tween');\nvar raf = require('raf');\n\nfunction scroll() {\n var y = window.pageYOffset || document.documentElement.scrollTop;\n var x = window.pageXOffset || document.documentElement.scrollLeft;\n return { top: y, left: x };\n}\n\nfunction scrollTo(x, y, options) {\n options = options || {};\n\n // start position\n var start = scroll();\n\n // setup tween\n var tween = Tween(start)\n .ease(options.ease || 'out-circ')\n .to({ top: y, left: x })\n .duration(options.duration || 1000);\n\n // scroll\n tween.update(function(o){\n window.scrollTo(o.left | 0, o.top | 0);\n });\n\n // handle end\n tween.on('end', function(){\n animate = function(){};\n });\n\n // animate\n function animate() {\n raf(animate);\n tween.update();\n }\n\n animate();\n\n return tween;\n}\n\nmodule.exports = scrollTo;\n\n},{\"./tween\":15,\"raf\":9}],15:[function(require,module,exports){\nvar ease = require('./ease');\nvar Emitter = require('./emitter');\n\nfunction Tween(obj) {\n if (!(this instanceof Tween)) return new Tween(obj);\n this._from = obj;\n this.ease('linear');\n this.duration(500);\n}\n\nEmitter(Tween.prototype);\n\nTween.prototype.reset = function(){\n this.isArray = Object.prototype.toString.call(this._from) === '[object Array]';\n this._curr = Object.assign({}, this._from);\n this._done = false;\n this._start = Date.now();\n return this;\n};\n\nTween.prototype.to = function(obj){\n this.reset();\n this._to = obj;\n return this;\n};\n\nTween.prototype.duration = function(ms){\n this._duration = ms;\n return this;\n};\n\nTween.prototype.ease = function(fn){\n fn = 'function' == typeof fn ? fn : ease[fn];\n if (!fn) throw new TypeError('invalid easing function');\n this._ease = fn;\n return this;\n};\n\nTween.prototype.stop = function(){\n this.stopped = true;\n this._done = true;\n this.emit('stop');\n this.emit('end');\n return this;\n};\n\nTween.prototype.step = function(){\n if (this._done) return;\n\n var duration = this._duration;\n var now = Date.now();\n var delta = now - this._start;\n var done = delta >= duration;\n\n if (done) {\n this._from = this._to;\n this._update(this._to);\n this._done = true;\n this.emit('end');\n return this;\n }\n\n var from = this._from;\n var to = this._to;\n var curr = this._curr;\n var fn = this._ease;\n var p = (now - this._start) / duration;\n var n = fn(p);\n\n if (this.isArray) {\n for (var i = 0; i < from.length; ++i) {\n curr[i] = from[i] + (to[i] - from[i]) * n;\n }\n\n this._update(curr);\n return this;\n }\n\n for (var k in from) {\n curr[k] = from[k] + (to[k] - from[k]) * n;\n }\n\n this._update(curr);\n return this;\n};\n\nTween.prototype.update = function(fn){\n if (0 == arguments.length) return this.step();\n this._update = fn;\n return this;\n};\n\nmodule.exports = Tween;\n},{\"./ease\":11,\"./emitter\":12}],16:[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":["forms-api.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","obj","_conditionalElements","__esModule","default","form","eventName","errors","data","timeStart","pageHeight","mc4wp","window","Gator","forms","config","mc4wp_forms_config","scrollToElement","scrollToForm","animate","auto_scroll","element","duration","alignment","document","body","on","event","getByElement","target","srcElement","defaultPrevented","trigger","id","started","init","listeners","callback","submitted_form","formConfig","getElementById","element_id","Date","now","clientHeight","setData","scrollY","addEventListener","timeElapsed","./forms/conditional-elements.js","./forms/forms.js","gator","scroll-to-element","2","toggleElement","el","show","getAttribute","conditions","split","fieldName","expectedValues","values","inputs","querySelectorAll","input","type","checked","push","value","getFieldValues","bubbleElement","parentElement","tagName","findForm","conditionMet","indexOf","style","display","forEach","required","removeAttribute","setAttribute","evaluate","elements","handleInputEvent","evt","className","Object","defineProperty","_default","3","serialize","populate","Form","this","createElement","name","prototype","console","error","getData","hash","empty","getSerializedData","setResponse","msg","querySelector","innerHTML","reset","form-serialize","populate.js","4","EventEmitter","events","createFromElement","formElement","parseInt","all","get","formId","bind","eventArgs","setTimeout","off","./form.js","wolfy87-eventemitter","5","k_r_submitter","k_r_success_contrls","brackets","hash_serializer","result","key","match","hash_assign","keys","shift","between","Array","isArray","_values","string","index","isNaN","children","RegExp","exec","parse_keys","existing","str_serialize","replace","encodeURIComponent","options","serializer","radio_store","create","disabled","test","nodeName","val","selectOptions","isSelectedOptions","j","option","allowedEmpty","hasValue","selected","slice","6","_matcher","_level","_id","_handlers","_gatorInstances","_matchesSelector","selector","boundElement","matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","matchesSelector","parentNode","_removeHandler","splice","hasOwnProperty","_bind","remove","addEvent","_getGlobalCallback","matchesEvent","stopPropagation","cancelBubble","cancel","_handleEvent","preventDefault","useCapture","7","root","basename","constructor","namedItem","k","toString","toISOString","amd","8","cachedSetTimeout","cachedClearTimeout","process","defaultSetTimout","defaultClearTimeout","runTimeout","fun","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","concat","drainQueue","timeout","len","run","marker","runClearTimeout","Item","array","noop","nextTick","args","arguments","apply","title","browser","env","argv","version","versions","addListener","once","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","binding","cwd","chdir","dir","umask","9","global","vendors","suffix","raf","caf","last","_now","next","Math","max","cp","cancelled","round","handle","fn","polyfill","object","requestAnimationFrame","cancelAnimationFrame","self","performance-now","10","getNanoSeconds","hrtime","loadTime","moduleLoadTime","nodeLoadTime","upTime","performance","hr","uptime","getTime","_process","11","linear","inQuad","outQuad","inOutQuad","inCube","outCube","inOutCube","inQuart","outQuart","inOutQuart","inQuint","outQuint","inOutQuint","inSine","cos","PI","outSine","sin","inOutSine","inExpo","pow","outExpo","inOutExpo","inCirc","sqrt","outCirc","inOutCirc","inBack","outBack","inOutBack","s","inBounce","outBounce","inOutBounce","inElastic","asin","outElastic","inOutElastic","12","Emitter","mixin","_callbacks","removeEventListener","cb","callbacks","hasListeners","13","scroll","elem","additionalOffset","scrollPosition","html","documentElement","elemRect","getBoundingClientRect","documentHeight","scrollHeight","offsetHeight","bottom","height","top","maxScrollPosition","min","pageYOffset","calculateScrollOffset","offset","align","./scroll-to","14","Tween","x","y","start","scrollTop","left","pageXOffset","scrollLeft","tween","ease","to","update","scrollTo","./tween","15","_from","_curr","assign","_done","_start","_to","ms","_duration","TypeError","_ease","stop","stopped","step","_update","from","curr","./ease","./emitter","16","proto","originalGlobalValue","indexOfListener","listener","alias","getListeners","response","_getEvents","flattenListeners","flatListeners","getListenersAsObject","isValidListener","listenerIsWrapped","addOnceListener","defineEvent","defineEvents","evts","addListeners","manipulateListeners","removeListeners","single","multiple","removeEvent","_events","emitEvent","listenersMap","_getOnceReturnValue","setOnceReturnValue","_onceReturnValue","noConflict"],"mappings":"CAAA,WAAe,IAA6BA,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,GAA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AAKqJ,eAAe9J,EAAKqT,EAASA,UAG3BA,EAASA,SAAShK,MAAM5I,KAAM0I,GAAQ,MAEhC1I,KAAKmU,uBAClBnU,KAAKqJ,eAAe9J,EAAKqT,EAASA,UAMlD,OAAO5S,MAMXyS,EAAMxW,QAAU4W,EAAM,aAUtBJ,EAAMlJ,KAAO,SAAchK,GACvB,IAAImJ,EAAO9F,MAAMzC,UAAUsE,MAAM5K,KAAK8O,UAAW,GACjD,OAAO3I,KAAKiU,UAAU1U,EAAKmJ,IAW/B+J,EAAM2B,mBAAqB,SAA4B9V,GAEnD,OADA0B,KAAKqU,iBAAmB/V,EACjB0B,MAWXyS,EAAM0B,oBAAsB,WACxB,OAAInU,KAAK4F,eAAe,qBACb5F,KAAKqU,kBAapB5B,EAAMO,WAAa,WACf,OAAOhT,KAAKgU,UAAYhU,KAAKgU,QAAU,KAQ3C9S,EAAaoT,WAAa,WAEtB,OADA1a,EAAQsH,aAAewR,EAChBxR,GAIW,mBAAXrI,GAAyBA,EAAOmO,IACvCnO,EAAO,WACH,OAAOqI,IAGY,iBAAXjH,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAUsH,EAGjBtH,EAAQsH,aAAeA,EA5d9B,CA8dmB,oBAAXrG,OAAyBA,OAASmF,MAAQ,KAEjD,KAAK,GAAG,CAAC,IA9yEX","file":"forms-api.min.js","sourcesContent":["(function () { var require = 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'; // deps & vars\n\nvar _conditionalElements = _interopRequireDefault(require(\"./forms/conditional-elements.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mc4wp = window.mc4wp || {};\n\nvar Gator = require('gator');\n\nvar forms = require('./forms/forms.js');\n\nvar config = window.mc4wp_forms_config || {};\n\nvar scrollToElement = require('scroll-to-element');\n\n// funcs\nfunction scrollToForm(form) {\n var animate = config.auto_scroll === 'animated';\n scrollToElement(form.element, {\n duration: animate ? 800 : 1,\n alignment: 'middle'\n });\n}\n\nfunction handleFormRequest(form, eventName, errors, data) {\n var timeStart = Date.now();\n var pageHeight = document.body.clientHeight; // re-populate form\n\n if (errors) {\n form.setData(data);\n } // scroll to form\n\n\n if (window.scrollY <= 10 && config.auto_scroll) {\n scrollToForm(form);\n } // trigger events on window.load so all other scripts have loaded\n\n\n window.addEventListener('load', function () {\n // trigger events\n forms.trigger(form.id + '.submitted', [form]);\n forms.trigger('submitted', [form]);\n\n if (errors) {\n forms.trigger(form.id + '.error', [form, errors]);\n forms.trigger('error', [form, errors]);\n } else {\n // form was successfully submitted\n forms.trigger(form.id + '.success', [form, data]);\n forms.trigger('success', [form, data]); // subscribed / unsubscribed\n\n forms.trigger(form.id + \".\" + eventName, [form, data]);\n forms.trigger(eventName, [form, data]); // for BC: always trigger \"subscribed\" event when firing \"updated_subscriber\" event\n\n if (eventName === 'updated_subscriber') {\n forms.trigger(form.id + \".\" + \"subscribed\", [form, data, true]);\n forms.trigger('subscribed', [form, data, true]);\n }\n } // scroll to form again if page height changed since last scroll, eg because of slow loading images\n // (only if load didn't take more than 0.8 seconds to prevent overtaking user scroll)\n\n\n var timeElapsed = Date.now() - timeStart;\n\n if (config.auto_scroll && timeElapsed > 1000 && timeElapsed < 2000 && document.body.clientHeight !== pageHeight) {\n scrollToForm(form);\n }\n });\n} // Bind browser events to form events (using delegation)\n\n\nGator(document.body).on('submit', '.mc4wp-form', function (event) {\n var form = forms.getByElement(event.target || event.srcElement);\n\n if (!event.defaultPrevented) {\n forms.trigger(form.id + '.submit', [form, event]);\n }\n\n if (!event.defaultPrevented) {\n forms.trigger('submit', [form, event]);\n }\n});\nGator(document.body).on('focus', '.mc4wp-form', function (event) {\n var form = forms.getByElement(event.target || event.srcElement);\n\n if (!form.started) {\n forms.trigger(form.id + '.started', [form, event]);\n forms.trigger('started', [form, event]);\n form.started = true;\n }\n});\nGator(document.body).on('change', '.mc4wp-form', function (event) {\n var form = forms.getByElement(event.target || event.srcElement);\n forms.trigger('change', [form, event]);\n forms.trigger(form.id + '.change', [form, event]);\n}); // init conditional elements\n\n_conditionalElements.default.init(); // register early listeners\n\n\nif (mc4wp.listeners) {\n var listeners = mc4wp.listeners;\n\n for (var i = 0; i < listeners.length; i++) {\n forms.on(listeners[i].event, listeners[i].callback);\n } // delete temp listeners array, so we don't bind twice\n\n\n delete mc4wp[\"listeners\"];\n} // expose forms object\n\n\nmc4wp.forms = forms; // handle submitted form\n\nif (config.submitted_form) {\n var formConfig = config.submitted_form,\n element = document.getElementById(formConfig.element_id),\n form = forms.getByElement(element);\n handleFormRequest(form, formConfig.event, formConfig.errors, formConfig.data);\n} // expose mc4wp object globally\n\n\nwindow.mc4wp = mc4wp;\n\n},{\"./forms/conditional-elements.js\":2,\"./forms/forms.js\":4,\"gator\":6,\"scroll-to-element\":13}],2:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction getFieldValues(form, fieldName) {\n var values = [];\n var inputs = form.querySelectorAll('input[name=\"' + fieldName + '\"], select[name=\"' + fieldName + '\"], textarea[name=\"' + fieldName + '\"]');\n\n for (var i = 0; i < inputs.length; i++) {\n var input = inputs[i];\n var type = input.getAttribute(\"type\");\n\n if ((type === \"radio\" || type === \"checkbox\") && !input.checked) {\n continue;\n }\n\n values.push(input.value);\n }\n\n return values;\n}\n\nfunction findForm(element) {\n var bubbleElement = element;\n\n while (bubbleElement.parentElement) {\n bubbleElement = bubbleElement.parentElement;\n\n if (bubbleElement.tagName === 'FORM') {\n return bubbleElement;\n }\n }\n\n return null;\n}\n\nfunction toggleElement(el) {\n var show = !!el.getAttribute('data-show-if');\n var conditions = show ? el.getAttribute('data-show-if').split(':') : el.getAttribute('data-hide-if').split(':');\n var fieldName = conditions[0];\n var expectedValues = (conditions.length > 1 ? conditions[1] : \"*\").split('|');\n var form = findForm(el);\n var values = getFieldValues(form, fieldName); // determine whether condition is met\n\n var conditionMet = false;\n\n for (var i = 0; i < values.length; i++) {\n var value = values[i]; // condition is met when value is in array of expected values OR expected values contains a wildcard and value is not empty\n\n conditionMet = expectedValues.indexOf(value) > -1 || expectedValues.indexOf('*') > -1 && value.length > 0;\n\n if (conditionMet) {\n break;\n }\n } // toggle element display\n\n\n if (show) {\n el.style.display = conditionMet ? '' : 'none';\n } else {\n el.style.display = conditionMet ? 'none' : '';\n } // find all inputs inside this element and toggle [required] attr (to prevent HTML5 validation on hidden elements)\n\n\n var inputs = el.querySelectorAll('input, select, textarea');\n [].forEach.call(inputs, function (el) {\n if ((conditionMet || show) && el.getAttribute('data-was-required')) {\n el.required = true;\n el.removeAttribute('data-was-required');\n }\n\n if ((!conditionMet || !show) && el.required) {\n el.setAttribute('data-was-required', \"true\");\n el.required = false;\n }\n });\n} // evaluate conditional elements globally\n\n\nfunction evaluate() {\n var elements = document.querySelectorAll('.mc4wp-form [data-show-if], .mc4wp-form [data-hide-if]');\n [].forEach.call(elements, toggleElement);\n} // re-evaluate conditional elements for change events on forms\n\n\nfunction handleInputEvent(evt) {\n if (!evt.target || !evt.target.form || evt.target.form.className.indexOf('mc4wp-form') < 0) {\n return;\n }\n\n var form = evt.target.form;\n var elements = form.querySelectorAll('[data-show-if], [data-hide-if]');\n [].forEach.call(elements, toggleElement);\n}\n\nvar _default = {\n 'init': function init() {\n document.addEventListener('keyup', handleInputEvent, true);\n document.addEventListener('change', handleInputEvent, true);\n document.addEventListener('mc4wp-refresh', evaluate, true);\n window.addEventListener('load', evaluate);\n evaluate();\n }\n};\nexports.default = _default;\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar serialize = require('form-serialize');\n\nvar populate = require('populate.js');\n\nvar Form = function Form(id, element) {\n this.id = id;\n this.element = element || document.createElement('form');\n this.name = this.element.getAttribute('data-name') || \"Form #\" + this.id;\n this.errors = [];\n this.started = false;\n};\n\nForm.prototype.setData = function (data) {\n try {\n populate(this.element, data);\n } catch (e) {\n console.error(e);\n }\n};\n\nForm.prototype.getData = function () {\n return serialize(this.element, {\n hash: true,\n empty: true\n });\n};\n\nForm.prototype.getSerializedData = function () {\n return serialize(this.element, {\n hash: false,\n empty: true\n });\n};\n\nForm.prototype.setResponse = function (msg) {\n this.element.querySelector('.mc4wp-response').innerHTML = msg;\n}; // revert back to original state\n\n\nForm.prototype.reset = function () {\n this.setResponse('');\n this.element.querySelector('.mc4wp-form-fields').style.display = '';\n this.element.reset();\n};\n\nmodule.exports = Form;\n\n},{\"form-serialize\":5,\"populate.js\":7}],4:[function(require,module,exports){\n'use strict'; // deps\n\nvar EventEmitter = require('wolfy87-eventemitter');\n\nvar Form = require('./form.js'); // variables\n\n\nvar events = new EventEmitter();\nvar forms = []; // get form by its id\n// please note that this will get the FIRST occurence of the form with that ID on the page\n\nfunction get(formId) {\n formId = parseInt(formId); // do we have form for this one already?\n\n for (var i = 0; i < forms.length; i++) {\n if (forms[i].id === formId) {\n return forms[i];\n }\n } // try to create from first occurence of this element\n\n\n var formElement = document.querySelector('.mc4wp-form-' + formId);\n return createFromElement(formElement, formId);\n} // get form by <form> element (or any input in form)\n\n\nfunction getByElement(element) {\n var formElement = element.form || element;\n\n for (var i = 0; i < forms.length; i++) {\n if (forms[i].element === formElement) {\n return forms[i];\n }\n }\n\n return createFromElement(formElement);\n} // create form object from <form> element\n\n\nfunction createFromElement(formElement, id) {\n id = id || parseInt(formElement.getAttribute('data-id')) || 0;\n var form = new Form(id, formElement);\n forms.push(form);\n return form;\n}\n\nfunction all() {\n return forms;\n}\n\nfunction triggerEvent(eventName, eventArgs) {\n if (eventName === 'submit' || eventName.indexOf('.submit') > 0) {\n // don't spin up new thread for submit event as we want to preventDefault()... \n events.trigger(eventName, eventArgs);\n } else {\n // process in separate thread to prevent errors from breaking core functionality\n window.setTimeout(function () {\n events.trigger(eventName, eventArgs);\n }, 1);\n }\n}\n\nmodule.exports = {\n \"all\": all,\n \"get\": get,\n \"getByElement\": getByElement,\n \"on\": events.on.bind(events),\n \"trigger\": triggerEvent,\n \"off\": events.off.bind(events)\n};\n\n},{\"./form.js\":3,\"wolfy87-eventemitter\":16}],5:[function(require,module,exports){\n// get successful control from form and assemble into object\n// http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2\n\n// types which indicate a submit action and are not successful controls\n// these will be ignored\nvar k_r_submitter = /^(?:submit|button|image|reset|file)$/i;\n\n// node names which could be successful controls\nvar k_r_success_contrls = /^(?:input|select|textarea|keygen)/i;\n\n// Matches bracket notation.\nvar brackets = /(\\[[^\\[\\]]*\\])/g;\n\n// serializes form fields\n// @param form MUST be an HTMLForm element\n// @param options is an optional argument to configure the serialization. Default output\n// with no options specified is a url encoded string\n// - hash: [true | false] Configure the output type. If true, the output will\n// be a js object.\n// - serializer: [function] Optional serializer function to override the default one.\n// The function takes 3 arguments (result, key, value) and should return new result\n// hash and url encoded str serializers are provided with this module\n// - disabled: [true | false]. If true serialize disabled fields.\n// - empty: [true | false]. If true serialize empty fields\nfunction serialize(form, options) {\n if (typeof options != 'object') {\n options = { hash: !!options };\n }\n else if (options.hash === undefined) {\n options.hash = true;\n }\n\n var result = (options.hash) ? {} : '';\n var serializer = options.serializer || ((options.hash) ? hash_serializer : str_serialize);\n\n var elements = form && form.elements ? form.elements : [];\n\n //Object store each radio and set if it's empty or not\n var radio_store = Object.create(null);\n\n for (var i=0 ; i<elements.length ; ++i) {\n var element = elements[i];\n\n // ingore disabled fields\n if ((!options.disabled && element.disabled) || !element.name) {\n continue;\n }\n // ignore anyhting that is not considered a success field\n if (!k_r_success_contrls.test(element.nodeName) ||\n k_r_submitter.test(element.type)) {\n continue;\n }\n\n var key = element.name;\n var val = element.value;\n\n // we can't just use element.value for checkboxes cause some browsers lie to us\n // they say \"on\" for value when the box isn't checked\n if ((element.type === 'checkbox' || element.type === 'radio') && !element.checked) {\n val = undefined;\n }\n\n // If we want empty elements\n if (options.empty) {\n // for checkbox\n if (element.type === 'checkbox' && !element.checked) {\n val = '';\n }\n\n // for radio\n if (element.type === 'radio') {\n if (!radio_store[element.name] && !element.checked) {\n radio_store[element.name] = false;\n }\n else if (element.checked) {\n radio_store[element.name] = true;\n }\n }\n\n // if options empty is true, continue only if its radio\n if (val == undefined && element.type == 'radio') {\n continue;\n }\n }\n else {\n // value-less fields are ignored unless options.empty is true\n if (!val) {\n continue;\n }\n }\n\n // multi select boxes\n if (element.type === 'select-multiple') {\n val = [];\n\n var selectOptions = element.options;\n var isSelectedOptions = false;\n for (var j=0 ; j<selectOptions.length ; ++j) {\n var option = selectOptions[j];\n var allowedEmpty = options.empty && !option.value;\n var hasValue = (option.value || allowedEmpty);\n if (option.selected && hasValue) {\n isSelectedOptions = true;\n\n // If using a hash serializer be sure to add the\n // correct notation for an array in the multi-select\n // context. Here the name attribute on the select element\n // might be missing the trailing bracket pair. Both names\n // \"foo\" and \"foo[]\" should be arrays.\n if (options.hash && key.slice(key.length - 2) !== '[]') {\n result = serializer(result, key + '[]', option.value);\n }\n else {\n result = serializer(result, key, option.value);\n }\n }\n }\n\n // Serialize if no selected options and options.empty is true\n if (!isSelectedOptions && options.empty) {\n result = serializer(result, key, '');\n }\n\n continue;\n }\n\n result = serializer(result, key, val);\n }\n\n // Check for all empty radio buttons and serialize them with key=\"\"\n if (options.empty) {\n for (var key in radio_store) {\n if (!radio_store[key]) {\n result = serializer(result, key, '');\n }\n }\n }\n\n return result;\n}\n\nfunction parse_keys(string) {\n var keys = [];\n var prefix = /^([^\\[\\]]*)/;\n var children = new RegExp(brackets);\n var match = prefix.exec(string);\n\n if (match[1]) {\n keys.push(match[1]);\n }\n\n while ((match = children.exec(string)) !== null) {\n keys.push(match[1]);\n }\n\n return keys;\n}\n\nfunction hash_assign(result, keys, value) {\n if (keys.length === 0) {\n result = value;\n return result;\n }\n\n var key = keys.shift();\n var between = key.match(/^\\[(.+?)\\]$/);\n\n if (key === '[]') {\n result = result || [];\n\n if (Array.isArray(result)) {\n result.push(hash_assign(null, keys, value));\n }\n else {\n // This might be the result of bad name attributes like \"[][foo]\",\n // in this case the original `result` object will already be\n // assigned to an object literal. Rather than coerce the object to\n // an array, or cause an exception the attribute \"_values\" is\n // assigned as an array.\n result._values = result._values || [];\n result._values.push(hash_assign(null, keys, value));\n }\n\n return result;\n }\n\n // Key is an attribute name and can be assigned directly.\n if (!between) {\n result[key] = hash_assign(result[key], keys, value);\n }\n else {\n var string = between[1];\n // +var converts the variable into a number\n // better than parseInt because it doesn't truncate away trailing\n // letters and actually fails if whole thing is not a number\n var index = +string;\n\n // If the characters between the brackets is not a number it is an\n // attribute name and can be assigned directly.\n if (isNaN(index)) {\n result = result || {};\n result[string] = hash_assign(result[string], keys, value);\n }\n else {\n result = result || [];\n result[index] = hash_assign(result[index], keys, value);\n }\n }\n\n return result;\n}\n\n// Object/hash encoding serializer.\nfunction hash_serializer(result, key, value) {\n var matches = key.match(brackets);\n\n // Has brackets? Use the recursive assignment function to walk the keys,\n // construct any missing objects in the result tree and make the assignment\n // at the end of the chain.\n if (matches) {\n var keys = parse_keys(key);\n hash_assign(result, keys, value);\n }\n else {\n // Non bracket notation can make assignments directly.\n var existing = result[key];\n\n // If the value has been assigned already (for instance when a radio and\n // a checkbox have the same name attribute) convert the previous value\n // into an array before pushing into it.\n //\n // NOTE: If this requirement were removed all hash creation and\n // assignment could go through `hash_assign`.\n if (existing) {\n if (!Array.isArray(existing)) {\n result[key] = [ existing ];\n }\n\n result[key].push(value);\n }\n else {\n result[key] = value;\n }\n }\n\n return result;\n}\n\n// urlform encoding serializer\nfunction str_serialize(result, key, value) {\n // encode newlines as \\r\\n cause the html spec says so\n value = value.replace(/(\\r)?\\n/g, '\\r\\n');\n value = encodeURIComponent(value);\n\n // spaces should be '+' rather than '%20'.\n value = value.replace(/%20/g, '+');\n return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + value;\n}\n\nmodule.exports = serialize;\n\n},{}],6:[function(require,module,exports){\n/**\n * Copyright 2014 Craig Campbell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * GATOR.JS\n * Simple Event Delegation\n *\n * @version 1.2.4\n *\n * Compatible with IE 9+, FF 3.6+, Safari 5+, Chrome\n *\n * Include legacy.js for compatibility with older browsers\n *\n * .-._ _ _ _ _ _ _ _ _\n * .-''-.__.-'00 '-' ' ' ' ' ' ' ' '-.\n * '.___ ' . .--_'-' '-' '-' _'-' '._\n * V: V 'vv-' '_ '. .' _..' '.'.\n * '=.____.=_.--' :_.__.__:_ '. : :\n * (((____.-' '-. / : :\n * (((-'\\ .' /\n * _____..' .'\n * '-._____.-'\n */\n(function() {\n var _matcher,\n _level = 0,\n _id = 0,\n _handlers = {},\n _gatorInstances = {};\n\n function _addEvent(gator, type, callback) {\n\n // blur and focus do not bubble up but if you use event capturing\n // then you will get them\n var useCapture = type == 'blur' || type == 'focus';\n gator.element.addEventListener(type, callback, useCapture);\n }\n\n function _cancel(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n /**\n * returns function to use for determining if an element\n * matches a query selector\n *\n * @returns {Function}\n */\n function _getMatcher(element) {\n if (_matcher) {\n return _matcher;\n }\n\n if (element.matches) {\n _matcher = element.matches;\n return _matcher;\n }\n\n if (element.webkitMatchesSelector) {\n _matcher = element.webkitMatchesSelector;\n return _matcher;\n }\n\n if (element.mozMatchesSelector) {\n _matcher = element.mozMatchesSelector;\n return _matcher;\n }\n\n if (element.msMatchesSelector) {\n _matcher = element.msMatchesSelector;\n return _matcher;\n }\n\n if (element.oMatchesSelector) {\n _matcher = element.oMatchesSelector;\n return _matcher;\n }\n\n // if it doesn't match a native browser method\n // fall back to the gator function\n _matcher = Gator.matchesSelector;\n return _matcher;\n }\n\n /**\n * determines if the specified element matches a given selector\n *\n * @param {Node} element - the element to compare against the selector\n * @param {string} selector\n * @param {Node} boundElement - the element the listener was attached to\n * @returns {void|Node}\n */\n function _matchesSelector(element, selector, boundElement) {\n\n // no selector means this event was bound directly to this element\n if (selector == '_root') {\n return boundElement;\n }\n\n // if we have moved up to the element you bound the event to\n // then we have come too far\n if (element === boundElement) {\n return;\n }\n\n // if this is a match then we are done!\n if (_getMatcher(element).call(element, selector)) {\n return element;\n }\n\n // if this element did not match but has a parent we should try\n // going up the tree to see if any of the parent elements match\n // for example if you are looking for a click on an <a> tag but there\n // is a <span> inside of the a tag that it is the target,\n // it should still work\n if (element.parentNode) {\n _level++;\n return _matchesSelector(element.parentNode, selector, boundElement);\n }\n }\n\n function _addHandler(gator, event, selector, callback) {\n if (!_handlers[gator.id]) {\n _handlers[gator.id] = {};\n }\n\n if (!_handlers[gator.id][event]) {\n _handlers[gator.id][event] = {};\n }\n\n if (!_handlers[gator.id][event][selector]) {\n _handlers[gator.id][event][selector] = [];\n }\n\n _handlers[gator.id][event][selector].push(callback);\n }\n\n function _removeHandler(gator, event, selector, callback) {\n\n // if there are no events tied to this element at all\n // then don't do anything\n if (!_handlers[gator.id]) {\n return;\n }\n\n // if there is no event type specified then remove all events\n // example: Gator(element).off()\n if (!event) {\n for (var type in _handlers[gator.id]) {\n if (_handlers[gator.id].hasOwnProperty(type)) {\n _handlers[gator.id][type] = {};\n }\n }\n return;\n }\n\n // if no callback or selector is specified remove all events of this type\n // example: Gator(element).off('click')\n if (!callback && !selector) {\n _handlers[gator.id][event] = {};\n return;\n }\n\n // if a selector is specified but no callback remove all events\n // for this selector\n // example: Gator(element).off('click', '.sub-element')\n if (!callback) {\n delete _handlers[gator.id][event][selector];\n return;\n }\n\n // if we have specified an event type, selector, and callback then we\n // need to make sure there are callbacks tied to this selector to\n // begin with. if there aren't then we can stop here\n if (!_handlers[gator.id][event][selector]) {\n return;\n }\n\n // if there are then loop through all the callbacks and if we find\n // one that matches remove it from the array\n for (var i = 0; i < _handlers[gator.id][event][selector].length; i++) {\n if (_handlers[gator.id][event][selector][i] === callback) {\n _handlers[gator.id][event][selector].splice(i, 1);\n break;\n }\n }\n }\n\n function _handleEvent(id, e, type) {\n if (!_handlers[id][type]) {\n return;\n }\n\n var target = e.target || e.srcElement,\n selector,\n match,\n matches = {},\n i = 0,\n j = 0;\n\n // find all events that match\n _level = 0;\n for (selector in _handlers[id][type]) {\n if (_handlers[id][type].hasOwnProperty(selector)) {\n match = _matchesSelector(target, selector, _gatorInstances[id].element);\n\n if (match && Gator.matchesEvent(type, _gatorInstances[id].element, match, selector == '_root', e)) {\n _level++;\n _handlers[id][type][selector].match = match;\n matches[_level] = _handlers[id][type][selector];\n }\n }\n }\n\n // stopPropagation() fails to set cancelBubble to true in Webkit\n // @see http://code.google.com/p/chromium/issues/detail?id=162270\n e.stopPropagation = function() {\n e.cancelBubble = true;\n };\n\n for (i = 0; i <= _level; i++) {\n if (matches[i]) {\n for (j = 0; j < matches[i].length; j++) {\n if (matches[i][j].call(matches[i].match, e) === false) {\n Gator.cancel(e);\n return;\n }\n\n if (e.cancelBubble) {\n return;\n }\n }\n }\n }\n }\n\n /**\n * binds the specified events to the element\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @param {boolean=} remove\n * @returns {Object}\n */\n function _bind(events, selector, callback, remove) {\n\n // fail silently if you pass null or undefined as an alement\n // in the Gator constructor\n if (!this.element) {\n return;\n }\n\n if (!(events instanceof Array)) {\n events = [events];\n }\n\n if (!callback && typeof(selector) == 'function') {\n callback = selector;\n selector = '_root';\n }\n\n var id = this.id,\n i;\n\n function _getGlobalCallback(type) {\n return function(e) {\n _handleEvent(id, e, type);\n };\n }\n\n for (i = 0; i < events.length; i++) {\n if (remove) {\n _removeHandler(this, events[i], selector, callback);\n continue;\n }\n\n if (!_handlers[id] || !_handlers[id][events[i]]) {\n Gator.addEvent(this, events[i], _getGlobalCallback(events[i]));\n }\n\n _addHandler(this, events[i], selector, callback);\n }\n\n return this;\n }\n\n /**\n * Gator object constructor\n *\n * @param {Node} element\n */\n function Gator(element, id) {\n\n // called as function\n if (!(this instanceof Gator)) {\n // only keep one Gator instance per node to make sure that\n // we don't create a ton of new objects if you want to delegate\n // multiple events from the same node\n //\n // for example: Gator(document).on(...\n for (var key in _gatorInstances) {\n if (_gatorInstances[key].element === element) {\n return _gatorInstances[key];\n }\n }\n\n _id++;\n _gatorInstances[_id] = new Gator(element, _id);\n\n return _gatorInstances[_id];\n }\n\n this.element = element;\n this.id = id;\n }\n\n /**\n * adds an event\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @returns {Object}\n */\n Gator.prototype.on = function(events, selector, callback) {\n return _bind.call(this, events, selector, callback);\n };\n\n /**\n * removes an event\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @returns {Object}\n */\n Gator.prototype.off = function(events, selector, callback) {\n return _bind.call(this, events, selector, callback, true);\n };\n\n Gator.matchesSelector = function() {};\n Gator.cancel = _cancel;\n Gator.addEvent = _addEvent;\n Gator.matchesEvent = function() {\n return true;\n };\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Gator;\n }\n\n window.Gator = Gator;\n}) ();\n\n},{}],7:[function(require,module,exports){\n/*! populate.js v1.0.2 by @dannyvankooten | MIT license */\n;(function(root) {\n\n\t/**\n\t * Populate form fields from a JSON object.\n\t *\n\t * @param form object The form element containing your input fields.\n\t * @param data array JSON data to populate the fields with.\n\t * @param basename string Optional basename which is added to `name` attributes\n\t */\n\tvar populate = function( form, data, basename) {\n\n\t\tfor(var key in data) {\n\n\t\t\tif( ! data.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar name = key;\n\t\t\tvar value = data[key];\n\n if ('undefined' === typeof value) {\n value = '';\n }\n\n if (null === value) {\n value = '';\n }\n\n\t\t\t// handle array name attributes\n\t\t\tif(typeof(basename) !== \"undefined\") {\n\t\t\t\tname = basename + \"[\" + key + \"]\";\n\t\t\t}\n\n\t\t\tif(value.constructor === Array) {\n\t\t\t\tname += '[]';\n\t\t\t} else if(typeof value == \"object\") {\n\t\t\t\tpopulate( form, value, name);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// only proceed if element is set\n\t\t\tvar element = form.elements.namedItem( name );\n\t\t\tif( ! element ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar type = element.type || element[0].type;\n\n\t\t\tswitch(type ) {\n\t\t\t\tdefault:\n\t\t\t\t\telement.value = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'radio':\n\t\t\t\tcase 'checkbox':\n\t\t\t\t\tfor( var j=0; j < element.length; j++ ) {\n\t\t\t\t\t\telement[j].checked = ( value.indexOf(element[j].value) > -1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'select-multiple':\n\t\t\t\t\tvar values = value.constructor == Array ? value : [value];\n\n\t\t\t\t\tfor(var k = 0; k < element.options.length; k++) {\n\t\t\t\t\t\telement.options[k].selected |= (values.indexOf(element.options[k].value) > -1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'select':\n\t\t\t\tcase 'select-one':\n\t\t\t\t\telement.value = value.toString() || value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'date':\n \t\t\t\telement.value = new Date(value).toISOString().split('T')[0];\t\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\t// Play nice with AMD, CommonJS or a plain global object.\n\tif ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) {\n\t\tdefine(function() {\n\t\t\treturn populate;\n\t\t});\n\t}\telse if ( typeof module !== 'undefined' && module.exports ) {\n\t\tmodule.exports = populate;\n\t} else {\n\t\troot.populate = populate;\n\t}\n\n}(this));\n\n},{}],8:[function(require,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],9:[function(require,module,exports){\n(function (global){\nvar now = require('performance-now')\n , root = typeof window === 'undefined' ? global : window\n , vendors = ['moz', 'webkit']\n , suffix = 'AnimationFrame'\n , raf = root['request' + suffix]\n , caf = root['cancel' + suffix] || root['cancelRequest' + suffix]\n\nfor(var i = 0; !raf && i < vendors.length; i++) {\n raf = root[vendors[i] + 'Request' + suffix]\n caf = root[vendors[i] + 'Cancel' + suffix]\n || root[vendors[i] + 'CancelRequest' + suffix]\n}\n\n// Some versions of FF have rAF but not cAF\nif(!raf || !caf) {\n var last = 0\n , id = 0\n , queue = []\n , frameDuration = 1000 / 60\n\n raf = function(callback) {\n if(queue.length === 0) {\n var _now = now()\n , next = Math.max(0, frameDuration - (_now - last))\n last = next + _now\n setTimeout(function() {\n var cp = queue.slice(0)\n // Clear queue here to prevent\n // callbacks from appending listeners\n // to the current frame's queue\n queue.length = 0\n for(var i = 0; i < cp.length; i++) {\n if(!cp[i].cancelled) {\n try{\n cp[i].callback(last)\n } catch(e) {\n setTimeout(function() { throw e }, 0)\n }\n }\n }\n }, Math.round(next))\n }\n queue.push({\n handle: ++id,\n callback: callback,\n cancelled: false\n })\n return id\n }\n\n caf = function(handle) {\n for(var i = 0; i < queue.length; i++) {\n if(queue[i].handle === handle) {\n queue[i].cancelled = true\n }\n }\n }\n}\n\nmodule.exports = function(fn) {\n // Wrap in a new function to prevent\n // `cancel` potentially being assigned\n // to the native rAF function\n return raf.call(root, fn)\n}\nmodule.exports.cancel = function() {\n caf.apply(root, arguments)\n}\nmodule.exports.polyfill = function(object) {\n if (!object) {\n object = root;\n }\n object.requestAnimationFrame = raf\n object.cancelAnimationFrame = caf\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"performance-now\":10}],10:[function(require,module,exports){\n(function (process){\n// Generated by CoffeeScript 1.12.2\n(function() {\n var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;\n\n if ((typeof performance !== \"undefined\" && performance !== null) && performance.now) {\n module.exports = function() {\n return performance.now();\n };\n } else if ((typeof process !== \"undefined\" && process !== null) && process.hrtime) {\n module.exports = function() {\n return (getNanoSeconds() - nodeLoadTime) / 1e6;\n };\n hrtime = process.hrtime;\n getNanoSeconds = function() {\n var hr;\n hr = hrtime();\n return hr[0] * 1e9 + hr[1];\n };\n moduleLoadTime = getNanoSeconds();\n upTime = process.uptime() * 1e9;\n nodeLoadTime = moduleLoadTime - upTime;\n } else if (Date.now) {\n module.exports = function() {\n return Date.now() - loadTime;\n };\n loadTime = Date.now();\n } else {\n module.exports = function() {\n return new Date().getTime() - loadTime;\n };\n loadTime = new Date().getTime();\n }\n\n}).call(this);\n\n\n\n}).call(this,require('_process'))\n},{\"_process\":8}],11:[function(require,module,exports){\n// easing functions from \"Tween.js\"\nexports.linear = function(n){\n return n;\n};\n\nexports.inQuad = function(n){\n return n * n;\n};\n\nexports.outQuad = function(n){\n return n * (2 - n);\n};\n\nexports.inOutQuad = function(n){\n n *= 2;\n if (n < 1) return 0.5 * n * n;\n return - 0.5 * (--n * (n - 2) - 1);\n};\n\nexports.inCube = function(n){\n return n * n * n;\n};\n\nexports.outCube = function(n){\n return --n * n * n + 1;\n};\n\nexports.inOutCube = function(n){\n n *= 2;\n if (n < 1) return 0.5 * n * n * n;\n return 0.5 * ((n -= 2 ) * n * n + 2);\n};\n\nexports.inQuart = function(n){\n return n * n * n * n;\n};\n\nexports.outQuart = function(n){\n return 1 - (--n * n * n * n);\n};\n\nexports.inOutQuart = function(n){\n n *= 2;\n if (n < 1) return 0.5 * n * n * n * n;\n return -0.5 * ((n -= 2) * n * n * n - 2);\n};\n\nexports.inQuint = function(n){\n return n * n * n * n * n;\n}\n\nexports.outQuint = function(n){\n return --n * n * n * n * n + 1;\n}\n\nexports.inOutQuint = function(n){\n n *= 2;\n if (n < 1) return 0.5 * n * n * n * n * n;\n return 0.5 * ((n -= 2) * n * n * n * n + 2);\n};\n\nexports.inSine = function(n){\n return 1 - Math.cos(n * Math.PI / 2 );\n};\n\nexports.outSine = function(n){\n return Math.sin(n * Math.PI / 2);\n};\n\nexports.inOutSine = function(n){\n return .5 * (1 - Math.cos(Math.PI * n));\n};\n\nexports.inExpo = function(n){\n return 0 == n ? 0 : Math.pow(1024, n - 1);\n};\n\nexports.outExpo = function(n){\n return 1 == n ? n : 1 - Math.pow(2, -10 * n);\n};\n\nexports.inOutExpo = function(n){\n if (0 == n) return 0;\n if (1 == n) return 1;\n if ((n *= 2) < 1) return .5 * Math.pow(1024, n - 1);\n return .5 * (-Math.pow(2, -10 * (n - 1)) + 2);\n};\n\nexports.inCirc = function(n){\n return 1 - Math.sqrt(1 - n * n);\n};\n\nexports.outCirc = function(n){\n return Math.sqrt(1 - (--n * n));\n};\n\nexports.inOutCirc = function(n){\n n *= 2\n if (n < 1) return -0.5 * (Math.sqrt(1 - n * n) - 1);\n return 0.5 * (Math.sqrt(1 - (n -= 2) * n) + 1);\n};\n\nexports.inBack = function(n){\n var s = 1.70158;\n return n * n * (( s + 1 ) * n - s);\n};\n\nexports.outBack = function(n){\n var s = 1.70158;\n return --n * n * ((s + 1) * n + s) + 1;\n};\n\nexports.inOutBack = function(n){\n var s = 1.70158 * 1.525;\n if ( ( n *= 2 ) < 1 ) return 0.5 * ( n * n * ( ( s + 1 ) * n - s ) );\n return 0.5 * ( ( n -= 2 ) * n * ( ( s + 1 ) * n + s ) + 2 );\n};\n\nexports.inBounce = function(n){\n return 1 - exports.outBounce(1 - n);\n};\n\nexports.outBounce = function(n){\n if ( n < ( 1 / 2.75 ) ) {\n return 7.5625 * n * n;\n } else if ( n < ( 2 / 2.75 ) ) {\n return 7.5625 * ( n -= ( 1.5 / 2.75 ) ) * n + 0.75;\n } else if ( n < ( 2.5 / 2.75 ) ) {\n return 7.5625 * ( n -= ( 2.25 / 2.75 ) ) * n + 0.9375;\n } else {\n return 7.5625 * ( n -= ( 2.625 / 2.75 ) ) * n + 0.984375;\n }\n};\n\nexports.inOutBounce = function(n){\n if (n < .5) return exports.inBounce(n * 2) * .5;\n return exports.outBounce(n * 2 - 1) * .5 + .5;\n};\n\nexports.inElastic = function(n){\n var s, a = 0.1, p = 0.4;\n if ( n === 0 ) return 0;\n if ( n === 1 ) return 1;\n if ( !a || a < 1 ) { a = 1; s = p / 4; }\n else s = p * Math.asin( 1 / a ) / ( 2 * Math.PI );\n return - ( a * Math.pow( 2, 10 * ( n -= 1 ) ) * Math.sin( ( n - s ) * ( 2 * Math.PI ) / p ) );\n};\n\nexports.outElastic = function(n){\n var s, a = 0.1, p = 0.4;\n if ( n === 0 ) return 0;\n if ( n === 1 ) return 1;\n if ( !a || a < 1 ) { a = 1; s = p / 4; }\n else s = p * Math.asin( 1 / a ) / ( 2 * Math.PI );\n return ( a * Math.pow( 2, - 10 * n) * Math.sin( ( n - s ) * ( 2 * Math.PI ) / p ) + 1 );\n};\n\nexports.inOutElastic = function(n){\n var s, a = 0.1, p = 0.4;\n if ( n === 0 ) return 0;\n if ( n === 1 ) return 1;\n if ( !a || a < 1 ) { a = 1; s = p / 4; }\n else s = p * Math.asin( 1 / a ) / ( 2 * Math.PI );\n if ( ( n *= 2 ) < 1 ) return - 0.5 * ( a * Math.pow( 2, 10 * ( n -= 1 ) ) * Math.sin( ( n - s ) * ( 2 * Math.PI ) / p ) );\n return a * Math.pow( 2, -10 * ( n -= 1 ) ) * Math.sin( ( n - s ) * ( 2 * Math.PI ) / p ) * 0.5 + 1;\n};\n\n// aliases\nexports['in-quad'] = exports.inQuad;\nexports['out-quad'] = exports.outQuad;\nexports['in-out-quad'] = exports.inOutQuad;\nexports['in-cube'] = exports.inCube;\nexports['out-cube'] = exports.outCube;\nexports['in-out-cube'] = exports.inOutCube;\nexports['in-quart'] = exports.inQuart;\nexports['out-quart'] = exports.outQuart;\nexports['in-out-quart'] = exports.inOutQuart;\nexports['in-quint'] = exports.inQuint;\nexports['out-quint'] = exports.outQuint;\nexports['in-out-quint'] = exports.inOutQuint;\nexports['in-sine'] = exports.inSine;\nexports['out-sine'] = exports.outSine;\nexports['in-out-sine'] = exports.inOutSine;\nexports['in-expo'] = exports.inExpo;\nexports['out-expo'] = exports.outExpo;\nexports['in-out-expo'] = exports.inOutExpo;\nexports['in-circ'] = exports.inCirc;\nexports['out-circ'] = exports.outCirc;\nexports['in-out-circ'] = exports.inOutCirc;\nexports['in-back'] = exports.inBack;\nexports['out-back'] = exports.outBack;\nexports['in-out-back'] = exports.inOutBack;\nexports['in-bounce'] = exports.inBounce;\nexports['out-bounce'] = exports.outBounce;\nexports['in-out-bounce'] = exports.inOutBounce;\nexports['in-elastic'] = exports.inElastic;\nexports['out-elastic'] = exports.outElastic;\nexports['in-out-elastic'] = exports.inOutElastic;\n\n},{}],12:[function(require,module,exports){\nfunction Emitter(obj) {\n if (obj) return mixin(obj);\n};\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n // Remove event specific arrays for event types that no\n // one is subscribed for to avoid memory leak.\n if (callbacks.length === 0) {\n delete this._callbacks['$' + event];\n }\n\n return this;\n};\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n var args = [].slice.call(arguments, 1)\n , callbacks = this._callbacks['$' + event];\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n\nif (typeof module !== 'undefined') {\n module.exports = Emitter;\n}\n\n},{}],13:[function(require,module,exports){\nvar scroll = require('./scroll-to');\n\nfunction calculateScrollOffset(elem, additionalOffset, alignment) {\n var body = document.body,\n html = document.documentElement;\n\n var elemRect = elem.getBoundingClientRect();\n var clientHeight = html.clientHeight;\n var documentHeight = Math.max( body.scrollHeight, body.offsetHeight,\n html.clientHeight, html.scrollHeight, html.offsetHeight );\n\n additionalOffset = additionalOffset || 0;\n\n var scrollPosition;\n if (alignment === 'bottom') {\n scrollPosition = elemRect.bottom - clientHeight;\n } else if (alignment === 'middle') {\n scrollPosition = elemRect.bottom - clientHeight / 2 - elemRect.height / 2;\n } else { // top and default\n scrollPosition = elemRect.top;\n }\n\n var maxScrollPosition = documentHeight - clientHeight;\n return Math.min(scrollPosition + additionalOffset + window.pageYOffset,\n maxScrollPosition);\n}\n\nmodule.exports = function (elem, options) {\n options = options || {};\n if (typeof elem === 'string') elem = document.querySelector(elem);\n if (elem) return scroll(0, calculateScrollOffset(elem, options.offset, options.align), options);\n};\n\n},{\"./scroll-to\":14}],14:[function(require,module,exports){\nvar Tween = require('./tween');\nvar raf = require('raf');\n\nfunction scroll() {\n var y = window.pageYOffset || document.documentElement.scrollTop;\n var x = window.pageXOffset || document.documentElement.scrollLeft;\n return { top: y, left: x };\n}\n\nfunction scrollTo(x, y, options) {\n options = options || {};\n\n // start position\n var start = scroll();\n\n // setup tween\n var tween = Tween(start)\n .ease(options.ease || 'out-circ')\n .to({ top: y, left: x })\n .duration(options.duration || 1000);\n\n // scroll\n tween.update(function(o){\n window.scrollTo(o.left | 0, o.top | 0);\n });\n\n // handle end\n tween.on('end', function(){\n animate = function(){};\n });\n\n // animate\n function animate() {\n raf(animate);\n tween.update();\n }\n\n animate();\n\n return tween;\n}\n\nmodule.exports = scrollTo;\n\n},{\"./tween\":15,\"raf\":9}],15:[function(require,module,exports){\nvar ease = require('./ease');\nvar Emitter = require('./emitter');\n\nfunction Tween(obj) {\n if (!(this instanceof Tween)) return new Tween(obj);\n this._from = obj;\n this.ease('linear');\n this.duration(500);\n}\n\nEmitter(Tween.prototype);\n\nTween.prototype.reset = function(){\n this.isArray = Object.prototype.toString.call(this._from) === '[object Array]';\n this._curr = Object.assign({}, this._from);\n this._done = false;\n this._start = Date.now();\n return this;\n};\n\nTween.prototype.to = function(obj){\n this.reset();\n this._to = obj;\n return this;\n};\n\nTween.prototype.duration = function(ms){\n this._duration = ms;\n return this;\n};\n\nTween.prototype.ease = function(fn){\n fn = 'function' == typeof fn ? fn : ease[fn];\n if (!fn) throw new TypeError('invalid easing function');\n this._ease = fn;\n return this;\n};\n\nTween.prototype.stop = function(){\n this.stopped = true;\n this._done = true;\n this.emit('stop');\n this.emit('end');\n return this;\n};\n\nTween.prototype.step = function(){\n if (this._done) return;\n\n var duration = this._duration;\n var now = Date.now();\n var delta = now - this._start;\n var done = delta >= duration;\n\n if (done) {\n this._from = this._to;\n this._update(this._to);\n this._done = true;\n this.emit('end');\n return this;\n }\n\n var from = this._from;\n var to = this._to;\n var curr = this._curr;\n var fn = this._ease;\n var p = (now - this._start) / duration;\n var n = fn(p);\n\n if (this.isArray) {\n for (var i = 0; i < from.length; ++i) {\n curr[i] = from[i] + (to[i] - from[i]) * n;\n }\n\n this._update(curr);\n return this;\n }\n\n for (var k in from) {\n curr[k] = from[k] + (to[k] - from[k]) * n;\n }\n\n this._update(curr);\n return this;\n};\n\nTween.prototype.update = function(fn){\n if (0 == arguments.length) return this.step();\n this._update = fn;\n return this;\n};\n\nmodule.exports = Tween;\n},{\"./ease\":11,\"./emitter\":12}],16:[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 })();"]}
includes/forms/class-admin.php CHANGED
@@ -282,11 +282,19 @@ class MC4WP_Forms_Admin
282
  public function process_save_form()
283
  {
284
  check_admin_referer('edit_form', '_mc4wp_nonce');
285
- $form_id = (int) $_POST['mc4wp_form_id'];
286
 
 
 
 
 
 
 
 
 
 
 
287
  $form_data = $_POST['mc4wp_form'];
288
  $form_data['ID'] = $form_id;
289
-
290
  $this->save_form($form_data);
291
  $this->set_default_form_id($form_id);
292
 
282
  public function process_save_form()
283
  {
284
  check_admin_referer('edit_form', '_mc4wp_nonce');
 
285
 
286
+ // save global settings (if submitted)
287
+ $options = get_option('mc4wp', array());
288
+ $posted = $_POST['mc4wp'];
289
+ foreach($posted as $key => $value) {
290
+ $options[$key] = trim($value);
291
+ }
292
+ update_option('mc4wp', $options);
293
+
294
+ // save form + settings
295
+ $form_id = (int) $_POST['mc4wp_form_id'];
296
  $form_data = $_POST['mc4wp_form'];
297
  $form_data['ID'] = $form_id;
 
298
  $this->save_form($form_data);
299
  $this->set_default_form_id($form_id);
300
 
includes/forms/class-form-manager.php CHANGED
@@ -32,6 +32,8 @@ class MC4WP_Form_Manager
32
  */
33
  protected $previewer;
34
 
 
 
35
  /**
36
  * Constructor
37
  */
@@ -41,6 +43,7 @@ class MC4WP_Form_Manager
41
  $this->tags = new MC4WP_Form_Tags();
42
  $this->listener = new MC4WP_Form_Listener();
43
  $this->previewer = new MC4WP_Form_Previewer();
 
44
  }
45
 
46
  /**
@@ -56,6 +59,7 @@ class MC4WP_Form_Manager
56
  $this->output_manager->add_hooks();
57
  $this->tags->add_hooks();
58
  $this->previewer->add_hooks();
 
59
  }
60
 
61
  /**
32
  */
33
  protected $previewer;
34
 
35
+ protected $recaptcha;
36
+
37
  /**
38
  * Constructor
39
  */
43
  $this->tags = new MC4WP_Form_Tags();
44
  $this->listener = new MC4WP_Form_Listener();
45
  $this->previewer = new MC4WP_Form_Previewer();
46
+ $this->recaptcha = new MC4WP_Google_Recaptcha();
47
  }
48
 
49
  /**
59
  $this->output_manager->add_hooks();
60
  $this->tags->add_hooks();
61
  $this->previewer->add_hooks();
62
+ $this->recaptcha->add_hooks();
63
  }
64
 
65
  /**
includes/forms/class-google-recaptcha.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MC4WP_Google_Recaptcha {
4
+
5
+ private $script_loaded = false;
6
+
7
+ public function add_hooks() {
8
+ add_filter('mc4wp_form_settings', array($this, 'add_default_form_settings'));
9
+ add_filter('mc4wp_settings', array($this, 'add_default_settings'));
10
+ add_action('mc4wp_output_form', array($this, 'load_script'), 20);
11
+ add_filter('mc4wp_form_errors', array($this, 'verify_token'), 10, 2);
12
+ add_action('mc4wp_admin_form_after_behaviour_settings_rows', array($this, 'show_settings'), 30, 2);
13
+ add_filter('mc4wp_form_sanitized_data', array($this, 'sanitize_settings'), 20, 2);
14
+ }
15
+
16
+
17
+ public function add_default_settings($settings) {
18
+ $defaults = array(
19
+ 'grecaptcha_site_key' => '',
20
+ 'grecaptcha_secret_key' => '',
21
+ );
22
+ $settings = array_merge($defaults, $settings);
23
+ return $settings;
24
+ }
25
+
26
+ public function add_default_form_settings($settings) {
27
+ $defaults = array(
28
+ 'grecaptcha_enabled' => 0,
29
+ );
30
+ $settings = array_merge($defaults, $settings);
31
+ return $settings;
32
+ }
33
+
34
+ public function sanitize_settings($data, $raw_data) {
35
+ if (!isset($data['settings']['grecaptcha_enabled']) || !$data['settings']['grecaptcha_enabled']) {
36
+ return $data;
37
+ }
38
+
39
+ // only enable grecaptcha if both site & secret key are set
40
+ $global_settings = mc4wp_get_settings();
41
+ $data['settings']['grecaptcha_enabled'] = !empty($global_settings['grecaptcha_site_key']) && !empty($global_settings['grecaptcha_secret_key']) ? '1' : '0';
42
+ return $data;
43
+ }
44
+
45
+ public function load_script(MC4WP_Form $form) {
46
+ // Check if form has Google ReCaptcha enabled
47
+ if (!$form->settings['grecaptcha_enabled']) {
48
+ return;
49
+ }
50
+
51
+ $global_settings = mc4wp_get_settings();
52
+
53
+ if (!$this->script_loaded) {
54
+ echo sprintf('<script src="https://www.google.com/recaptcha/api.js?render=%s"></script>', esc_attr($global_settings['grecaptcha_site_key']));
55
+ $this->script_loaded = true;
56
+ }
57
+
58
+ ?>
59
+ <script>
60
+ (function() {
61
+ mc4wp.forms.on('<?php echo $form->ID; ?>.submit', function(form, event) {
62
+ event.preventDefault();
63
+
64
+ var previousToken = form.element.querySelector('input[name=_mc4wp_grecaptcha_token]');
65
+ if (previousToken) {
66
+ previousToken.parentElement.removeChild(previousToken);
67
+ }
68
+
69
+ try {
70
+ window.grecaptcha
71
+ .execute('<?php echo esc_attr($global_settings['grecaptcha_site_key']); ?>', {action: 'mc4wp_form_submit'})
72
+ .then(function (token) {
73
+ var tokenEl = document.createElement('input');
74
+ tokenEl.type = 'hidden';
75
+ tokenEl.value = token;
76
+ tokenEl.name = '_mc4wp_grecaptcha_token';
77
+ form.element.appendChild(tokenEl);
78
+ mc4wp.forms.trigger('submit', [form, event]);
79
+ });
80
+ } catch(err) {
81
+ mc4wp.forms.trigger('submit', [form, event]);
82
+ throw err;
83
+ }
84
+ })
85
+ })();
86
+ </script>
87
+ <?php
88
+ }
89
+
90
+ public function verify_token(array $errors, MC4WP_Form $form) {
91
+ // Check if form has Google ReCaptcha enabled
92
+ if (!$form->settings['grecaptcha_enabled']) {
93
+ return $errors;
94
+ }
95
+
96
+ // Verify token
97
+ if (empty($_POST['_mc4wp_grecaptcha_token'])) {
98
+ $errors[] = 'spam';
99
+ return $errors;
100
+ }
101
+
102
+ $global_settings = mc4wp_get_settings();
103
+ $token = $_POST['_mc4wp_grecaptcha_token'];
104
+ $response = wp_remote_post('https://www.google.com/recaptcha/api/siteverify', array(
105
+ 'body' => array(
106
+ 'secret' => $global_settings['grecaptcha_secret_key'],
107
+ 'response' => $token,
108
+ ),
109
+ ));
110
+
111
+ $response_code = wp_remote_retrieve_response_code($response);
112
+ if ($response_code >= 400) {
113
+ // The request somehow failed... Allow the sign-up to go through to not break sign-up forms when Google reCaptcha is down (unlikely)
114
+ return $errors;
115
+ }
116
+
117
+ $response_body = wp_remote_retrieve_body($response);
118
+ $data = json_decode($response_body);
119
+ $score_treshold = apply_filters('mc4wp_grecaptcha_score_treshold', 0.5);
120
+
121
+ if ($data->success === false || !isset($data->score) || $data->score <= $score_treshold || $data->action !== 'mc4wp_form_submit') {
122
+ $errors[] = 'spam';
123
+ return $errors;
124
+ }
125
+
126
+ return $errors;
127
+ }
128
+
129
+ public function show_settings(array $settings, MC4WP_Form $form) {
130
+ $global_settings = mc4wp_get_settings();
131
+ ?>
132
+ <tr valign="top">
133
+ <th scope="row"><?php _e('Enable Google reCaptcha', 'mailchimp-for-wp' ); ?></th>
134
+ <td>
135
+ <label><input type="radio" name="mc4wp_form[settings][grecaptcha_enabled]" value="1" <?php checked($settings['grecaptcha_enabled'], 1); ?> /> <?php _e('Yes'); ?> &rlm;</label>
136
+ &nbsp;
137
+ <label><input type="radio" name="mc4wp_form[settings][grecaptcha_enabled]" value="0" <?php checked($settings['grecaptcha_enabled'], 0); ?> /> <?php _e('No'); ?> &rlm;</label>
138
+ <p class="help">
139
+ <?php _e( 'Select "yes" to enable Google reCAPTCHA spam protection for this form.', 'mailchimp-for-wp'); ?>
140
+ </p>
141
+ </td>
142
+ </tr>
143
+ <?php $config = array( 'element' => 'mc4wp_form[settings][grecaptcha_enabled]', 'value' => 1 ); ?>
144
+ <tr valign="top" data-showif="<?php echo esc_attr(json_encode($config)); ?>">
145
+ <th scope="row"><label for="mc4wp_grecaptcha_site_key"><?php _e('Google reCAPTCHA Site Key', 'mailchimp-for-wp'); ?></label></th>
146
+ <td>
147
+ <input type="text" class="widefat" name="mc4wp[grecaptcha_site_key]" id="mc4wp_grecaptcha_site_key" placeholder="<?php echo str_repeat('●', 40); ?>" value="<?php echo esc_attr($global_settings['grecaptcha_site_key']); ?>" />
148
+ <p class="help">
149
+ <?php printf(__('Enter your Google reCAPTCHA keys here. You can <a href="%s">retrieve your keys in the Google reCAPTCHA admin console</a> or read our help article on <a href="%s">how to configure Google reCAPTCHA</a>.', 'mailchimp-for-wp'), 'https://g.co/recaptcha/v3', 'https://kb.mc4wp.com/google-recaptcha-forms/'); ?>
150
+ </p>
151
+ </td>
152
+ </tr>
153
+ <?php $config = array( 'element' => 'mc4wp_form[settings][grecaptcha_enabled]', 'value' => 1 ); ?>
154
+ <tr valign="top" data-showif="<?php echo esc_attr(json_encode($config)); ?>">
155
+ <th scope="row"><label for="mc4wp_grecaptcha_secret_key"><?php _e('Google reCAPTCHA Secret Key', 'mailchimp-for-wp'); ?></label></th>
156
+ <td>
157
+ <input type="text" class="widefat" name="mc4wp[grecaptcha_secret_key]" id="mc4wp_grecaptcha_secret_key" placeholder="<?php echo str_repeat('●', 40); ?>" value="<?php echo esc_attr($global_settings['grecaptcha_secret_key']); ?>" />
158
+ <p class="help">
159
+ <?php _e('', 'mailchimp-for-wp'); ?>
160
+ </p>
161
+ </td>
162
+ </tr>
163
+ <?php
164
+
165
+ }
166
+ }
includes/functions.php CHANGED
@@ -44,13 +44,9 @@ function mc4wp($service = null)
44
  */
45
  function mc4wp_get_options()
46
  {
47
- static $options;
48
-
49
- if (!$options) {
50
- $defaults = require MC4WP_PLUGIN_DIR . 'config/default-settings.php';
51
- $options = (array)get_option('mc4wp', array());
52
- $options = array_merge($defaults, $options);
53
- }
54
 
55
  /**
56
  * Filters the Mailchimp for WordPress settings (general).
@@ -60,6 +56,13 @@ function mc4wp_get_options()
60
  return apply_filters('mc4wp_settings', $options);
61
  }
62
 
 
 
 
 
 
 
 
63
  /**
64
  * @since 4.2.6
65
  * @return string
44
  */
45
  function mc4wp_get_options()
46
  {
47
+ $defaults = require MC4WP_PLUGIN_DIR . 'config/default-settings.php';
48
+ $options = (array) get_option('mc4wp', array());
49
+ $options = array_merge($defaults, $options);
 
 
 
 
50
 
51
  /**
52
  * Filters the Mailchimp for WordPress settings (general).
56
  return apply_filters('mc4wp_settings', $options);
57
  }
58
 
59
+ /**
60
+ * @return array
61
+ */
62
+ function mc4wp_get_settings() {
63
+ return mc4wp_get_options();
64
+ }
65
+
66
  /**
67
  * @since 4.2.6
68
  * @return string
languages/mailchimp-for-wp.pot CHANGED
@@ -337,19 +337,19 @@ msgstr ""
337
  msgid "Form"
338
  msgstr ""
339
 
340
- #: includes/forms/class-admin.php:168, includes/forms/class-admin.php:293
341
  msgid "<strong>Success!</strong> Form successfully saved."
342
  msgstr ""
343
 
344
- #: includes/forms/class-admin.php:400
345
  msgid "Form not found."
346
  msgstr ""
347
 
348
- #: includes/forms/class-admin.php:465, includes/forms/class-widget.php:32
349
  msgid "Mailchimp Sign-Up Form"
350
  msgstr ""
351
 
352
- #: includes/forms/class-admin.php:469
353
  msgid "Select the form to show"
354
  msgstr ""
355
 
@@ -413,6 +413,29 @@ msgstr ""
413
  msgid "There is no form with ID %d, perhaps it was deleted?"
414
  msgstr ""
415
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
416
  #: includes/forms/class-widget.php:28
417
  msgid "Newsletter"
418
  msgstr ""
337
  msgid "Form"
338
  msgstr ""
339
 
340
+ #: includes/forms/class-admin.php:168, includes/forms/class-admin.php:301
341
  msgid "<strong>Success!</strong> Form successfully saved."
342
  msgstr ""
343
 
344
+ #: includes/forms/class-admin.php:408
345
  msgid "Form not found."
346
  msgstr ""
347
 
348
+ #: includes/forms/class-admin.php:473, includes/forms/class-widget.php:32
349
  msgid "Mailchimp Sign-Up Form"
350
  msgstr ""
351
 
352
+ #: includes/forms/class-admin.php:477
353
  msgid "Select the form to show"
354
  msgstr ""
355
 
413
  msgid "There is no form with ID %d, perhaps it was deleted?"
414
  msgstr ""
415
 
416
+ #: includes/forms/class-google-recaptcha.php:133
417
+ msgid "Enable Google reCaptcha"
418
+ msgstr ""
419
+
420
+ #: includes/forms/class-google-recaptcha.php:139
421
+ msgid "Select \"yes\" to enable Google reCAPTCHA spam protection for this form."
422
+ msgstr ""
423
+
424
+ #: includes/forms/class-google-recaptcha.php:145
425
+ msgid "Google reCAPTCHA Site Key"
426
+ msgstr ""
427
+
428
+ #: includes/forms/class-google-recaptcha.php:149
429
+ msgid "Enter your Google reCAPTCHA keys here. You can <a href=\"%s\">retrieve your keys in the Google reCAPTCHA admin console</a> or read our help article on <a href=\"%s\">how to configure Google reCAPTCHA</a>."
430
+ msgstr ""
431
+
432
+ #: includes/forms/class-google-recaptcha.php:155
433
+ msgid "Google reCAPTCHA Secret Key"
434
+ msgstr ""
435
+
436
+ #: includes/forms/class-google-recaptcha.php:159
437
+ msgstr ""
438
+
439
  #: includes/forms/class-widget.php:28
440
  msgid "Newsletter"
441
  msgstr ""
mailchimp-for-wp.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Mailchimp for WordPress
4
  Plugin URI: https://mc4wp.com/#utm_source=wp-plugin&utm_medium=mailchimp-for-wp&utm_campaign=plugins-page
5
  Description: Mailchimp for WordPress by ibericode. Adds various highly effective sign-up methods to your site.
6
- Version: 4.4
7
  Author: ibericode
8
  Author URI: https://ibericode.com/
9
  Text Domain: mailchimp-for-wp
@@ -47,7 +47,7 @@ function _mc4wp_load_plugin()
47
  }
48
 
49
  // bootstrap the core plugin
50
- define('MC4WP_VERSION', '4.3.3');
51
  define('MC4WP_PLUGIN_DIR', dirname(__FILE__) . '/');
52
  define('MC4WP_PLUGIN_URL', plugins_url('/', __FILE__));
53
  define('MC4WP_PLUGIN_FILE', __FILE__);
3
  Plugin Name: Mailchimp for WordPress
4
  Plugin URI: https://mc4wp.com/#utm_source=wp-plugin&utm_medium=mailchimp-for-wp&utm_campaign=p