// modules are defined as an array
// [ module function, map of requires ]
//
// map of requires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the require for previous bundles
parcelRequire = (function (modules, cache, entry, globalName) {
  // Save the require from previous bundle to this closure if any
  var previousRequire = typeof parcelRequire === 'function' && parcelRequire;
  var nodeRequire = typeof require === 'function' && require;

  function newRequire(name, jumped) {
    if (!cache[name]) {
      if (!modules[name]) {
        // if we cannot find the module within our internal map or
        // cache jump to the current global require ie. the last bundle
        // that was added to the page.
        var currentRequire = typeof parcelRequire === 'function' && parcelRequire;
        if (!jumped && currentRequire) {
          return currentRequire(name, true);
        }

        // If there are other bundles on this page the require from the
        // previous one is saved to 'previousRequire'. Repeat this as
        // many times as there are bundles until the module is found or
        // we exhaust the require chain.
        if (previousRequire) {
          return previousRequire(name, true);
        }

        // Try the node require function if it exists.
        if (nodeRequire && typeof name === 'string') {
          return nodeRequire(name);
        }

        var err = new Error('Cannot find module \'' + name + '\'');
        err.code = 'MODULE_NOT_FOUND';
        throw err;
      }

      localRequire.resolve = resolve;
      localRequire.cache = {};

      var module = cache[name] = new newRequire.Module(name);

      modules[name][0].call(module.exports, localRequire, module, module.exports, this);
    }

    return cache[name].exports;

    function localRequire(x){
      return newRequire(localRequire.resolve(x));
    }

    function resolve(x){
      return modules[name][1][x] || x;
    }
  }

  function Module(moduleName) {
    this.id = moduleName;
    this.bundle = newRequire;
    this.exports = {};
  }

  newRequire.isParcelRequire = true;
  newRequire.Module = Module;
  newRequire.modules = modules;
  newRequire.cache = cache;
  newRequire.parent = previousRequire;
  newRequire.register = function (id, exports) {
    modules[id] = [function (require, module) {
      module.exports = exports;
    }, {}];
  };

  var error;
  for (var i = 0; i < entry.length; i++) {
    try {
      newRequire(entry[i]);
    } catch (e) {
      // Save first error but execute all entries
      if (!error) {
        error = e;
      }
    }
  }

  if (entry.length) {
    // Expose entry point to Node, AMD or browser globals
    // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
    var mainExports = newRequire(entry[entry.length - 1]);

    // CommonJS
    if (typeof exports === "object" && typeof module !== "undefined") {
      module.exports = mainExports;

    // RequireJS
    } else if (typeof define === "function" && define.amd) {
     define(function () {
       return mainExports;
     });

    // <script>
    } else if (globalName) {
      this[globalName] = mainExports;
    }
  }

  // Override the current require with this new one
  parcelRequire = newRequire;

  if (error) {
    // throw error from earlier, _after updating parcelRequire_
    throw error;
  }

  return newRequire;
})({"../node_modules/parcel/src/builtins/bundle-url.js":[function(require,module,exports) {
var bundleURL = null;

function getBundleURLCached() {
  if (!bundleURL) {
    bundleURL = getBundleURL();
  }

  return bundleURL;
}

function getBundleURL() {
  // Attempt to find the URL of the current script and use that as the base URL
  try {
    throw new Error();
  } catch (err) {
    var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);

    if (matches) {
      return getBaseURL(matches[0]);
    }
  }

  return '/';
}

function getBaseURL(url) {
  return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)\/[^/]+$/, '$1') + '/';
}

exports.getBundleURL = getBundleURLCached;
exports.getBaseURL = getBaseURL;
},{}],"../node_modules/parcel/src/builtins/css-loader.js":[function(require,module,exports) {
var bundle = require('./bundle-url');

function updateLink(link) {
  var newLink = link.cloneNode();

  newLink.onload = function () {
    link.remove();
  };

  newLink.href = link.href.split('?')[0] + '?' + Date.now();
  link.parentNode.insertBefore(newLink, link.nextSibling);
}

var cssTimeout = null;

function reloadCSS() {
  if (cssTimeout) {
    return;
  }

  cssTimeout = setTimeout(function () {
    var links = document.querySelectorAll('link[rel="stylesheet"]');

    for (var i = 0; i < links.length; i++) {
      if (bundle.getBaseURL(links[i].href) === bundle.getBundleURL()) {
        updateLink(links[i]);
      }
    }

    cssTimeout = null;
  }, 50);
}

module.exports = reloadCSS;
},{"./bundle-url":"../node_modules/parcel/src/builtins/bundle-url.js"}],"index.styl":[function(require,module,exports) {
var reloadCSS = require('_css_loader');

module.hot.dispose(reloadCSS);
module.hot.accept(reloadCSS);
},{"_css_loader":"../node_modules/parcel/src/builtins/css-loader.js"}],"../node_modules/ion-cloud/index.js":[function(require,module,exports) {
var define;
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("ion",[],t):"object"==typeof exports?exports.ion=t():e.ion=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=12)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function a(e){var t="invalid";if(e.includes("rgba"))t=function(e){var t=e.replace(/(\(|\)|rgba)/g,"").split(","),n=r(t,4),a=n[0],i=n[1],o=n[2],s=n[3];if(a=0|+a,isNaN(+a)||"number"!=typeof a)throw Error("[Ink] Red rgba value is not a valid number. ("+a+")");if(a<0&&(console.warn("[Ink] Red rgba value was less than 0. ("+a+")"),console.warn("[Ink] Converting red value to 0..."),a=0),a>255&&(console.warn("[Ink] Red rgba value was greater than 255. ("+a+")"),console.warn("[Ink] Converting red value to 255..."),a=255),i=0|+i,isNaN(+i)||"number"!=typeof i)throw Error("[Ink] Green rgba value is not a valid number.");if(i<0&&(console.warn("[Ink] Green rgba value was less than 0. ("+i+")"),console.warn("[Ink] converting green value to 0..."),i=0),i>255&&(console.warn("[Ink] Green rgba value was greater than 255. ("+i+")"),console.warn("[Ink] Converting green value to 255..."),i=255),o=0|+o,isNaN(+o)||"number"!=typeof o)throw Error("[Ink] Blue rgba value is not a valid number.");return o<0&&(console.warn("[Ink] Blur rgba value was less than 0. ("+o+")"),console.warn("[Ink] converting blue value to 0..."),o=0),o>255&&(console.warn("[Ink] Blue rgba value was greater than 255. ("+o+")"),console.warn("[Ink] Converting blue value to 255..."),o=255),{r:a,g:i,b:o,a:s=+s}}(e);else if(e.includes("rgb"))t=function(e){var t=e.replace(/(\(|\)|rgb)/g,"").split(","),n=r(t,3),a=n[0],i=n[1],o=n[2];if(a=0|+a,isNaN(a)||"number"!=typeof a)throw Error("[Ink] Red rgb value is not a valid number.");if(a<0&&(console.warn("[Ink] Red rgb value was less than 0. ("+a+")"),console.warn("[Ink] Converting red value to 0..."),a=0),a>255&&(console.warn("[Ink] Red rgb value was greater than 255. ("+a+")"),console.warn("[Ink] Converting red value to 255..."),a=255),i=0|+i,isNaN(i)||"number"!=typeof i)throw Error("[Ink] Green rgb value is not a valid number.");if(i<0&&(console.warn("[Ink] Green rgb value was less than 0. ("+i+")"),console.warn("[Ink] converting green value to 0..."),i=0),i>255&&(console.warn("[Ink] Green rgb value was greater than 255. ("+i+")"),console.warn("[Ink] Converting green value to 255..."),i=255),o=0|+o,isNaN(o)||"number"!=typeof o)throw Error("[Ink] Blue rgb value is not a valid number.");return o<0&&(console.warn("[Ink] Blue rgb value was less than 0. ("+o+")"),console.warn("[Ink] converting blue value to 0..."),o=0),o>255&&(console.warn("[Ink] Blue rgb value was greater than 255. ("+o+")"),console.warn("[Ink] Converting blue value to 255..."),o=255),{r:a,g:i,b:o,a:1}}(e);else if(e.includes("hsba"))t=getObjectFromHsba(e);else if(e.includes("hsva"))t=i(e);else if(e.includes("hsb"))t=getObjectFromHsb(e);else if(e.includes("hsv"))t=function(e){var t=e.replace(/(\(|\)|hsb|hsv)/g,"").split(","),n=r(t,3);return i("hsva("+n[0]+","+n[1]+","+n[2]+",1)")}(e);else if(e.includes("hsla"))t=o(e);else if(e.includes("hsl"))t=s(e);else if(e.includes("cmyk"))t=function(e){var t=e.replace(/(\(|\)|cmyk)/g,"").split(","),n=r(t,4),a=n[0],i=n[1],o=n[2],s=n[3];if(a=+a,isNaN(a)||"number"!=typeof a)throw Error("[Ink] Cyan cmyk is not a valid number.");if(a<0&&(console.warn("[Ink] Cyan cmyk was less than 0. ("+a+")"),console.warn("[Ink] Converting cyan value to 0..."),a=0),a>1.0001?(console.warn("[Ink] Cyan cmyk was greater than 1. ("+a+")"),console.warn("[Ink] Converting cyan value to 1."),a=1):a>1&&(a=1),i=+i,isNaN(i)||"number"!=typeof i)throw Error("[Ink] Magenta cmyk is not a valid number.");if(i<0&&(console.warn("[Ink] Magenta cmyk was less than 0. ("+i+")"),console.warn("[Ink] Converting magenta value to 0..."),i=0),i>1.0001?(console.warn("[Ink] Magenta cmyk was greater than 1 ("+i+")."),console.warn("[Ink] Converting magenta value to 1."),i=1):i>1&&(i=1),o=+o,isNaN(o)||"number"!=typeof o)throw Error("[Ink] Yellow cmyk is not a valid number.");if(i<0&&(console.warn("[Ink] Yellow cmyk was less than 0. ("+i+")"),console.warn("[Ink] Converting yellow value to 0..."),o=0),o>1.0001?(console.warn("[Ink] Yellow cmyk was greater than 1. ("+o+")"),console.warn("[Ink] Converting yellow value to 1."),o=1):o>1&&(o=1),s=+s,isNaN(s)||"number"!=typeof s)throw Error("[Ink] Black cmyk is not a valid number.");return s<0&&(console.warn("[Ink] Black cmyk was less than 0. ("+s+")"),console.warn("[Ink] Converting black value to 0..."),s=0),s>1.0001?(console.warn("[Ink] Black cmyk was greater than 1. ("+s+")"),console.warn("[Ink] Converting black value to 1."),s=1):s>1&&(s=1),{r:255*(1-a)*(1-s),g:255*(1-i)*(1-s),b:255*(1-o)*(1-s),a:1}}(e);else if(e.includes("#")&&4===e.length)t=function(e){if("#"!==e[0])throw Error("[Ink] Invalid short hex format.");if(isNaN(parseInt(e.substr(1,3),16)))throw Error("[Ink] Invalid characters in short hex color.");return{r:parseInt(e.substr(1,1)+e.substr(1,1),16),g:parseInt(e.substr(2,1)+e.substr(2,1),16),b:parseInt(e.substr(3,1)+e.substr(3,1),16),a:1}}(e);else{if(!e.includes("#")||7!==e.length)throw Error("[Ink] Unknown color type.");t=function(e){if("#"!==e[0])throw Error("[Ink] Invalid long hex format.");if(isNaN(parseInt(e.substr(1,6),16)))throw Error("[Ink Invalid characters in long hex color.");return{r:parseInt(e.substr(1,2),16),g:parseInt(e.substr(3,2),16),b:parseInt(e.substr(5,2),16),a:1}}(e)}return t}function i(e){var t=e.replace(/(\(|\)|hsba|hsva)/g,"").split(","),n=r(t,4),a=n[0],i=n[1],o=n[2],s=n[3];if(a=+a,isNaN(a)||"number"!=typeof a)throw Error("[Ink] Hue hsv(a)/hsb(a) is not a valid number.");if(a>360.0001&&(console.warn("[Ink] Hue hsv(a)/hsb(a) was greater than 360. ("+a+")"),console.warn("[Ink] Converting hue value to "+a%360+"."),a%=360),a<0&&(console.warn("[Ink] Hue hsv(a)/hsb(a) was less than 0. ("+a+")"),console.warn("[Ink] Converting hue value to "+(360+a%360)+"."),a=360-a%360),i=+i,isNaN(i)||"number"!=typeof i)throw Error("[Ink] Saturation hsv(a)/hsb(a) is not a valid number.");if(i<0&&(console.warn("[Ink] Saturation hsv(a)/hsb(a) was less than 0. ("+i+")"),console.warn("[Ink] Converting saturation value to 0..."),i=0),i>1.0001&&(console.warn("[Ink] Saturation hsv(a)/hsb(a) was greater than 0. ("+i+")"),console.warn("[Ink] Converting saturation value to 1..."),i=1),o=+o,isNaN(o)||"number"!=typeof o)throw Error("[Ink] Brightness/value hsv(a)/hsb(a) is not a valid number.");o<0&&(console.warn("[Ink] Brightness/value hsv(a)/hsb(a) was less than 0. ("+o+")"),console.warn("[Ink] Converting brightness to 0..."),o=0),o>1.0001&&(console.warn("[Ink] Brightness/value hsv(a)/hsb(a) was greater than 1. ("+o+")"),console.warn("[Ink] Converting brightness to 1..."),o=1),s=+s;var u=o*i,c=u*(1-Math.abs(a/60%2-1)),l=o-u,h=function(e){return a<60?Math.round(255*([u,c,0][e]+l)):a<120?Math.round(255*([c,u,0][e]+l)):a<180?Math.round(255*([0,u,c][e]+l)):a<240?Math.round(255*([0,c,u][e]+l)):a<300?Math.round(255*([c,0,u][e]+l)):Math.round(255*([u,0,c][e]+l))},f=[h(0),h(1),h(2)];return{r:f[0],g:f[1],b:f[2],a:s}}function o(e){var t=e.replace(/(\(|\)|hsla)/g,"").split(","),n=r(t,4),a=n[0],i=n[1],o=n[2],s=n[3];if(a=0|+a,isNaN(a)||"number"!=typeof a)throw Error("[Ink] Hue hsl(a) is not a valid number.");if(a>360&&(console.warn("[Ink] Hue hsl(a) was greater than 360. ("+a+")"),console.warn("[Ink] Converting hue value to "+a%360+"."),a%=360),a<0&&(console.warn("[Ink] Hue hsl(a) was less than 0. ("+a+")"),console.warn("[Ink] Converting hue value to "+(360+a%360)+"."),a=360-a%360),i=+i,isNaN(i)||"number"!=typeof i)throw Error("[Ink] Saturation hsl(a) is not a valid number.");if(i<0&&(console.warn("[Ink] Saturation hsl(a) was less than 0. ("+i+")"),console.warn("[Ink] Converting saturation value to 0..."),i=0),i>1.0001?(console.warn("[Ink] Saturation hsl(a) was greater than 0. ("+i+")"),console.warn("[Ink] Converting saturation value to 1..."),i=1):i>1&&(i=1),o=+o,isNaN(o)||"number"!=typeof o)throw Error("[Ink] Lightness hsl(a) is not a valid number.");o<0&&(console.warn("[Ink] Lightness hsl(a) was less than 0. ("+o+")"),console.warn("[Ink] Converting lightness to 0..."),o=0),o>1.0001?(console.warn("[Ink] Lightness hsl(a) was greater than 1. ("+o+")"),console.warn("[Ink] Converting lightness to 1..."),o=1):o>1&&(o=1),s=+s;var u=(1-Math.abs(2*o-1))*i,c=u*(1-Math.abs(a/60%2-1)),l=o-u/2,h=function(e){return a<60?Math.round(255*([u,c,0][e]+l)):a<120?Math.round(255*([c,u,0][e]+l)):a<180?Math.round(255*([0,u,c][e]+l)):a<240?Math.round(255*([0,c,u][e]+l)):a<300?Math.round(255*([c,0,u][e]+l)):Math.round(255*([u,0,c][e]+l))},f=[h(0),h(1),h(2)];return{r:f[0],g:f[1],b:f[2],a:s}}function s(e){var t=e.replace(/(\(|\)|hsl)/g,"").split(","),n=r(t,3);return o("hsla("+n[0]+","+n[1]+","+n[2]+",1)")}function u(e){return"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"}function c(e){return"rgb("+e.r+","+e.g+","+e.b+")"}function l(e){var t=e.r,n=e.g,r=e.b,a=e.a;t/=255,n/=255,r/=255;var i=Math.min(t,n,r),o=Math.max(t,n,r),s=o-i,u=void 0,c=void 0,l=o;return 0!==o?(c=s/o,u=t===o?(n-r)/s:n===o?2+(r-4)/s:4+(t-n)/s,(u*=60)<0&&(u+=360),isNaN(u)&&(u=0)):(u=0,c=0,l=0),"hsva("+u+","+c+","+l+","+a+")"}function h(e){var t=l(e).replace(/(\(|\)|hsva)/g,"").split(","),n=r(t,3);return"hsv("+n[0]+","+n[1]+","+n[2]+")"}function f(e){var t=l(e).replace(/(\(|\)|hsva)/g,"").split(","),n=r(t,4);return"hsba("+n[0]+","+n[1]+","+n[2]+","+n[3]+")"}function d(e){var t=l(e).replace(/(\(|\)|hsva)/g,"").split(","),n=r(t,3);return"hsba("+n[0]+","+n[1]+","+n[2]+")"}function v(e){var t=e.r,n=e.g,r=e.b;e.a,t/=255,n/=255,r/=255;var a=1-Math.max(t,n,r);return"cmyk("+(1-t-a)/(1-a)+","+(1-n-a)/(1-a)+","+(1-r-a)/(1-a)+","+a+")"}function w(e){var t=e.r,n=e.g,r=e.b,a=e.a;t/=255,n/=255,r/=255;var i=Math.max(t,n,r),o=Math.min(t,n,r),s=i-o,u=void 0,c=void 0,l=(i+o)/2;return s?(c=s/(1-Math.abs(2*l-1)),(u=i===t?(n-r)/s%6*60:i===n?60*((r-t)/s+2):60*((t-n)/s+4))<0&&(u=360+u)):u=c=0,"hsla("+u+","+c+","+l+","+a+")"}function g(e){var t=w(e).replace(/(\(|\)|hsla)/g,"").split(","),n=r(t,3);return"hsl("+n[0]+","+n[1]+","+n[2]+")"}function b(e){return"#"+e.r.toString(16).padStart(2,"0")+e.g.toString(16).padStart(2,"0")+e.b.toString(16).padStart(2,"0")}t.ink=function(e){var t=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[]),n=a(e),i=n.r,o=n.g,m=n.b,p=n.a;if(isNaN(p)||"number"!=typeof p)throw Error("[Ink] Alpha value is not a valid number.");if(p<0&&(console.warn("[Ink] Alpha was less than 0. ("+p+")"),console.warn("[Ink] Converting alpha to 0..."),p=0),p>1.0001?(console.warn("[Ink] Alpha was greater than 1. ("+p+")"),console.warn("[Ink] Converting alpha to 1..."),p=1):p>1&&(p=1),t.r&&"number"!=typeof t.r||t.r&&isNaN(t.r))throw Error("[Ink] Red color weight is not a number.");if(t.r&&t.r<0)throw Error("[Ink] Red color weight must be greater than 0.");if(t.g&&"number"!=typeof t.g||t.g&&isNaN(t.g))throw Error("[Ink] Green color weight is not a number.");if(t.g&&t.g<0)throw Error("[Ink] Green color weight must be greater than 0.");if(t.b&&"number"!=typeof t.b||t.b&&isNaN(t.b))throw Error("[Ink] Blue color weight is not a number.");if(t.b&&t.b<0)throw Error("[Ink] Blue color weight must be greater than 0.");if(t.l&&"number"!=typeof t.l||t.l&&isNaN(t.l))throw Error("[Ink] Lightness weight is not a number.");if(t.s&&"number"!=typeof t.s||t.s&&isNaN(t.s))throw Error("[Ink] Saturation weight is not a number.");if(t.r<0||t.g<0||t.b<0||t.r>1||t.g>1||t.b>1)throw Error("[Ink] Color weights must be inclusively between 0 and 1.");if(t.a<0||t.a>1)throw Error("[Ink] Color alpha must be inclusively between 0 and 1.");if(t.minLightness&&"number"!=typeof t.minLightness)throw Error("[Ink] Min lightness is not a number.");if(t.minLightness&&isNaN(t.minLightness))throw Error("[Ink] Min lightness is not a number.");if(t.maxLightness&&"number"!=typeof t.maxLightness)throw Error("[Ink] Max lightness is not a number.");if(t.maxLightness&&isNaN(t.maxLightness))throw Error("[Ink] Max lightness is not a number.");if(t.lightness&&"number"!=typeof t.lightness)throw Error("[Ink] lightness is not a number.");if(t.lightness&&isNaN(t.lightness))throw Error("[Ink] lightness is not a number.");if(t.minSaturation&&"number"!=typeof t.minSaturation)throw Error("[Ink] Min saturation is not a number.");if(t.minSaturation&&isNaN(t.minSaturation))throw Error("[Ink] Min saturation is not a number.");if(t.maxSaturation&&"number"!=typeof t.maxSaturation)throw Error("[Ink] Max saturation is not a number.");if(t.maxSaturation&&isNaN(t.maxSaturation))throw Error("[Ink] Max saturation is not a number.");if(t.saturation&&"number"!=typeof t.saturation)throw Error("[Ink] Saturation is not a number.");if(t.saturation&&isNaN(t.saturation))throw Error("[Ink] Saturation is not a number.");if(t.object&&"boolean"!=typeof t.object)throw Error("[Ink] Object output parameter value is not a boolean.");if(t.minSaturation>t.maxSaturation){console.warn("[Ink] Min saturation must be smaller than max saturation."),console.warn("[Ink] Switching min and max saturations...");var y=[t.maxSaturation,t.minSaturation];t.minSaturation=y[0],t.maxSaturation=y[1]}if(t.minLightness>t.maxLightness){console.warn("[Ink] Min lightness must be smaller than max lightness."),console.warn("[Ink] Switching min and max lightness...");var k=[t.maxLighntess,t.minLightness];t.minLightness=k[0],t.maxLightness=k[1]}if((t.minLightness&&t.lightness||t.maxLightness&&t.lightness)&&(console.warn("[Ink] Cannot have lightness setting and a threshold."),console.warn("[Ink] Ignoring lightness threshold..."),delete t.minLightness,delete t.maxLightness),(t.minSaturation&&t.saturation||t.maxSaturation&&t.saturation)&&(console.warn("[Ink] Cannot have saturation setting and a threshold."),console.warn("[Ink] Ignoring saturation threshold..."),delete t.minSaturation,delete t.maxSaturation),t.maxLightness&&t.minLightness&&t.maxLightness-t.minLightness<.01&&(console.warn("[Ink] Max and min lightness threshold too close."),console.warn("[Ink] Removing lightness threshold and using hard setting..."),t.lightness=t.minLightness,delete t.minLightness,delete t.maxLightness),t.minSaturation&&t.maxSaturation&&t.maxSaturation-t.minSaturation<.01&&(console.warn("[Ink] Max and min saturation threshold too close."),console.warn("[Ink] Removing saturation threshold and using hard setting..."),t.saturation=t.minSaturation,delete t.minSaturation,delete t.maxSaturation),t.r&&(i=Math.floor(t.r*i))>255&&(i=255),t.g&&(o=Math.floor(t.g*o))>255&&(o=255),t.b&&(m=Math.floor(t.b*m))>255&&(m=255),t.a&&(p=t.a),t.l){var I=g({r:i,g:o,b:m}).replace(/(\(|\)|hsl)/g,"").split(","),x=r(I,3),M=x[0],E=x[1],C=x[2];C=+C;var P=s("hsl("+M+","+E+","+(C+=t.l)+")");i=P.r,o=P.g,m=P.b}if(t.s){var S=g({r:i,g:o,b:m}).replace(/(\(|\)|hsl)/g,"").split(","),Y=r(S,3),X=Y[0],N=Y[1],j=Y[2];N=+N;var O=s("hsl("+X+","+(N+=+t.s)+","+j+")");i=O.r,o=O.g,m=O.b}if(t.minLightness||t.maxLightness||t.lightness){var _=g({r:i,g:o,b:m}).replace(/(\(|\)|hsl)/g,"").split(","),D=r(_,3),L=D[0],T=D[1],q=D[2];t.minLightness&&q<t.minLightness&&(q=t.minLightness),t.maxLightness&&q>t.maxLightness&&(q=t.maxLightness),t.lightness&&+q!==t.lightness&&(q=t.lightness);var z=s("hsl("+L+","+T+","+q+")");i=z.r,o=z.g,m=z.b}if(t.minSaturation||t.maxSaturation||t.saturation){var R=g({r:i,g:o,b:m}).replace(/(\(|\)|hsl)/g,"").split(","),H=r(R,3),B=H[0],F=H[1],G=H[2];t.minSaturation&&F<t.minSaturation&&(F=t.minSaturation),t.maxSaturation&&F>t.maxSaturation&&(F=t.maxSaturation),t.saturation&&+F!==t.saturation&&(F=t.saturation);var W=s("hsl("+B+","+F+","+G+")");i=W.r,o=W.g,m=W.b}i=Math.round(i),o=Math.round(o),m=Math.round(m),p=p.toFixed(3);return t.format&&"object"===t.format?{r:i,g:o,b:m,a:p}:t.format&&"hex"===t.format?b({r:i,g:o,b:m}):t.format&&"hsl"===t.format?g({r:i,g:o,b:m}):t.format&&"hsla"===t.format?w({r:i,g:o,b:m,a:p}):t.format&&"hsv"===t.format?h({r:i,g:o,b:m}):t.format&&"hsva"===t.format?l({r:i,g:o,b:m,a:p}):t.format&&"hsb"===t.format?d({r:i,g:o,b:m}):t.format&&"hsba"===t.format?f({r:i,g:o,b:m,a:p}):t.format&&"rgb"===t.format?c({r:i,g:o,b:m}):t.format&&"cmyk"===t.format?v({r:i,g:o,b:m}):u({r:i,g:o,b:m,a:p})},t.convert2rgba=function(e){return u(a(e))},t.convert2rgb=function(e){return c(a(e))},t.convert2hsba=function(e){return f(a(e))},t.convert2hsva=function(e){return l(a(e))},t.convert2hsb=function(e){return d(a(e))},t.convert2hsv=function(e){return h(a(e))},t.convert2hsla=function(e){return w(a(e))},t.convert2hsl=function(e){return g(a(e))},t.convert2hex=function(e){return b(a(e))},t.convert2cmyk=function(e){return v(a(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function a(e){return+e.split(/d/g)[0]}function i(e){var t=e.split(/d/g);return t.length>1?t[0]*t[1]:+t[0]}t.Dice=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.string=t,this.compileStatements()}return r(e,[{key:"compileStatements",value:function(){var e=this,t=this.string.split(/(\+|\-)/g),n=t.filter(function(e){return!["+","-"].includes(e)}),r=t.filter(function(e){return["+","-"].includes(e)});return this.statements=[],r.unshift("+"),n.forEach(function(t,a){e.statements.push({operator:r[a],operation:n[a]})}),this.statements}},{key:"randomInteger",value:function(e,t){return Math.floor(Math.random()*(t-e))+e}},{key:"roll",value:function(){var e=this,t=0;return this.statements.forEach(function(n){var r=a(n.operation),o=i(n.operation);"+"===n.operator?t+=e.randomInteger(r,o):t-=e.randomInteger(r,o)}),t}},{key:"min",get:function(){var e=0;return this.statements.forEach(function(t){"+"===t.operator?e+=a(t.operation):e-=a(t.operation)}),e}},{key:"max",get:function(){var e=0;return this.statements.forEach(function(t){"+"===t.operator?e+=i(t.operation):e-=i(t.operation)}),e}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.Phaser=function(){function e(t,n){var r=n.interval,a=n.phase,i=n.colors,o=n.x,s=n.y,u=n.width,c=n.height,l=n.makeGradient;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.interval=r||100,this.frame=this.interval,this.phase=a,this.easel=t,this.x=o,this.y=s,this.width=u,this.height=c,this.makeGradient=l,this.colors=i,this.colorD=[],this.err=0,!t)throw new Error("Error "+ ++this.err+": Easel missing.");this.err||this.initialize()}return r(e,[{key:"initialize",value:function(){var e,t,n,r,a,i=this;this.colors.forEach(function(o,s){e={},t={r:0,g:0,b:0},r=0,n=0,Object.keys(o).forEach(function(u){var c=o[u],l={r:c.r-t.r,g:c.g-t.g,b:c.b-t.b};if(1===r?(n=l,a=u):r>1&&(e[u]=l),r++,t={r:c.r,g:c.g,b:c.b},u===i.phase){var h=i.colors[s].current;h.r=t.r,h.g=t.g,h.b=t.b}}),e[a]={r:n.r-t.r,g:n.g-t.g,b:n.b-t.b},i.colorD.push(e)})}},{key:"getNextPhase",value:function(){var e,t=this,n=0,r="";for(e in this.colors[0]){if(n){r=e;break}e===this.phase&&(n=1)}if(0===r.length)for(e in this.colors[0])if("current"!==e){r=e;break}return this.colors.forEach(function(e,n){e.current.r=e[t.phase].r,e.current.g=e[t.phase].g,e.current.b=e[t.phase].b}),r}},{key:"drawNext",value:function(e){var t=this,n=this.makeGradient();this.colors.forEach(function(e,t){var r=e.current;n.addColorStop(t,"rgb("+(0|r.r)+","+(0|r.g)+","+(0|r.b)+")")}),this.easel.ctx.fillStyle=n,this.easel.ctx.fillRect(this.x,this.y,this.width,this.height),this.frame===this.interval&&(this.frame=-1,this.phase=this.getNextPhase()),this.colors.forEach(function(e,n){var r=e.current,a=t.colorD[n][t.phase];r.r+=a.r/t.interval,r.g+=a.g/t.interval,r.b+=a.b/t.interval}),this.frame++}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=t.Easel=function(){function e(t){var n=this;if(a(this,e),!window.CanvasRenderingContext2D)return this.activated=!1,!1;this.activated=!0,this.canvas=document.createElement("canvas"),this.ctx=t?this.canvas.getContext("webgl"):this.canvas.getContext("2d"),this.viewport=this.acquireViewport(),window.onresize=function(){n.viewport=n.acquireViewport(),n.resizeCanvas(),n.config(),n.redraw()},this.background="#000",this.started=!1,document.body.appendChild(this.canvas);var r=document.createElement("style");r.type="text/css",r.rel="stylesheet",r.innerHTML="body{background-color:"+this.background+";margin:0;}\n      canvas{position:fixed;left:0;top:0;right:0;bottom:0;}",document.querySelector("head").appendChild(r),this.resizeCanvas()}return r(e,[{key:"resizeCanvas",value:function(){this.canvas.width=this.viewport.w,this.canvas.height=this.viewport.h}},{key:"acquireContext",value:function(){this.ctx=this.canvas.getContext("2d")}},{key:"acquireViewport",value:function(){var e=window,t="inner";return e.innerWidth||(t="client",e=document.documentElement||document.body),{w:e[t+"Width"],h:e[t+"Height"]}}},{key:"redraw",value:function(){this.started||(this.config(),this.started=!0),this.onDraw()}},{key:"config",value:function(){}},{key:"onDraw",value:function(){this.ctx.fillStyle=this.background,this.ctx.fillRect(0,0,this.viewport.width,this.viewport.height)}}]),e}();t.Easel3d=function(e){function t(){return a(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,!0))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bubbles=function(e){var t=this,n=e.startX,a=e.startY,i=e.width,o=e.height,s=e.color,u=e.quantity,c=e.distance,l=e.duration,h=e.ion,f=h||new this.Ion(this.easel);return n=n||0,a=a||0,i=i||100,o=o||100,f.tweenDuration=l||1e3,f.tweenCurrent=function(){return Math.floor(Math.random()*f.tweenDuration)},f.quantity=u,f.states=["initial"],f.clear=!1,f.startX=function(){return t.camera.x+n+Math.random()*i},f.startY=function(){return t.camera.y+a+Math.random()*o},f.endX=function(e,t){return t},f.endY=function(e,t){return t-c},f.size=function(){return 2*Math.random()},f.color=function(e){var t,n=f.tweenDuration/2;t=e.tweenCurrent<=n?e.tweenCurrent/n:(n-Math.abs(n-e.tweenCurrent))/n;var a=(0,r.ink)(s,{format:"object"});return"rgba("+a.r+","+a.g+","+a.b+","+t+")"},f.tweenType=6,f.onParticleEnd=f.reevaluate,h?(f.collection.forEach(function(e){f.reevaluate(e),e.tweenCurrent=f.tweenCurrent()}),f.active=!0):f.populate(),f};var r=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.laser=function(e){var t=this,n=e.startX,r=e.startY,a=e.endX,i=e.endY,o=e.size,s=200,u=new this.Ion(this.easel);return n=n||0,r=r||0,a=a||0,i=i||0,o=o||10,u.states=["initial"],u.clear=!1,u.color="rgba(250,250,150,0.5)",u.startX=function(){return t.camera.x+a},u.startY=function(){return t.camera.y+i},u.endX=function(){return t.camera.x+a-o/2+Math.random()*o},u.endY=function(){return t.camera.y+i-o/2+Math.random()*o},u.windX=function(){return 1.5*Math.random()-.75},u.windY=function(){return 1.5*Math.random()-.75},u.size=function(){return Math.floor(2*Math.random()+2)},u.tweenType=function(){return Math.floor(5*Math.random()+10)},u.tweenDuration=function(){return Math.floor(50*Math.random()+100)},u.onParticleEnd=function(e){this.collection.splice(e.id,1),this.collection.forEach(function(e,t){return e.id=t})},u.onCreate=function(){return s--},u.populate(),u.draw=function(){t.easel.ctx.strokeStyle="rgba(100,100,250,"+5e-4*s+")",t.easel.ctx.lineWidth=17,s>0&&(t.easel.ctx.beginPath(),t.easel.ctx.moveTo(t.camera.x+n+3,t.camera.y+r),t.easel.ctx.lineTo(t.camera.x+a+3,t.camera.y+i),t.easel.ctx.stroke(),t.easel.ctx.strokeStyle="#DDF",t.easel.ctx.lineWidth=2,t.easel.ctx.beginPath(),t.easel.ctx.moveTo(t.camera.x+n+3,t.camera.y+r),t.easel.ctx.lineTo(t.camera.x+a+3,t.camera.y+i),t.easel.ctx.stroke())},u}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.vortex=function(e){var t=this,n=e.startX,r=e.startY,a=e.size,i=e.quantity,o=e.iterations,s=e.callback,u=new this.Ion(this.easel);return n=n||0,r=r||0,a=a||300,o=o||1/0,u.quantity=i,u.states=["initial"],u.clear=!1,u.color="rgba(200,200,255,0.7)",u.startX=function(){return Math.abs(t.camera.x+Math.random()*a-a/2+n)+1},u.startY=function(){return Math.abs(t.camera.y+Math.random()*a-a/2+r)+1},u.endX=function(){return t.camera.x+n},u.endY=function(){return t.camera.y+r},u.size=function(){return 4*Math.random()+1},u.tweenType="ease-out-circular",u.tweenDuration=function(){return Math.floor(100*Math.random()+100)},u.onParticleEnd=function(e){o<50&&o>0?("function"==typeof s&&(s(),s=void 0),o--):o>0?(o--,this.reevaluate(e)):0===o&&(u.finished=!0)},u.onMove=function(e){e.endX=u.endX(),e.endY=u.endY()},u.populate(15),u}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flame=function(e){var t=this,n=e.startX,r=e.startY,a=e.width,i=e.height,o=e.color,s=e.quantity,u=new this.Ion(this.easel);return n=n||0,r=r||0,a=a||20,i=i||100,u.quantity=s,u.states=["initial"],u.clear=!1,u.color=o||"rgba(250,170,0,0.2)",u.startX=function(){return t.camera.x+n+Math.random()*a-a/2},u.startY=function(){return t.camera.y+r},u.endX=function(){return t.camera.x+n},u.endY=function(){return t.camera.y+r-i},u.windX=function(){return.5*Math.random()-.25},u.windY=function(){return 2*Math.random()-2},u.tweenType=function(){return Math.floor(10*Math.random()+10)},u.tweenDuration=function(){return Math.floor(300*Math.random()+300)},u.onEscape=function(e){this.onParticleEnd(e)},u.onParticleEnd=u.reevaluate,u.onMove=function(e){var t=(i+a)/4;e.tweenCurrent>.15*e.tweenDuration?this.onParticleEnd(e):e.size=t-t/e.tweenDuration*e.tweenCurrent},u.populate(),u}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smoke=function(e){var t=this,n=e.startX,a=e.startY,i=e.width,o=e.height,s=e.color,u=e.quantity,c=e.ion,l=c||new this.Ion(this.easel);return n=n||0,a=a||0,i=i||20,o=o||100,l.quantity=u,l.states=["initial"],l.clear=!1,l.color=function(e){var t,n=e.tweenDuration/2;t=e.tweenCurrent<=n?e.tweenCurrent/n:(n-Math.abs(n-e.tweenCurrent))/n;var a=(0,r.ink)(s,{format:"object"});return"rgba("+a.r+","+a.g+","+a.b+","+t+")"},l.startX=function(){return t.camera.x+n+Math.random()*i},l.startY=function(){return t.camera.y+a+Math.random()*o},l.endX=function(e){return t.camera.x+e+Math.random()*i/4-i/8},l.endY=function(){return t.camera.y+a},l.tweenType=function(){return[1,4,7,10,13,15][Math.floor(6*Math.random())]},l.tweenDuration=function(){return Math.floor(300*Math.random()+300)},l.tweenCurrent=function(){return Math.floor(Math.random()*l.tweenDuration())},l.onEscape=function(e){this.onParticleEnd(e)},l.onParticleEnd=l.reevaluate,l.size=function(){return 4*Math.random()},l.onMove=function(e){var t=(o+i)/8;e.tweenCurrent>.15*e.tweenDuration?this.onParticleEnd(e):e.size=t-t/e.tweenDuration*e.tweenCurrent},c?(l.collection.forEach(function(e){l.reevaluate(e),e.tweenCurrent=l.tweenCurrent()}),l.active=!0):l.populate(),l};var r=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8);Object.defineProperty(t,"smoke",{enumerable:!0,get:function(){return r.smoke}});var a=n(7);Object.defineProperty(t,"flame",{enumerable:!0,get:function(){return a.flame}});var i=n(6);Object.defineProperty(t,"vortex",{enumerable:!0,get:function(){return i.vortex}});var o=n(5);Object.defineProperty(t,"laser",{enumerable:!0,get:function(){return o.laser}});var s=n(4);Object.defineProperty(t,"bubbles",{enumerable:!0,get:function(){return s.bubbles}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IonCloud=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(9));t.IonCloud=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.easel=t,this.Ion=n,this.camera={x:0,y:0,dx:0,dy:0},this.collection=[],this.beforeDraw={},this.clouds=i,this.state="initial"}return a(e,[{key:"animate",value:function(e,t){var n=this.collection.find(function(e){return!e.active});n?this.clouds[e].call(this,r({ion:n},t)):this.collection.push(this.clouds[e].call(this,t))}},{key:"makeState",value:function(e,t){this.beforeDraw[e]=t}},{key:"clearScene",value:function(){this.background?this.easel.ctx.putImageData(this.background,0,0):(this.easel.ctx.fillStyle="#000",this.easel.ctx.fillRect(0,0,this.easel.viewport.w,this.easel.viewport.h))}},{key:"clean",value:function(e){e?this.collection.forEach(function(t){t.states.includes(e)&&(t.active=!1)}):this.collection.forEach(function(e){return e.active=!1})}},{key:"draw",value:function(){var e=this,t=!1;this.clearScene(),this.beforeDraw[this.state]&&this.beforeDraw[this.state](),this.collection.forEach(function(n,r,a){n.finished&&(t=!0),n.states.includes(e.state)&&(n.finished&&"function"==typeof n.onFinished?n.onFinished(n):n.active&&n.getFrame(n))}),t&&(this.collection=this.collection.filter(function(e){return!e.finished})),requestAnimationFrame(function(){return e.draw()})}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.Ion=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.active=!0,this.easel=t,this.ctx=t.ctx,this.collection=[],this.quantity=1,this.size=1,this.startX=0,this.startY=0,this.endX=1,this.endY=1,this.windX=0,this.windY=0,this.clear=!0,this.color="#48F",this.clearColor="#000",this.tweenType=0,this.tweenCurrent=0,this.tweenDuration=1e3,this.tweenSpeed=1,this.background=null,!this.ctx)throw new Error("Ion initialized without easel.")}return r(e,[{key:"tween",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.o,a=n.d,i=void 0===a?e.tweenDuration:a,o=n.t,s=void 0===o?e.tweenCurrent:o,u=n.type,c=void 0===u?"x"===t?e.tweenTypeX:e.tweenTypeY:u,l=n.b,h=void 0===l?"x"===t?e.startX:e.startY:l,f=n.c,d=void 0===f?"x"===t?e.endX-e.startX:e.endY-e.startY:f,v=void 0;if("ease-in-quad"===c)v=d*(s/=i)*s+h;else if("ease-out-quad"===c)v=-d*(s/=i)*(s-2)+h;else if("ease-in-out-quad"===c)v=(s/=i/2)<1?d/2*s*s+h:-d/2*(--s*(s-2)-1)+h;else if("ease-in-cubic"===c)v=d*(s/=i)*s*s+h;else if("ease-out-cubic"===c)v=d*((s=s/i-1)*s*s+1)+h;else if("ease-in-out-cubic"===c)v=(s/=i/2)<1?d/2*s*s*s+h:d/2*((s-=2)*s*s+2)+h;else if("ease-in-quart"===c)v=d*(s/=i)*s*s*s+h;else if("ease-out-quart"===c)v=-d*((s=s/i-1)*s*s*s-1)+h;else if("ease-in-out-quart"===c)v=(s/=i/2)<1?d/2*s*s*s*s+h:-d/2*((s-=2)*s*s*s-2)+h;else if("ease-in-quint"===c)v=d*(s/=i)*s*s*s*s+h;else if("ease-out-quint"===c)v=d*((s=s/i-1)*s*s*s*s+1)+h;else if("ease-in-out-quint"===c)v=(s/=i/2)<1?d/2*s*s*s*s*s+h:d/2*((s-=2)*s*s*s*s+2)+h;else if("ease-in-sine"===c)v=-d*Math.cos(s/i*(Math.PI/2))+d+h;else if("ease-out-sine"===c)v=d*Math.sin(s/i*(Math.PI/2))+h;else if("ease-in-out-sine"===c)v=-d/2*(Math.cos(Math.PI*s/i)-1)+h;else if("ease-in-exponential"===c)v=0===s?h:d*Math.pow(2,10*(s/i-1))+h;else if("ease-out-exponential"===c)v=s===i?h+d:d*(1-Math.pow(2,-10*s/i))+h;else if("ease-in-out-exponential"===c)v=0===s?h:s===i?h+d:(s/=i/2)<1?d/2*Math.pow(2,10*(s-1))+h:d/2*(2-Math.pow(2,-10*--s))+h;else if("ease-in-circular"===c)v=-d*(Math.sqrt(1-(s/=i)*s)-1)+h;else if("ease-out-circular"===c)v=d*Math.sqrt(1-(s=s/i-1)*s)+h;else if("ease-in-out-circular"===c)v=(s/=i/2)<1?-d/2*(Math.sqrt(1-s*s)-1)+h:d/2*(Math.sqrt(1-(s-=2)*s)+1)+h;else if("ease-in-elastic-weak"===c)v=this.tween(e,t,{o:.5,type:"ease-in-elastic"});else if("ease-in-elastic"===c)v=function(){var e=1.70158,t=0,n=d;return 0===s?h:1==(s/=i)?h+d:(t||(t=i*(r||.3)),n<Math.abs(d+.1)?(n=d,e=t/4):e=t/(2*Math.PI)*Math.asin(d/n),-n*Math.pow(2,10*(s-=1))*Math.sin((s*i-e)*(2*Math.PI)/t)+h)}();else if("ease-in-elastic-strong"===c)v=this.tween(e,t,{o:.1,type:"ease-in-elastic"});else if("ease-out-elastic-weak"===c)v=this.tween(e,t,{o:.5,type:"ease-out-elastic"});else if("ease-out-elastic"===c)v=function(){var e=1.70158,t=0,n=d;return 0===s?h:1==(s/=i)?h+d:(t||(t=i*(r||.3)),n<Math.abs(d+.1)?(n=d,e=t/4):e=t/(2*Math.PI)*Math.asin(d/n),n*Math.pow(2,-10*s)*Math.sin((s*i-e)*(2*Math.PI)/t)+d+h)}();else if("ease-out-elastic-strong"===c)v=this.tween(e,t,{o:.1,type:"ease-out-elastic"});else if("ease-in-out-elastic-weak"===c)v=this.tween(e,t,{o:.5,type:"ease-in-out-elastic"});else if("ease-in-out-elastic"===c)v=function(){var e=1.70158,t=0,n=d;return 0===s?h:2==(s/=i/2)?h+d:(t||(t=i*(1.5*(r||.3))),n<Math.abs(d+.1)?(n=d,e=t/4):e=t/(2*Math.PI)*Math.asin(d/n),s<1?n*Math.pow(2,10*(s-=1))*Math.sin((s*i-e)*(2*Math.PI)/t)*-.5+h:n*Math.pow(2,-10*(s-=1))*Math.sin((s*i-e)*(2*Math.PI)/t)*.5+d+h)}();else if("ease-in-out-elastic-strong"===c)v=this.tween(e,t,{o:.1,type:"ease-in-out-elastic"});else if("ease-in-back-weak"===c)v=this.tween(e,t,{o:1.30158,type:"ease-in-back"});else if("ease-in-back"===c){var w=r||1.70158;v=d*(s/=i)*s*((w+1)*s-w)+h}else if("ease-in-back-strong"===c)v=this.tween(e,t,{o:2.40158,type:"ease-in-back"});else if("ease-out-back-weak"===c)v=this.tween(e,t,{o:1.30158,type:"ease-out-back"});else if("ease-out-back"===c){var g=r||1.70158;v=d*((s=s/i-1)*s*((g+1)*s+g)+1)+h}else if("ease-out-back-strong"===c)v=this.tween(e,t,{o:2.40158,type:"ease-out-back"});else if("ease-in-out-back-weak"===c)v=this.tween(e,t,{o:1.30158,type:"ease-in-out-back"});else if("ease-in-out-back"===c){var b=r||1.70158;v=(s/=i/2)<1?d/2*(s*s*((1+(b*=1.525))*s-b))+h:d/2*((s-=2)*s*((1+(b*=1.525))*s+b)+2)+h}else v="ease-in-out-back-strong"===c?this.tween(e,t,{o:2.40158,type:"ease-in-out-back"}):"ease-in-bounce"===c?d-this.tween(e,t,{t:i-s,b:0,c:d,d:i,type:"ease-out-bounce"})+h:"ease-out-bounce"===c?(s/=i)<1/2.75?d*(7.5625*s*s)+h:s<2/2.75?d*(7.5625*(s-=1.5/2.75)*s+.75)+h:s<2.5/2.75?d*(7.5625*(s-=2.25/2.75)*s+.9375)+h:d*(7.5625*(s-=2.625/2.75)*s+.984375)+h:"ease-in-out-bounce"===c?s<i/2?.5*this.tween(e,t,{t:2*s,b:0,c:d,d:i,type:"ease-in-bounce"})+h:.5*this.tween(e,t,{t:2*s-i,b:0,c:d,d:i,type:"ease-out-bounce"})+.5*d+h:d*s/i+h;return v}},{key:"getNew",value:function(e){var t="function"==typeof this.startX?this.startX(e):this.startX,n="function"==typeof this.startY?this.startY(e):this.startY,r="function"==typeof this.endX?this.endX(e,t):this.endX,a="function"==typeof this.endY?this.endY(e,n):this.endY,i=this.tweenCurrent,o="function"==typeof i?i(e):i,s=this.tweenDuration,u="function"==typeof s?s(e):s,c="function"==typeof this.tweenType?this.tweenType(e):this.tweenType,l="function"==typeof this.size?this.size(e):this.size,h="function"==typeof this.image?this.image(e):this.image,f={};return this.onCreate(),f.id=e,f.startX=t,f.startY=n,f.x=t,f.y=n,f.endX=r,f.endY=a,f.tweenCurrent=o,f.tweenDuration=u,f.tweenTypeX="function"==typeof this.tweenTypeX?this.tweenTypeX(e):this.tweenTypeX||c,f.tweenTypeY="function"==typeof this.tweenTypeY?this.tweenTypeY(e):this.tweenTypeY||c,f.onEnd=this.onParticleEnd,f.size=l,this.windStatic?(f.windX="function"==typeof this.windX?this.windX(e):this.windX,f.windY="function"==typeof this.windY?this.windY(e):this.windY):(f.windX=this.windX||0,f.windY=this.windY||0),f.color=this.color,f.image=h,f.imageWidth=this.imageWidth,f.imageHeight=this.imageHeight,f}},{key:"reevaluate",value:function(e){var t="function"==typeof this.startX?this.startX(e.id):this.startX,n="function"==typeof this.startY?this.startY(e.id):this.startY,r="function"==typeof this.endX?this.endX(e.id,t):this.endX,a="function"==typeof this.endY?this.endY(e.id,n):this.endY;e.x=e.startX=t,e.y=e.startY=n,e.endX=r,e.endY=a,this.windStatic&&(e.windX="function"==typeof this.windX?this.windX(e.id):this.windX,e.windY="function"==typeof this.windY?this.windY(e.id):this.windY),e.tweenCurrent=0}},{key:"populate",value:function(e){var t=this;e?(this.collection.push(this.getNew(this.collection.length)),this.collection.length<this.quantity&&("function"==typeof e?setTimeout(function(){return t.populate(e)},e()):"number"==typeof e?setTimeout(function(){return t.populate(e)},e):setTimeout(function(){return t.populate()},1))):this.collection=new Array(this.quantity).fill(null).map(function(e,n){return t.getNew(n)})}},{key:"onMove",value:function(e){}},{key:"draw",value:function(e,t){var n=this,r=e,a=r.image,i=r.size||1;if(t?this.ctx.fillStyle=this.clearColor:"function"==typeof e.color?this.ctx.fillStyle=e.color(e):this.ctx.fillStyle=e.color,a&&a instanceof Array&&a.length){var o=r.imageWidth/a[0].length,s=r.imageHeight/a.length;a.forEach(function(e,a){e.forEach(function(e,u){t&&e?n.ctx.fillRect(r.x+u*o-1,r.y+a*s-1,i*o+1,i*s+1):e&&n.ctx.fillRect(r.x+u*o,r.y+a*s,i*o,i*s)})})}else if(a){var u=r.x-r.imageWidth/2,c=r.y-r.imageHeight/2;r.imageWidth&&r.imageHeight?this.ctx.drawImage(a,u,c,r.imageWidth,r.imageHeight):this.ctx.drawImage(a,u,c)}else if(r.circle)this.ctx.beginPath(),this.ctx.arc(r.x,r.y,i,0,2*Math.PI),this.ctx.fill();else if(this.gradient){var l=this.ctx.createRadialGradient(r.x+i/2,r.y+i/2,0,r.x+i/2,r.y+i/2,i/2);if("function"==typeof this.gradient){var h=this.gradient(r);l.addColorStop(0,h[0]),l.addColorStop(1,h[1])}else l.addColorStop(0,this.gradient[0]),l.addColorStop(1,this.gradient[1]);this.ctx.fillStyle=l,this.ctx.fillRect(r.x,r.y,i,i)}else this.ctx.fillRect(r.x,r.y,i,i)}},{key:"clear",value:function(e){this.draw(e,!0)}},{key:"onCreate",value:function(){}},{key:"onParticleEnd",value:function(){}},{key:"onEscape",value:function(){}},{key:"process",value:function(){var e=this;this.active&&(this.clearFrame(),this.getFrame(),this.afterDraw(),1===this.tweenSpeed?requestAnimationFrame(function(){return e.process()}):setTimeout(function(){return e.process()},this.tweenSpeed))}},{key:"afterDraw",value:function(){}},{key:"clearFrame",value:function(){this.clear&&this.background?this.ctx.putImageData(this.background,0,0):this.clear&&(this.ctx.fillStyle=this.clearColor,this.ctx.fillRect(0,0,this.easel.viewport.w,this.easel.viewport.h))}},{key:"getFrame",value:function(){var e=this;this.collection.forEach(function(t){t.imageClear&&e.clear(t),e.constructor.wind(t),e.onMove(t),(t.x<0||t.y<0||t.x>e.easel.viewport.w||t.y>e.easel.viewport.h)&&e.onEscape(t),t.tweenCurrent<t.tweenDuration&&(t.x=e.tween(t,"x"),t.y=e.tween(t,"y")),t.tweenCurrent++,t.tweenCurrent>=t.tweenDuration&&t.onEnd&&t.onEnd.call(e,t),e.draw(t)})}}],[{key:"reset",value:function(e){e.x=e.startX=e.originX,e.y=e.startY=e.originY,e.endX=e.terminalX,e.endY=e.terminalY,e.tweenCurrent=0}},{key:"wind",value:function(e){"function"==typeof e.windX?e.endX+=e.windX(e):e.windX&&(e.endX+=e.windX),"function"==typeof e.windY?e.endY+=e.windY(e):e.windY&&(e.endY+=e.windY),"function"==typeof e.windX?e.startX+=e.windX(e):e.windX&&(e.startX+=e.windX),"function"==typeof e.windY?e.startY+=e.windY(e):e.windY&&(e.startY+=e.windY)}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11);Object.defineProperty(t,"Ion",{enumerable:!0,get:function(){return r.Ion}});var a=n(10);Object.defineProperty(t,"IonCloud",{enumerable:!0,get:function(){return a.IonCloud}});var i=n(3);Object.defineProperty(t,"Easel",{enumerable:!0,get:function(){return i.Easel}}),Object.defineProperty(t,"Easel3d",{enumerable:!0,get:function(){return i.Easel3d}});var o=n(0);Object.defineProperty(t,"ink",{enumerable:!0,get:function(){return o.ink}}),Object.defineProperty(t,"convert2rgba",{enumerable:!0,get:function(){return o.convert2rgba}}),Object.defineProperty(t,"convert2rgb",{enumerable:!0,get:function(){return o.convert2rgb}}),Object.defineProperty(t,"convert2hsba",{enumerable:!0,get:function(){return o.convert2hsba}}),Object.defineProperty(t,"convert2hsva",{enumerable:!0,get:function(){return o.convert2hsva}}),Object.defineProperty(t,"convert2hsb",{enumerable:!0,get:function(){return o.convert2hsb}}),Object.defineProperty(t,"convert2hsv",{enumerable:!0,get:function(){return o.convert2hsv}}),Object.defineProperty(t,"convert2hsla",{enumerable:!0,get:function(){return o.convert2hsla}}),Object.defineProperty(t,"convert2hsl",{enumerable:!0,get:function(){return o.convert2hsl}}),Object.defineProperty(t,"convert2hex",{enumerable:!0,get:function(){return o.convert2hex}}),Object.defineProperty(t,"convert2cmyk",{enumerable:!0,get:function(){return o.convert2cmyk}});var s=n(2);Object.defineProperty(t,"Phaser",{enumerable:!0,get:function(){return s.Phaser}});var u=n(1);Object.defineProperty(t,"Dice",{enumerable:!0,get:function(){return u.Dice}})}])});
},{}],"../../index.js":[function(require,module,exports) {
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Ion = void 0;

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

var Ion =
/*#__PURE__*/
function () {
  function Ion(easel) {
    _classCallCheck(this, Ion);

    this.active = true;
    this.easel = easel;
    this.ctx = easel.ctx;
    this.collection = [];
    this.quantity = 1;
    this.size = 1;
    this.startX = 0;
    this.startY = 0;
    this.endX = 1;
    this.endY = 1;
    this.windX = 0;
    this.windY = 0;
    this.clear = true;
    this.color = '#48F';
    this.clearColor = '#000';
    this.tweenType = 0;
    this.tweenCurrent = 0;
    this.tweenDuration = 1000;
    this.tweenSpeed = 1;
    this.background = null; //if set, will re-apply before each frame

    if (!this.ctx) throw new Error('Ion initialized without easel.');
  } // Ease is a tweening function using Robert Penner's equations to identify
  // the values of an axis in respect to it's start location, destination,
  // and the normalization of the transition between the two with respect to
  // starting time, a given duration, and the function to impose upon the
  // transition from that start position to it's destination.

  /* eslint-disable */


  _createClass(Ion, [{
    key: "tween",
    value: function tween(particle, axis) {
      var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
          o = _ref.o,
          _ref$d = _ref.d,
          d = _ref$d === void 0 ? particle.tweenDuration : _ref$d,
          _ref$t = _ref.t,
          t = _ref$t === void 0 ? particle.tweenCurrent : _ref$t,
          _ref$type = _ref.type,
          type = _ref$type === void 0 ? axis === 'x' ? particle.tweenTypeX : particle.tweenTypeY : _ref$type,
          _ref$b = _ref.b,
          b = _ref$b === void 0 ? axis === 'x' ? particle.startX : particle.startY : _ref$b,
          _ref$c = _ref.c,
          c = _ref$c === void 0 ? axis === 'x' ? particle.endX - particle.startX : particle.endY - particle.startY : _ref$c;

      var result; //returns computed x or y location

      if (type === 'ease-in-quad') {
        result = c * (t /= d) * t + b;
      } else if (type === 'ease-out-quad') {
        result = -c * (t /= d) * (t - 2) + b;
      } else if (type === 'ease-in-out-quad') {
        result = (t /= d / 2) < 1 ? c / 2 * t * t + b : -c / 2 * (--t * (t - 2) - 1) + b;
      } else if (type === 'ease-in-cubic') {
        result = c * (t /= d) * t * t + b;
      } else if (type === 'ease-out-cubic') {
        result = c * ((t = t / d - 1) * t * t + 1) + b;
      } else if (type === 'ease-in-out-cubic') {
        result = (t /= d / 2) < 1 ? c / 2 * t * t * t + b : c / 2 * ((t -= 2) * t * t + 2) + b;
      } else if (type === 'ease-in-quart') {
        result = c * (t /= d) * t * t * t + b;
      } else if (type === 'ease-out-quart') {
        result = -c * ((t = t / d - 1) * t * t * t - 1) + b;
      } else if (type === 'ease-in-out-quart') {
        result = (t /= d / 2) < 1 ? c / 2 * t * t * t * t + b : -c / 2 * ((t -= 2) * t * t * t - 2) + b;
      } else if (type === 'ease-in-quint') {
        result = c * (t /= d) * t * t * t * t + b;
      } else if (type === 'ease-out-quint') {
        result = c * ((t = t / d - 1) * t * t * t * t + 1) + b;
      } else if (type === 'ease-in-out-quint') {
        result = (t /= d / 2) < 1 ? c / 2 * t * t * t * t * t + b : c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
      } else if (type === 'ease-in-sine') {
        result = -c * Math.cos(t / d * (Math.PI / 2)) + c + b;
      } else if (type === 'ease-out-sine') {
        result = c * Math.sin(t / d * (Math.PI / 2)) + b;
      } else if (type === 'ease-in-out-sine') {
        result = -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
      } else if (type === 'ease-in-exponential') {
        result = t === 0 ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
      } else if (type === 'ease-out-exponential') {
        result = t === d ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
      } else if (type === 'ease-in-out-exponential') {
        result = t === 0 ? b : t === d ? b + c : (t /= d / 2) < 1 ? c / 2 * Math.pow(2, 10 * (t - 1)) + b : c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
      } else if (type === 'ease-in-circular') {
        result = -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;
      } else if (type === 'ease-out-circular') {
        result = c * Math.sqrt(1 - (t = t / d - 1) * t) + b;
      } else if (type === 'ease-in-out-circular') {
        result = (t /= d / 2) < 1 ? -c / 2 * (Math.sqrt(1 - t * t) - 1) + b : c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;
      } else if (type === 'ease-in-elastic-weak') {
        result = this.tween(particle, axis, {
          o: 0.5,
          type: 'ease-in-elastic'
        });
      } else if (type === 'ease-in-elastic') {
        result = function () {
          var s = 1.70158,
              p = 0,
              a = c;
          if (t === 0) return b;
          if ((t /= d) === 1) return b + c;
          if (!p) p = d * (o || 0.3);

          if (a < Math.abs(c + 0.1)) {
            a = c;
            s = p / 4;
          } else {
            s = p / (2 * Math.PI) * Math.asin(c / a);
          } //end if


          return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
        }();
      } else if (type === 'ease-in-elastic-strong') {
        result = this.tween(particle, axis, {
          o: 0.1,
          type: 'ease-in-elastic'
        });
      } else if (type === 'ease-out-elastic-weak') {
        result = this.tween(particle, axis, {
          o: 0.5,
          type: 'ease-out-elastic'
        });
      } else if (type === 'ease-out-elastic') {
        result = function () {
          var s = 1.70158,
              p = 0,
              a = c;
          if (t === 0) return b;
          if ((t /= d) === 1) return b + c;
          if (!p) p = d * (o || 0.3);

          if (a < Math.abs(c + 0.1)) {
            a = c;
            s = p / 4;
          } else {
            s = p / (2 * Math.PI) * Math.asin(c / a);
          } //end if


          return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
        }();
      } else if (type === 'ease-out-elastic-strong') {
        result = this.tween(particle, axis, {
          o: 0.1,
          type: 'ease-out-elastic'
        });
      } else if (type === 'ease-in-out-elastic-weak') {
        result = this.tween(particle, axis, {
          o: 0.5,
          type: 'ease-in-out-elastic'
        });
      } else if (type === 'ease-in-out-elastic') {
        result = function () {
          var s = 1.70158,
              p = 0,
              a = c;
          if (t === 0) return b;
          if ((t /= d / 2) === 2) return b + c;
          if (!p) p = d * ((o || 0.3) * 1.5);

          if (a < Math.abs(c + 0.1)) {
            a = c;
            s = p / 4;
          } else {
            s = p / (2 * Math.PI) * Math.asin(c / a);
          } //end if


          if (t < 1) return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
          return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * 0.5 + c + b;
        }();
      } else if (type === 'ease-in-out-elastic-strong') {
        result = this.tween(particle, axis, {
          o: 0.1,
          type: 'ease-in-out-elastic'
        });
      } else if (type === 'ease-in-back-weak') {
        result = this.tween(particle, axis, {
          o: 1.30158,
          type: 'ease-in-back'
        });
      } else if (type === 'ease-in-back') {
        var s = o || 1.70158;
        result = c * (t /= d) * t * ((s + 1) * t - s) + b;
      } else if (type === 'ease-in-back-strong') {
        result = this.tween(particle, axis, {
          o: 2.40158,
          type: 'ease-in-back'
        });
      } else if (type === 'ease-out-back-weak') {
        result = this.tween(particle, axis, {
          o: 1.30158,
          type: 'ease-out-back'
        });
      } else if (type === 'ease-out-back') {
        var _s = o || 1.70158;

        result = c * ((t = t / d - 1) * t * ((_s + 1) * t + _s) + 1) + b;
      } else if (type === 'ease-out-back-strong') {
        result = this.tween(particle, axis, {
          o: 2.40158,
          type: 'ease-out-back'
        });
      } else if (type === 'ease-in-out-back-weak') {
        result = this.tween(particle, axis, {
          o: 1.30158,
          type: 'ease-in-out-back'
        });
      } else if (type === 'ease-in-out-back') {
        var _s2 = o || 1.70158;

        if ((t /= d / 2) < 1) {
          result = c / 2 * (t * t * (((_s2 *= 1.525) + 1) * t - _s2)) + b;
        } else {
          result = c / 2 * ((t -= 2) * t * (((_s2 *= 1.525) + 1) * t + _s2) + 2) + b;
        } //end if

      } else if (type === 'ease-in-out-back-strong') {
        result = this.tween(particle, axis, {
          o: 2.40158,
          type: 'ease-in-out-back'
        });
      } else if (type === 'ease-in-bounce') {
        result = c - this.tween(particle, axis, {
          t: d - t,
          b: 0,
          c: c,
          d: d,
          type: 'ease-out-bounce'
        }) + b;
      } else if (type === 'ease-out-bounce') {
        if ((t /= d) < 1 / 2.75) {
          result = c * (7.5625 * t * t) + b;
        } else if (t < 2 / 2.75) {
          result = c * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + b;
        } else if (t < 2.5 / 2.75) {
          result = c * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + b;
        } else {
          result = c * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + b;
        } //end if

      } else if (type === 'ease-in-out-bounce') {
        if (t < d / 2) {
          result = this.tween(particle, axis, {
            t: t * 2,
            b: 0,
            c: c,
            d: d,
            type: 'ease-in-bounce'
          }) * 0.5 + b;
        } else {
          result = this.tween(particle, axis, {
            t: t * 2 - d,
            b: 0,
            c: c,
            d: d,
            type: 'ease-out-bounce'
          }) * 0.5 + c * 0.5 + b;
        } //end if

      } else {
        //linear catch-all
        result = c * t / d + b;
      } //end if


      return result;
    }
    /* eslint-enable */
    // getNew will create a new particle and return that result. It's possible
    // to override the function to develop a custom particle generator for more
    // specific applications.

  }, {
    key: "getNew",
    value: function getNew(id) {
      var sx = typeof this.startX === 'function' ? this.startX(id) : this.startX,
          sy = typeof this.startY === 'function' ? this.startY(id) : this.startY,
          dx = typeof this.endX === 'function' ? this.endX(id, sx) : this.endX,
          dy = typeof this.endY === 'function' ? this.endY(id, sy) : this.endY,
          ttc = this.tweenCurrent,
          //shorten reference
      c = typeof ttc === 'function' ? ttc(id) : ttc,
          ttd = this.tweenDuration,
          //shorten reference
      d = typeof ttd === 'function' ? ttd(id) : ttd,
          tt = typeof this.tweenType === 'function' ? this.tweenType(id) : this.tweenType,
          s = typeof this.size === 'function' ? this.size(id) : this.size,
          image = typeof this.image === 'function' ? this.image(id) : this.image,
          particle = {};
      this.onCreate(); //even fired as a new particle is created

      particle.id = id; //for referencing each particle outside library

      particle.startX = sx;
      particle.startY = sy;
      particle.x = sx;
      particle.y = sy;
      particle.endX = dx;
      particle.endY = dy;
      particle.tweenCurrent = c;
      particle.tweenDuration = d;
      particle.tweenTypeX = typeof this.tweenTypeX === 'function' ? this.tweenTypeX(id) : this.tweenTypeX || tt;
      particle.tweenTypeY = typeof this.tweenTypeY === 'function' ? this.tweenTypeY(id) : this.tweenTypeY || tt;
      particle.onEnd = this.onParticleEnd;
      particle.size = s; //the particle size

      if (this.windStatic) {
        particle.windX = typeof this.windX === 'function' ? this.windX(id) : this.windX;
        particle.windY = typeof this.windY === 'function' ? this.windY(id) : this.windY;
      } else {
        particle.windX = this.windX || 0; //wind functions are ran at runtime

        particle.windY = this.windY || 0; //wind function are ran at runtime
      } //end if


      particle.color = this.color; //each particle can be rendered with a diff color

      particle.image = image; //can be an image or a bit-array

      particle.imageWidth = this.imageWidth; //width in pixels

      particle.imageHeight = this.imageHeight; //height in pixels

      return particle;
    } // Reset will perform a small number of operations to reset a particle back
    // to its starting state instead of actually generating a new particle. This
    // can be helpful if you want to retain it's original starting location.

  }, {
    key: "reevaluate",
    // Reevaluate will instead of reseting the particle, reevaluate the starting
    // conditions of the particle; that is, it may only reset if the starting
    // conditions aren't functions
    value: function reevaluate(particle) {
      var startX = typeof this.startX === 'function' ? this.startX(particle.id) : this.startX,
          startY = typeof this.startY === 'function' ? this.startY(particle.id) : this.startY,
          endX = typeof this.endX === 'function' ? this.endX(particle.id, startX) : this.endX,
          endY = typeof this.endY === 'function' ? this.endY(particle.id, startY) : this.endY;
      particle.x = particle.startX = startX;
      particle.y = particle.startY = startY;
      particle.endX = endX;
      particle.endY = endY;

      if (this.windStatic) {
        particle.windX = typeof this.windX === 'function' ? this.windX(particle.id) : this.windX;
        particle.windY = typeof this.windY === 'function' ? this.windY(particle.id) : this.windY;
      } //end if


      particle.tweenCurrent = 0;
    } // Populate pushes a new particle into the particles array then checks to see
    // if the specified particle number has been reached, if it hasn't, then it
    // queues up itself asynchronously to create another particle. This recursive
    // action continues until the total particle quantity is reached.

  }, {
    key: "populate",
    value: function populate(wait) {
      var _this = this;

      if (!wait) {
        this.collection = new Array(this.quantity).fill(null).map(function (ignore, index) {
          return _this.getNew(index);
        });
      } else {
        this.collection.push(this.getNew(this.collection.length));

        if (this.collection.length < this.quantity) {
          if (typeof wait === 'function') {
            setTimeout(function () {
              return _this.populate(wait);
            }, wait());
          } else if (typeof wait === 'number') {
            setTimeout(function () {
              return _this.populate(wait);
            }, wait);
          } else {
            //assume its boolean or invalid and allow generic wait
            setTimeout(function () {
              return _this.populate();
            }, 1);
          } //end if

        } //end if

      } //end if

    } // Wind applies noise values on the movement patterns of the particles
    // instead of them performing their tweening operations unhindered. This
    // gives a more dynamic feel to their movement. The wind patterns and
    // function can be overridden to be dynamic or conditional as desired.

  }, {
    key: "onMove",
    // OnMove function is called right before a particle is moved
    value: function onMove(particle) {} //eslint-disable-line
    // Draw simply draws a particle

  }, {
    key: "draw",
    value: function draw(particle, isClear) {
      var _this2 = this;

      var p = particle,
          image = p.image,
          s = p.size || 1; //fallback of one if they made it custom & ignored

      if (isClear) {
        this.ctx.fillStyle = this.clearColor;
      } else if (typeof particle.color === 'function') {
        this.ctx.fillStyle = particle.color(particle);
      } else {
        this.ctx.fillStyle = particle.color;
      } //end if


      if (image && image instanceof Array && image.length) {
        var scaleX = p.imageWidth / image[0].length,
            scaleY = p.imageHeight / image.length;
        image.forEach(function (yo, y) {
          yo.forEach(function (xo, x) {
            if (isClear && xo) {
              _this2.ctx.fillRect(p.x + x * scaleX - 1, p.y + y * scaleY - 1, s * scaleX + 1, s * scaleY + 1);
            } else if (xo) {
              _this2.ctx.fillRect(p.x + x * scaleX, p.y + y * scaleY, s * scaleX, s * scaleY);
            } //end if

          });
        });
      } else if (image) {
        //image was passed, use it instead of a pixel particle
        var px = p.x - p.imageWidth / 2,
            py = p.y - p.imageHeight / 2;

        if (p.imageWidth && p.imageHeight) {
          //sizes given for constrain
          this.ctx.drawImage(image, px, py, p.imageWidth, p.imageHeight);
        } else {
          //no sizes given, just allow it to fill with images normal size
          this.ctx.drawImage(image, px, py);
        } //end if

      } else if (p.circle) {
        this.ctx.beginPath();
        this.ctx.arc(p.x, p.y, s, 0, 2 * Math.PI);
        this.ctx.fill();
      } else if (this.gradient) {
        var gradient = this.ctx.createRadialGradient(p.x + s / 2, p.y + s / 2, //start of circle (x,y)
        0, //radius inside
        p.x + s / 2, p.y + s / 2, //end of circle (x,y)
        s / 2 //radius outside
        );

        if (typeof this.gradient === 'function') {
          var colors = this.gradient(p);
          gradient.addColorStop(0, colors[0]);
          gradient.addColorStop(1, colors[1]);
        } else {
          gradient.addColorStop(0, this.gradient[0]);
          gradient.addColorStop(1, this.gradient[1]);
        }

        this.ctx.fillStyle = gradient;
        this.ctx.fillRect(p.x, p.y, s, s);
      } else {
        this.ctx.fillRect(p.x, p.y, s, s);
      } //end if

    } // Clear simply clears a particle

  }, {
    key: "clear",
    value: function clear(particle) {
      this.draw(particle, true);
    } // OnCreate function is called when a particle is created for the first
    // time. This allows one to keep track of how far into the creation of all
    // the particles one is given the particle total that they already control.

  }, {
    key: "onCreate",
    value: function onCreate() {} //eslint-disable-line
    // OnParticleEnd function is called after a particle finishes its tweening
    // motion. This is merely a template function that is required to be
    // overridden.

  }, {
    key: "onParticleEnd",
    value: function onParticleEnd() {} //eslint-disable-line
    // OnEscape function is called after a particle leaves the view space.
    // This is merely a template function that is required to be overridden.

  }, {
    key: "onEscape",
    value: function onEscape() {} //eslint-disable-line
    // Process is the automatic function that calls the getFrame main
    // function and after updating, queues the next update frame. It will
    // also auto-clear. This function is mostly used for testing a single
    // Ion instance. Most mock-ups of Ion should be done using the getFrame

  }, {
    key: "process",
    value: function process() {
      var _this3 = this;

      if (!this.active) return;
      this.clearFrame();
      this.getFrame();
      this.afterDraw();

      if (this.tweenSpeed === 1) {
        requestAnimationFrame(function () {
          return _this3.process();
        });
      } else {
        setTimeout(function () {
          return _this3.process();
        }, this.tweenSpeed);
      } //end if

    } // afterDraw function is called after an entire frame has finished rendering

  }, {
    key: "afterDraw",
    value: function afterDraw() {} //eslint-disable-line
    // this clears everything on the screen

  }, {
    key: "clearFrame",
    value: function clearFrame() {
      if (this.clear && this.background) {
        this.ctx.putImageData(this.background, 0, 0);
      } else if (this.clear) {
        this.ctx.fillStyle = this.clearColor;
        this.ctx.fillRect(0, 0, this.easel.viewport.w, this.easel.viewport.h);
      } //end if

    } // getFrame is what operates on the tweening functions for the particles,
    // it calls the draw function for each particle after its operations

  }, {
    key: "getFrame",
    value: function getFrame() {
      var _this4 = this;

      this.collection.forEach(function (p) {
        if (p.imageClear) _this4.clear(p);

        _this4.constructor.wind(p);

        _this4.onMove(p);

        if (p.x < 0 || p.y < 0 || p.x > _this4.easel.viewport.w || p.y > _this4.easel.viewport.h) {
          _this4.onEscape(p);
        } //end if


        if (p.tweenCurrent < p.tweenDuration) {
          p.x = _this4.tween(p, 'x');
          p.y = _this4.tween(p, 'y');
        } //end if


        p.tweenCurrent++;
        if (p.tweenCurrent >= p.tweenDuration && p.onEnd) p.onEnd.call(_this4, p);

        _this4.draw(p);
      });
    }
  }], [{
    key: "reset",
    value: function reset(particle) {
      particle.x = particle.startX = particle.originX;
      particle.y = particle.startY = particle.originY;
      particle.endX = particle.terminalX; //wind may have corrupted endX

      particle.endY = particle.terminalY; //wind may have corrupted endY

      particle.tweenCurrent = 0;
    }
  }, {
    key: "wind",
    value: function wind(particle) {
      if (typeof particle.windX === 'function') {
        particle.endX += particle.windX(particle);
      } else if (particle.windX) {
        particle.endX += particle.windX;
      } //end if


      if (typeof particle.windY === 'function') {
        particle.endY += particle.windY(particle);
      } else if (particle.windY) {
        particle.endY += particle.windY;
      } //end if


      if (typeof particle.windX === 'function') {
        particle.startX += particle.windX(particle);
      } else if (particle.windX) {
        particle.startX += particle.windX;
      } //end if


      if (typeof particle.windY === 'function') {
        particle.startY += particle.windY(particle);
      } else if (particle.windY) {
        particle.startY += particle.windY;
      } //end if

    }
  }]);

  return Ion;
}(); //end class Ion


exports.Ion = Ion;
},{}],"index.js":[function(require,module,exports) {
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.easel = void 0;

require("./index.styl");

var _ionCloud = require("ion-cloud");

var _index2 = require("../../index");

var easel = new _ionCloud.Easel();
exports.easel = easel;
var waterfall = new _index2.Ion(easel); // Launch application if easel was able to create a canvas,
// if it wasn't then we know canvas isn't supported

var noscript = document.querySelector('noscript');

if (!easel.activated) {
  noscript.innerHTML = "\n  <p class=\"browsehappy\">\n    You are using an outdated browser. Please\n    <a href=\"http://browsehappy.com/\"> upgrade your browser</a>\n    to improve your experience.\n    <span style=\"color:red;\"><br/>Canvas isn't supported in your browser.</span>\n  </p>";
} else {
  noscript.style.display = 'none';
  waterfall.quantity = 1000;
  waterfall.tweenDuration = 500;

  waterfall.startX = function () {
    return Math.random() * easel.viewport.w / 4 + easel.viewport.w / 8 * 3;
  };

  waterfall.startY = function () {
    return 1;
  };

  waterfall.endX = function () {
    return Math.random() * easel.viewport.w / 4 + easel.viewport.w / 8 * 3;
  };

  waterfall.endY = function () {
    return easel.viewport.h;
  };

  waterfall.windX = function () {
    return Math.random() * 3 - 1.5;
  };

  waterfall.size = function () {
    return Math.random() * 2 + 1;
  };

  waterfall.tweenCurrent = function () {
    return Math.random() * waterfall.tweenDuration;
  };

  waterfall.tweenType = 'ease-out-bounce';
  waterfall.onEscape = waterfall.reevaluate;
  waterfall.onParticleEnd = waterfall.reevaluate;
  waterfall.populate();
  waterfall.process();
} //end if
},{"./index.styl":"index.styl","ion-cloud":"../node_modules/ion-cloud/index.js","../../index":"../../index.js"}],"../node_modules/parcel/src/builtins/hmr-runtime.js":[function(require,module,exports) {
var global = arguments[3];
var OVERLAY_ID = '__parcel__error__overlay__';
var OldModule = module.bundle.Module;

function Module(moduleName) {
  OldModule.call(this, moduleName);
  this.hot = {
    data: module.bundle.hotData,
    _acceptCallbacks: [],
    _disposeCallbacks: [],
    accept: function (fn) {
      this._acceptCallbacks.push(fn || function () {});
    },
    dispose: function (fn) {
      this._disposeCallbacks.push(fn);
    }
  };
  module.bundle.hotData = null;
}

module.bundle.Module = Module;
var checkedAssets, assetsToAccept;
var parent = module.bundle.parent;

if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
  var hostname = "" || location.hostname;
  var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
  var ws = new WebSocket(protocol + '://' + hostname + ':' + "49725" + '/');

  ws.onmessage = function (event) {
    checkedAssets = {};
    assetsToAccept = [];
    var data = JSON.parse(event.data);

    if (data.type === 'update') {
      var handled = false;
      data.assets.forEach(function (asset) {
        if (!asset.isNew) {
          var didAccept = hmrAcceptCheck(global.parcelRequire, asset.id);

          if (didAccept) {
            handled = true;
          }
        }
      }); // Enable HMR for CSS by default.

      handled = handled || data.assets.every(function (asset) {
        return asset.type === 'css' && asset.generated.js;
      });

      if (handled) {
        console.clear();
        data.assets.forEach(function (asset) {
          hmrApply(global.parcelRequire, asset);
        });
        assetsToAccept.forEach(function (v) {
          hmrAcceptRun(v[0], v[1]);
        });
      } else if (location.reload) {
        // `location` global exists in a web worker context but lacks `.reload()` function.
        location.reload();
      }
    }

    if (data.type === 'reload') {
      ws.close();

      ws.onclose = function () {
        location.reload();
      };
    }

    if (data.type === 'error-resolved') {
      console.log('[parcel] ✨ Error resolved');
      removeErrorOverlay();
    }

    if (data.type === 'error') {
      console.error('[parcel] 🚨  ' + data.error.message + '\n' + data.error.stack);
      removeErrorOverlay();
      var overlay = createErrorOverlay(data);
      document.body.appendChild(overlay);
    }
  };
}

function removeErrorOverlay() {
  var overlay = document.getElementById(OVERLAY_ID);

  if (overlay) {
    overlay.remove();
  }
}

function createErrorOverlay(data) {
  var overlay = document.createElement('div');
  overlay.id = OVERLAY_ID; // html encode message and stack trace

  var message = document.createElement('div');
  var stackTrace = document.createElement('pre');
  message.innerText = data.error.message;
  stackTrace.innerText = data.error.stack;
  overlay.innerHTML = '<div style="background: black; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; opacity: 0.85; font-family: Menlo, Consolas, monospace; z-index: 9999;">' + '<span style="background: red; padding: 2px 4px; border-radius: 2px;">ERROR</span>' + '<span style="top: 2px; margin-left: 5px; position: relative;">🚨</span>' + '<div style="font-size: 18px; font-weight: bold; margin-top: 20px;">' + message.innerHTML + '</div>' + '<pre>' + stackTrace.innerHTML + '</pre>' + '</div>';
  return overlay;
}

function getParents(bundle, id) {
  var modules = bundle.modules;

  if (!modules) {
    return [];
  }

  var parents = [];
  var k, d, dep;

  for (k in modules) {
    for (d in modules[k][1]) {
      dep = modules[k][1][d];

      if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) {
        parents.push(k);
      }
    }
  }

  if (bundle.parent) {
    parents = parents.concat(getParents(bundle.parent, id));
  }

  return parents;
}

function hmrApply(bundle, asset) {
  var modules = bundle.modules;

  if (!modules) {
    return;
  }

  if (modules[asset.id] || !bundle.parent) {
    var fn = new Function('require', 'module', 'exports', asset.generated.js);
    asset.isNew = !modules[asset.id];
    modules[asset.id] = [fn, asset.deps];
  } else if (bundle.parent) {
    hmrApply(bundle.parent, asset);
  }
}

function hmrAcceptCheck(bundle, id) {
  var modules = bundle.modules;

  if (!modules) {
    return;
  }

  if (!modules[id] && bundle.parent) {
    return hmrAcceptCheck(bundle.parent, id);
  }

  if (checkedAssets[id]) {
    return;
  }

  checkedAssets[id] = true;
  var cached = bundle.cache[id];
  assetsToAccept.push([bundle, id]);

  if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
    return true;
  }

  return getParents(global.parcelRequire, id).some(function (id) {
    return hmrAcceptCheck(global.parcelRequire, id);
  });
}

function hmrAcceptRun(bundle, id) {
  var cached = bundle.cache[id];
  bundle.hotData = {};

  if (cached) {
    cached.hot.data = bundle.hotData;
  }

  if (cached && cached.hot && cached.hot._disposeCallbacks.length) {
    cached.hot._disposeCallbacks.forEach(function (cb) {
      cb(bundle.hotData);
    });
  }

  delete bundle.cache[id];
  bundle(id);
  cached = bundle.cache[id];

  if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
    cached.hot._acceptCallbacks.forEach(function (cb) {
      cb();
    });

    return true;
  }
}
},{}]},{},["../node_modules/parcel/src/builtins/hmr-runtime.js","index.js"], null)
//# sourceMappingURL=/src.e31bb0bc.js.map