{"version":3,"sources":["ajax-forms/assets/js/ajax-forms.js"],"names":["r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","Config","objectName","this","prototype","get","k","d","undefined","window","set","v","2","getButtonText","button","innerHTML","value","setButtonText","text","Loader","formElement","form","querySelector","loadingInterval","character","originalButton","cloneNode","setCharacter","start","loadingText","getAttribute","styles","getComputedStyle","style","width","setInterval","tick","bind","opacity","classList","add","loadingChar","stop","clearInterval","remove","3","process","ConfigStore","config","busy","mc4wp","forms","on","event","element","indexOf","document","activeElement","tagName","blur","loader","trigger","args","id","setResponse","request","XMLHttpRequest","onreadystatechange","response","readyState","status","data","JSON","parse","responseText","error","console","log","message","errors","getData","hide_fields","display","reset","redirect_to","location","href","open","setRequestHeader","send","getSerializedData","fire","submit","returnValue","preventDefault","./_config.js","./_form-loader.js","_process","4","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","setTimeout","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","concat","drainQueue","timeout","len","run","marker","runClearTimeout","Item","array","noop","nextTick","Array","arguments","push","apply","title","browser","env","argv","version","versions","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","name","binding","cwd","chdir","dir","umask"],"mappings":"CAA4E,SAASA,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,EAA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AQ0F,eAAiBf,EACzB3E,EAAQ2F,mBAAqBhB,EAC7B3E,EAAQ4F,KAAOjB,EACf3E,EAAQ6F,gBAAkBlB,EAC1B3E,EAAQ8F,oBAAsBnB,EAE9B3E,EAAQ+F,UAAY,SAAUC,GAC5B,MAAO,IAGThG,EAAQiG,QAAU,SAAUD,GAC1B,MAAM,IAAItJ,MAAM,qCAGlBsD,EAAQkG,IAAM,WACZ,MAAO,KAGTlG,EAAQmG,MAAQ,SAAUC,GACxB,MAAM,IAAI1J,MAAM,mCAGlBsD,EAAQqG,MAAQ,WACd,OAAO,IAGP,KAAK,GAAG,CAAC","file":"ajax-forms.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';\n\nfunction Config(objectName) {\n  this.objectName = objectName;\n}\n\nConfig.prototype.get = function (k, d) {\n  return window[this.objectName] !== undefined ? window[this.objectName][k] : d;\n};\n\nConfig.prototype.set = function (k, v) {\n  if (!window[this.objectName]) {\n    window[this.objectName] = {};\n  }\n\n  window[this.objectName][k] = v;\n};\n\nmodule.exports = Config;\n\n},{}],2:[function(require,module,exports){\n'use strict';\n\nfunction getButtonText(button) {\n  return button.innerHTML ? button.innerHTML : button.value;\n}\n\nfunction setButtonText(button, text) {\n  button.innerHTML ? button.innerHTML = text : button.value = text;\n}\n\nfunction Loader(formElement) {\n  this.form = formElement;\n  this.button = formElement.querySelector('input[type=\"submit\"], button[type=\"submit\"]');\n  this.loadingInterval = 0;\n  this.character = \"\\xB7\";\n\n  if (this.button) {\n    this.originalButton = this.button.cloneNode(true);\n  }\n}\n\nLoader.prototype.setCharacter = function (c) {\n  this.character = c;\n};\n\nLoader.prototype.start = function () {\n  if (this.button) {\n    // loading text\n    var loadingText = this.button.getAttribute('data-loading-text');\n\n    if (loadingText) {\n      setButtonText(this.button, loadingText);\n      return;\n    } // Show AJAX loader\n\n\n    var styles = window.getComputedStyle(this.button);\n    this.button.style.width = styles.width;\n    setButtonText(this.button, this.character);\n    this.loadingInterval = window.setInterval(this.tick.bind(this), 500);\n  } else {\n    this.form.style.opacity = '0.5';\n  }\n\n  if (this.form.classList) {\n    this.form.classList.add('mc4wp-loading');\n  }\n};\n\nLoader.prototype.tick = function () {\n  // count chars, start over at 5\n  var text = getButtonText(this.button);\n  var loadingChar = this.character;\n  setButtonText(this.button, text.length >= 5 ? loadingChar : text + \" \" + loadingChar);\n};\n\nLoader.prototype.stop = function () {\n  if (this.button) {\n    this.button.style.width = this.originalButton.style.width;\n    var text = getButtonText(this.originalButton);\n    setButtonText(this.button, text);\n    window.clearInterval(this.loadingInterval);\n  } else {\n    this.form.style.opacity = '';\n  }\n\n  if (this.form.classList) {\n    this.form.classList.remove('mc4wp-loading');\n  }\n};\n\nmodule.exports = Loader;\n\n},{}],3:[function(require,module,exports){\n(function (process){\n'use strict';\n\nvar ConfigStore = require('./_config.js');\n\nvar Loader = require('./_form-loader.js');\n\nvar config = new ConfigStore('mc4wp_ajax_vars');\nvar busy = false; // failsafe against including script twice\n\nif (!config.get('ready')) {\n  window.mc4wp.forms.on('submit', function (form, event) {\n    // does this form have AJAX enabled?\n    if (form.element.getAttribute('class').indexOf('mc4wp-ajax') < 0) {\n      return;\n    } // blur active input field\n\n\n    if (document.activeElement && document.activeElement.tagName === 'INPUT') {\n      document.activeElement.blur();\n    }\n\n    try {\n      submit(form);\n    } catch (e) {\n      console.error(e);\n      return true;\n    }\n\n    event.returnValue = false;\n    event.preventDefault();\n    return false;\n  });\n}\n\nfunction submit(form) {\n  var loader = new Loader(form.element);\n  var loadingChar = config.get('loading_character');\n\n  if (loadingChar) {\n    loader.setCharacter(loadingChar);\n  }\n\n  function start() {\n    // Clear possible errors from previous submit\n    form.setResponse('');\n    loader.start();\n    fire();\n  }\n\n  function fire() {\n    // prepare request\n    busy = true;\n    var request = new XMLHttpRequest();\n\n    request.onreadystatechange = function () {\n      var response = request; // are we done?\n\n      if (response.readyState >= 4) {\n        clean();\n\n        if (response.status >= 200 && response.status < 400) {\n          var data; // Request success! :-)\n\n          try {\n            data = JSON.parse(response.responseText);\n          } catch (error) {\n            console.log('Mailchimp for WordPress: failed to parse AJAX response.\\n\\nError: \"' + error + '\"'); // Not good..\n\n            form.setResponse('<div class=\"mc4wp-alert mc4wp-error\"><p>' + config.get('error_text') + '</p></div>');\n            return;\n          }\n\n          process(data);\n        } else {\n          // Error :(\n          console.log(response.responseText);\n        }\n      }\n    };\n\n    request.open('POST', config.get('ajax_url'), true);\n    request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n    request.send(form.getSerializedData());\n  }\n\n  function process(response) {\n    trigger('submitted', [form, null]);\n\n    if (response.error) {\n      form.setResponse(response.error.message);\n      trigger('error', [form, response.error.errors]);\n    } else {\n      var data = form.getData(); // trigger events\n\n      trigger('success', [form, data]);\n      trigger(response.data.event, [form, data]); // for BC: always trigger \"subscribed\" event when firing \"updated_subscriber\" event\n      // third boolean parameter indicates this was a BC event\n\n      if (response.data.event === 'updated_subscriber') {\n        trigger('subscribed', [form, data, true]);\n      }\n\n      if (response.data.hide_fields) {\n        form.element.querySelector('.mc4wp-form-fields').style.display = 'none';\n      } // show success message\n\n\n      form.setResponse(response.data.message); // reset form element\n\n      form.element.reset(); // maybe redirect to url\n\n      if (response.data.redirect_to) {\n        window.location.href = response.data.redirect_to;\n      }\n    }\n  }\n\n  function trigger(event, args) {\n    window.mc4wp.forms.trigger(event, args);\n    window.mc4wp.forms.trigger(args[0].id + \".\" + event, args);\n  }\n\n  function clean() {\n    loader.stop();\n    busy = false;\n  } // let's do this!\n\n\n  if (!busy) {\n    start();\n  }\n}\n\nconfig.set('ready', true);\n\n}).call(this,require('_process'))\n},{\"./_config.js\":1,\"./_form-loader.js\":2,\"_process\":4}],4:[function(require,module,exports){\n\"use strict\";\n\n// shim for using process in browser\nvar process = module.exports = {}; // 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}\n\nfunction defaultClearTimeout() {\n  throw new Error('clearTimeout has not been defined');\n}\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\n  try {\n    if (typeof clearTimeout === 'function') {\n      cachedClearTimeout = clearTimeout;\n    } else {\n      cachedClearTimeout = defaultClearTimeout;\n    }\n  } catch (e) {\n    cachedClearTimeout = defaultClearTimeout;\n  }\n})();\n\nfunction runTimeout(fun) {\n  if (cachedSetTimeout === setTimeout) {\n    //normal enviroments in sane situations\n    return setTimeout(fun, 0);\n  } // if setTimeout wasn't available but was latter defined\n\n\n  if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n    cachedSetTimeout = setTimeout;\n    return setTimeout(fun, 0);\n  }\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\nfunction runClearTimeout(marker) {\n  if (cachedClearTimeout === clearTimeout) {\n    //normal enviroments in sane situations\n    return clearTimeout(marker);\n  } // if clearTimeout wasn't available but was latter defined\n\n\n  if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n    cachedClearTimeout = clearTimeout;\n    return clearTimeout(marker);\n  }\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\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n  if (!draining || !currentQueue) {\n    return;\n  }\n\n  draining = false;\n\n  if (currentQueue.length) {\n    queue = currentQueue.concat(queue);\n  } else {\n    queueIndex = -1;\n  }\n\n  if (queue.length) {\n    drainQueue();\n  }\n}\n\nfunction drainQueue() {\n  if (draining) {\n    return;\n  }\n\n  var timeout = runTimeout(cleanUpNextTick);\n  draining = true;\n  var len = queue.length;\n\n  while (len) {\n    currentQueue = queue;\n    queue = [];\n\n    while (++queueIndex < len) {\n      if (currentQueue) {\n        currentQueue[queueIndex].run();\n      }\n    }\n\n    queueIndex = -1;\n    len = queue.length;\n  }\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\n  if (arguments.length > 1) {\n    for (var i = 1; i < arguments.length; i++) {\n      args[i - 1] = arguments[i];\n    }\n  }\n\n  queue.push(new Item(fun, args));\n\n  if (queue.length === 1 && !draining) {\n    runTimeout(drainQueue);\n  }\n}; // v8 likes predictible objects\n\n\nfunction Item(fun, array) {\n  this.fun = fun;\n  this.array = array;\n}\n\nItem.prototype.run = function () {\n  this.fun.apply(null, this.array);\n};\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\n\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) {\n  return [];\n};\n\nprocess.binding = function (name) {\n  throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () {\n  return '/';\n};\n\nprocess.chdir = function (dir) {\n  throw new Error('process.chdir is not supported');\n};\n\nprocess.umask = function () {\n  return 0;\n};\n\n},{}]},{},[3]);\n })();"]}