summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore26
-rw-r--r--bundle.js2
-rw-r--r--bundle.js.map1
-rw-r--r--client/index.js511
-rw-r--r--client/lib/color.js31
-rw-r--r--client/lib/intonation.js162
-rw-r--r--client/lib/kalimba.js47
-rw-r--r--client/lib/keys.js39
-rw-r--r--client/lib/scales.js299
-rw-r--r--client/lib/startAudioContext.js181
-rw-r--r--client/lib/util.js198
-rw-r--r--index.html180
-rw-r--r--package-lock.json3716
-rw-r--r--package.json28
-rw-r--r--webpack.config.js24
15 files changed, 5445 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..851e96a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,26 @@
+*~
+v1
+.DS_Store
+*.orig
+.sass-cache/
+.#*
+*.swp
+node_modules/
+node_modules
+dist
+*.sql
+!bucky-schema.sql
+.env
+public/data
+.my.cnf
+search.db
+search.db.1
+search/db/env/*
+uploads
+npm-debug.log
+app.min.js
+app.min.js.map
+
+__pycache__
+*.pyc
+
diff --git a/bundle.js b/bundle.js
new file mode 100644
index 0000000..dfb9662
--- /dev/null
+++ b/bundle.js
@@ -0,0 +1,2 @@
+!function(t){function e(n){if(i[n])return i[n].exports;var s=i[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,i){!function(e,i){t.exports=i()}(0,function(){return function(t){function e(n){if(i[n])return i[n].exports;var s=i[n]={exports:{},id:n,loaded:!1};return t[n].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";var n=function(t){return t&&t.__esModule?t.default:t}(i(1));t.exports=n},function(t,e,i){"use strict";function n(){return k.colors}function s(){return k.context}function r(){return k.clock}var o=function(t){return t&&t.__esModule?t.default:t},a=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),h=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};e.colors=n,e.context=s,e.clock=r,Object.defineProperty(e,"__esModule",{value:!0});var l=o(i(2)),u=o(i(5)),c=o(i(38)),f=o(i(40)),d=function(t){return t&&t.__esModule?t:{default:t}}(i(39)),v=i(28),p=i(41),m=i(27),b=i(26),g=i(25),y=o(i(42)),x=o(i(45)),w=function(){function t(e){h(this,t);for(var i in l)this[i]=l[i];for(var i in u)this[i]=u[i];var n={Rack:c},s={Counter:v,Radio:p,Drunk:m,Sequence:b,Matrix:g};for(var i in s)this[i]=s[i];for(var i in n)this[i]=n[i];var r=window.AudioContext||window.webkitAudioContext;this._context=e||new r,this.tune=new f,this.note=this.tune.note.bind(this.tune),this.clock=new y(this._context),this.clock.start(),this.Interval=x,this.colors={accent:"#2bb",fill:"#eee",light:"#fff",dark:"#333",mediumLight:"#ccc",mediumDark:"#666"},this.transform=d,this.add=d.add,this.Add={};for(var i in l)this.Add[i]=d.add.bind(this,i);var o=document.getElementsByTagName("style"),a=document.createElement("style");if(a.type="text/css",a.innerHTML="[nexus-ui]{height:5000px;width:5000px}",o.length>0){o[0].parentNode.insertBefore(a,o[0])}else document.write("<style>[nexus-ui]{height:5000px;width:5000px}</style>")}return a(t,{context:{get:function(){return this._context},set:function(t){this.clock.stop(),this._context=t,this.clock=new y(this.context),this.clock.start()}}}),t}(),k=new w;e.default=k},function(t,e,i){"use strict";t.exports={Position:i(3),Slider:i(14),Toggle:i(15),Button:i(16),TextButton:i(18),RadioButton:i(19),Number:i(20),Select:i(21),Dial:i(22),Piano:i(23),Sequencer:i(24),Pan2D:i(29),Tilt:i(30),Multislider:i(31),Pan:i(33),Envelope:i(34),Spectrogram:i(35),Meter:i(36),Oscilloscope:i(37)}},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(4),h=i(6),l=i(11),u=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),c=function(t){function e(){o(this,e);var t=["value"],i={size:[200,200],mode:"absolute",minX:0,maxX:1,stepX:0,x:.5,minY:0,maxY:1,stepY:0,y:.5};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this._x=new l(this.settings.minX,this.settings.maxX,this.settings.stepX,this.settings.x),this._y=new l(this.settings.minY,this.settings.maxY,this.settings.stepY,this.settings.y),this.position={x:new u.Handle(this.settings.mode,"horizontal",[0,this.width],[this.height,0]),y:new u.Handle(this.settings.mode,"vertical",[0,this.width],[this.height,0])},this.position.x.value=this._x.normalized,this.position.y.value=this._y.normalized,this.init(),this.render()}return r(e,t),n(e,{buildInterface:{value:function(){this.knob=a.create("circle"),this.element.appendChild(this.knob)}},sizeInterface:{value:function(){this.position.x.resize([0,this.width],[this.height,0]),this.position.y.resize([0,this.width],[this.height,0]),this._minDimension=Math.min(this.width,this.height),this.knobRadius={off:5*~~(this._minDimension/100)+5},this.knobRadius.on=2*this.knobRadius.off,this.knob.setAttribute("cx",this.width/2),this.knob.setAttribute("cy",this.height/2),this.knob.setAttribute("r",this.knobRadius.off)}},colorInterface:{value:function(){this.element.style.backgroundColor=this.colors.fill,this.knob.setAttribute("fill",this.colors.accent)}},render:{value:function(){this.clicked?this.knob.setAttribute("r",this.knobRadius.on):this.knob.setAttribute("r",this.knobRadius.off),this.knobCoordinates={x:this._x.normalized*this.width,y:this.height-this._y.normalized*this.height},this.knob.setAttribute("cx",this.knobCoordinates.x),this.knob.setAttribute("cy",this.knobCoordinates.y)}},click:{value:function(){this.position.x.anchor=this.mouse,this.position.y.anchor=this.mouse,this.move()}},move:{value:function(){this.clicked&&(this.position.x.update(this.mouse),this.position.y.update(this.mouse),this._x.updateNormal(this.position.x.value),this._y.updateNormal(this.position.y.value),this.emit("change",{x:this._x.value,y:this._y.value}),this.render())}},release:{value:function(){this.render()}},x:{get:function(){return this._x.value},set:function(t){this._x.update(t),this.emit("change",{x:this._x.value,y:this._y.value}),this.render()}},y:{get:function(){return this._y.value},set:function(t){this._y.update(t),this.emit("change",{x:this._x.value,y:this._y.value}),this.render()}},normalized:{get:function(){return{x:this._x.normalized,y:this._y.normalized}}},minX:{get:function(){return this._x.min},set:function(t){this._x.min=t,this.render()}},minY:{get:function(){return this._y.min},set:function(t){this._y.min=t,this.render()}},maxX:{get:function(){return this._x.max},set:function(t){this._x.max=t,this.render()}},maxY:{get:function(){return this._y.max},set:function(t){this._y.max=t,this.render()}},stepX:{get:function(){return this._x.step},set:function(t){this._x.step=t,this.render()}},stepY:{get:function(){return this._y.step},set:function(t){this._y.step=t,this.render()}},mode:{get:function(){return this.position.x.mode},set:function(t){this.position.x.mode=t,this.position.y.mode=t}}}),e}(h);t.exports=c},function(t,e,i){"use strict";var n=i(5);t.exports={create:function(t){return document.createElementNS("http://www.w3.org/2000/svg",t)},arc:function(t,e,i,s,r){var o=n.toCartesian(i,r),a=n.toCartesian(i,s),h=r-s<=180?"0":"1";return["M",o.x+t,o.y+e,"A",i,i,0,h,0,a.x+t,a.y+e].join(" ")},radialGradient:function(t,e){var i="gradient"+n.ri(1e11),s=[],r=document.createElementNS("http://www.w3.org/2000/svg","radialGradient");r.setAttribute("id",i),r.setAttribute("cx","50%"),r.setAttribute("cy","50%"),r.setAttribute("r","50%"),t.appendChild(r);for(var o=0;o<e;o++){var a=document.createElementNS("http://www.w3.org/2000/svg","stop");a.setAttribute("id","stop"+o),r.appendChild(a),s.push(a)}return{id:i,stops:s,element:r}}}},function(t,e){"use strict";e.clip=function(t,e,i){return Math.min(Math.max(t,e),i)},e.normalize=function(t,e,i){return(t-e)/(i-e)},e.scale=function(t,e,i,n,s){return e===i?n:(t-e)*(s-n)/(i-e)+n},e.toPolar=function(t,e){var i=Math.sqrt(t*t+e*e),n=Math.atan2(e,t);return n<0&&(n+=2*Math.PI),{radius:i,angle:n}},e.toCartesian=function(t,e){return{x:t*Math.cos(e),y:t*Math.sin(e)*-1}},e.prune=function(t,e){return parseFloat(t.toFixed(e))},e.invert=function(t){return e.scale(t,1,0,0,1)},e.mtof=function(t){return 440*Math.pow(2,(t-69)/12)},e.interp=function(t,e,i){return t*(i-e)+e},e.pick=function(){return arguments[~~(Math.random()*arguments.length)]},e.octave=function(t){return Math.pow(2,t)},e.ri=function(t,e){e||(e=t,t=0);var i=Math.min(t,e),n=Math.max(t,e);return Math.floor(Math.random()*(n-i)+i)},e.rf=function(t,e){e||(e=t,t=0);var i=Math.min(t,e),n=Math.max(t,e);return Math.random()*(n-i)+i},e.cycle=function(t,e,i){return t++,t>=i&&(t=e),t},e.average=function(t){for(var e=0,i=0;i<t.length;i++)e+=t[i];return e/t.length},e.distance=function(t,e,i,n){var s=t-i,r=e-n;return Math.sqrt(s*s+r*r)},e.gainToDB=function(t){return 20*Math.log10(t)},e.coin=function(){var t=void 0===arguments[0]?.5:arguments[0];return e.rf(0,1)<t?1:0}},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(4),h=i(7),l=i(8),u=i(9),c=i(10),f=i(1).colors,d=function(t){function e(t,i,n){o(this,e),s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this),this.type=this.constructor.name,this.settings=this.parseSettings(t,i,n),this.mouse={},this.wait=!1,this.colors={};var r=f();this.colors.accent=r.accent,this.colors.fill=r.fill,this.colors.light=r.light,this.colors.dark=r.dark,this.colors.mediumLight=r.mediumLight,this.colors.mediumDark=r.mediumDark}return r(e,t),n(e,{parseSettings:{value:function(t,e,i){e.unshift("target"),i.defaultSize=i.size.splice(0,2),i.size=!1;var n={target:document.body,colors:{},snapWithParent:!0,event:function(){},component:!1};for(var s in i)n[s]=i[s];for(var r=0;r<t.length;r++){var o=t[r];if(l.isObject(o))for(var s in o)n[s]=o[s];else if("function"==typeof o)n.event=o;else if(e.length>=1){var s=e.splice(0,1)[0];n[s]=o}}return this.parent=h.parseElement(n.target),this.parent&&this.parent instanceof HTMLElement&&!n.component&&(this.parent.hasAttribute("nexus-ui")||this.parent.setAttribute("nexus-ui","")),n.size&&Array.isArray(n.size)&&n.snapWithParent?(this.width=n.size[0],this.height=n.size[1],this.parent.style.width=this.width+"px",this.parent.style.height=this.height+"px"):n.snapWithParent&&!n.component?(this.width=parseFloat(window.getComputedStyle(this.parent,null).getPropertyValue("width").replace("px","")),this.height=parseFloat(window.getComputedStyle(this.parent,null).getPropertyValue("height").replace("px","")),5e3==this.width&&(this.width=n.defaultSize[0],this.parent.style.width=this.parent.width=this.width+"px"),5e3==this.height&&(this.height=n.defaultSize[1],this.parent.style.height=this.parent.height=this.height+"px")):(n.size=n.defaultSize,this.width=n.size[0],this.height=n.size[1]),n.event?this.event=this.on("change",n.event):this.event=!1,n}},init:{value:function(){this.buildFrame(),this.buildInterface(),this.sizeInterface(),this.attachListeners(),this.colorInterface(),this.finalTouches()}},buildFrame:{value:function(){this.element=a.create("svg"),this.element.setAttribute("width",this.width),this.element.setAttribute("height",this.height),this.parent.appendChild(this.element)}},buildInterface:{value:function(){}},sizeInterface:{value:function(){}},colorInterface:{value:function(){}},attachListeners:{value:function(){var t=this;this.interactionTarget=this.interactionTarget||this.element,u.exists&&(this.interactionTarget.addEventListener("touchstart",function(e){return t.preTouch(e)}),this.interactionTarget.addEventListener("touchmove",function(e){return t.preTouchMove(e)}),this.interactionTarget.addEventListener("touchend",function(e){return t.preTouchRelease(e)})),this.boundPreMove=function(e){return t.preMove(e)},this.boundPreRelease=function(e){return t.preRelease(e)},this.interactionTarget.addEventListener("mousedown",function(e){return t.preClick(e)})}},finalTouches:{value:function(){this.element.style.cursor="pointer"}},preClick:{value:function(t){this.element instanceof HTMLElement&&(this.width=window.getComputedStyle(this.element,null).getPropertyValue("width").replace("px","")),this.offset=h.findPosition(this.element),this.mouse=h.locateMouse(t,this.offset),this.clicked=!0,this.click(),this.moveEvent=document.addEventListener("mousemove",this.boundPreMove),this.releaseEvent=document.addEventListener("mouseup",this.boundPreRelease),this.emit("click"),t.preventDefault(),t.stopPropagation()}},preMove:{value:function(t){var e=this;this.wait||(this.mouse=h.locateMouse(t,this.offset),this.move(),this.wait=!0,setTimeout(function(){e.wait=!1},25)),t.preventDefault(),t.stopPropagation()}},preRelease:{value:function(t){this.mouse=h.locateMouse(t,this.offset),this.clicked=!1,this.release(),this.emit("release"),document.removeEventListener("mousemove",this.boundPreMove),document.removeEventListener("mouseup",this.boundPreRelease),t.preventDefault(),t.stopPropagation()}},click:{value:function(){}},move:{value:function(){}},release:{value:function(){}},preTouch:{value:function(t){this.element instanceof HTMLElement&&(this.width=window.getComputedStyle(this.element,null).getPropertyValue("width").replace("px","")),this.offset=h.findPosition(this.element),this.mouse=h.locateTouch(t,this.offset),this.clicked=!0,this.touch(t),this.emit("click"),t.preventDefault(),t.stopPropagation()}},preTouchMove:{value:function(t){this.clicked&&(this.mouse=h.locateTouch(t,this.offset),this.touchMove(),t.preventDefault(),t.stopPropagation())}},preTouchRelease:{value:function(t){this.mouse=h.locateTouch(t,this.offset),this.clicked=!1,this.touchRelease(),this.emit("release"),t.preventDefault(),t.stopPropagation()}},touch:{value:function(){this.click()}},touchMove:{value:function(){this.move()}},touchRelease:{value:function(){this.release()}},resize:{value:function(t,e){this.width=t,this.height=e,this.parent.style.width=this.width+"px",this.parent.style.height=this.height+"px",this.element.setAttribute("width",this.width),this.element.setAttribute("height",this.height),this.sizeInterface()}},empty:{value:function(){for(;this.element.lastChild;)this.element.removeChild(this.element.lastChild)}},destroy:{value:function(){this.empty(),this.parent.removeChild(this.element),this.removeAllListeners(),this.instrument&&delete this.instrument[this.id],this.customDestroy()}},customDestroy:{value:function(){}},colorize:{value:function(t,e){this.colors[t]=e,this.colorInterface()}}}),e}(c);t.exports=d},function(t,e){"use strict";e.findPosition=function(t){var e=t.getBoundingClientRect();return{top:e.top+window.scrollY,left:e.left+window.scrollX}},e.parseElement=function(t){return"string"==typeof t&&(t=document.getElementById(t.replace("#",""))),t instanceof HTMLElement||t instanceof SVGElement?t:"No valid parent argument"},e.locateMouse=function(t,e){return{x:t.pageX-e.left,y:t.pageY-e.top}},e.locateTouch=function(t,e){return{x:!!t.targetTouches.length&&t.targetTouches[0].pageX-e.left,y:!!t.targetTouches.length&&t.targetTouches[0].pageY-e.top}},e.SmartCanvas=function(t){var e=this;this.element=document.createElement("canvas"),this.context=this.element.getContext("2d"),t.appendChild(this.element),this.resize=function(t,i){e.element.width=2*t,e.element.height=2*i,e.element.style.width=t+"px",e.element.style.height=i+"px"}}},function(t,e){"use strict";e.isObject=function(t){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&t instanceof SVGElement==!1&&t instanceof HTMLElement==!1}},function(t,e){"use strict";e.exists="ontouchstart"in document.documentElement},function(t,e){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function s(t){return"number"==typeof t}function r(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=i,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(t){if(!s(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},i.prototype.emit=function(t){var e,i,s,a,h,l;if(this._events||(this._events={}),"error"===t&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}if(i=this._events[t],o(i))return!1;if(n(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),i.apply(this,a)}else if(r(i))for(a=Array.prototype.slice.call(arguments,1),l=i.slice(),s=l.length,h=0;h<s;h++)l[h].apply(this,a);return!0},i.prototype.addListener=function(t,e){var s;if(!n(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?r(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,r(this._events[t])&&!this._events[t].warned&&(s=o(this._maxListeners)?i.defaultMaxListeners:this._maxListeners)&&s>0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(t,e){function i(){this.removeListener(t,i),s||(s=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var s=!1;return i.listener=e,this.on(t,i),this},i.prototype.removeListener=function(t,e){var i,s,o,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(i=this._events[t],o=i.length,s=-1,i===e||n(i.listener)&&i.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(r(i)){for(a=o;a-- >0;)if(i[a]===e||i[a].listener&&i[a].listener===e){s=a;break}if(s<0)return this;1===i.length?(i.length=0,delete this._events[t]):i.splice(s,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},i.prototype.removeAllListeners=function(t){var e,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(i=this._events[t],n(i))this.removeListener(t,i);else if(i)for(;i.length;)this.removeListener(t,i[i.length-1]);return delete this._events[t],this},i.prototype.listeners=function(t){return this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},i.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},i.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=i(5),o=function(){function t(){var e=void 0===arguments[0]?0:arguments[0],i=void 0===arguments[1]?1:arguments[1],n=void 0===arguments[2]?0:arguments[2],r=void 0===arguments[3]?0:arguments[3];s(this,t),this.min=e,this.max=i,this.step=n,this.value=r,this.changed=!1,this.oldValue=!1,this.update(this.value)}return n(t,{update:{value:function(t){return this.step?this.value=r.clip(Math.round((t-this.min)/this.step)*this.step+this.min,this.min,this.max):this.value=r.clip(t,this.min,this.max),this.oldValue!==this.value?(this.oldValue=this.value,this.changed=!0):this.changed=!1,this.value}},updateNormal:{value:function(t){return this.value=r.scale(t,0,1,this.min,this.max),this.update(this.value)}},normalized:{get:function(){return r.normalize(this.value,this.min,this.max)}}}),t}();t.exports=o},function(t,e,i){"use strict";var n=function(t){return t&&t.__esModule?t.default:t},s=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(e,"__esModule",{value:!0});var o=n(i(5)),a=n(i(13));e.Handle=function(){function t(){var e=void 0===arguments[0]?"absolute":arguments[0],i=void 0===arguments[1]?"vertical":arguments[1],n=void 0===arguments[2]?[0,100]:arguments[2],s=void 0===arguments[3]?[0,100]:arguments[3];r(this,t),this.mode=e,this.direction=i,this.previous=0,this.value=0,this.sensitivity=1,this.resize(n,s)}return s(t,{resize:{value:function(t,e){this.boundary={min:{x:t[0],y:e[0]},max:{x:t[1],y:e[1]},center:{x:(t[1]-t[0])/2+t[0],y:(e[1]-e[0])/2+e[0]}}}},anchor:{set:function(t){this._anchor=this.convertPositionToValue(t)},get:function(){return this._anchor}},update:{value:function(t){if("relative"===this.mode){var e=this.convertPositionToValue(t)-this.anchor;Math.abs(e)>.5&&(e=0),this.anchor=t,this.value=this.value+e*this.sensitivity}else this.value=this.convertPositionToValue(t);this.value=o.clip(this.value,0,1)}},convertPositionToValue:{value:function(t){switch(this.direction){case"radial":var e=o.toPolar(t.x-this.boundary.center.x,t.y-this.boundary.center.y);return e=e.angle/(2*Math.PI),e=(e-.25+1)%1;case"vertical":return o.scale(t.y,this.boundary.min.y,this.boundary.max.y,0,1);case"horizontal":return o.scale(t.x,this.boundary.min.x,this.boundary.max.x,0,1)}}}}),t}(),e.Button=function(){function t(){var e=void 0===arguments[0]?"button":arguments[0];r(this,t),this.mode=e,this.state=new a,this.paintbrush=!1}return s(t,{click:{value:function(){switch(this.mode){case"impulse":this.state.on(),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.state.off.bind(this),30),this.emit("change",this.state);break;case"button":this.turnOn(),this.emit("change",this.state);break;case"aftertouch":this.position={x:o.clip(this.mouse.x/this.width,0,1),y:o.clip(1-this.mouse.y/this.height,0,1)},this.turnOn(),this.emit("change",{state:this.state,x:this.position.x,y:this.position.y});break;case"toggle":this.flip(),this.emit("change",this.state)}}},move:{value:function(){"aftertouch"===this.mode&&(this.position={x:o.clip(this.mouse.x/this.width,0,1),y:o.clip(1-this.mouse.y/this.height,0,1)},this.emit("change",{state:this.state,x:this.position.x,y:this.position.y}),this.render())}},release:{value:function(){switch(this.mode){case"button":this.turnOff(),this.emit("change",this.state);break;case"aftertouch":this.turnOff(),this.position={x:this.mouse.x/this.width,y:1-this.mouse.y/this.height},this.emit("change",{state:this.state,x:this.position.x,y:this.position.y})}}}}),t}()},function(t,e){"use strict";var i=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),n=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(e){n(this,t),this.state=e||!1}return i(t,{flip:{value:function(t){this.state=t||!1===t?t:!this.state}},on:{value:function(){this.state=!0}},off:{value:function(){this.state=!1}}}),t}();t.exports=s},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(4),h=i(6),l=i(11),u=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),c=function(t){function e(){o(this,e);var t=["min","max","value"],i={size:[120,20],mode:"relative",min:0,max:1,step:0,value:0};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.orientation="vertical",this._value=new l(this.settings.min,this.settings.max,this.settings.step,this.settings.value),this.position=new u.Handle(this.settings.mode,this.orientation,[0,this.width],[this.height,0]),this.position.value=this._value.normalized,this.init(),this.position.direction=this.orientation,this.emit("change",this.value)}return r(e,t),n(e,{buildInterface:{value:function(){this.bar=a.create("rect"),this.fillbar=a.create("rect"),this.knob=a.create("circle"),this.element.appendChild(this.bar),this.element.appendChild(this.fillbar),this.element.appendChild(this.knob)}},sizeInterface:{value:function(){this.width<this.height?this.orientation="vertical":this.orientation="horizontal",this.position&&this.position.resize([0,this.width],[this.height,0]);var t=void 0,e=void 0,i=void 0,n=void 0,s=void 0,r=void 0;this.knobData={level:0,r:0},"vertical"===this.orientation?(this.thickness=this.width/2,t=this.width/2,e=0,i=this.thickness,n=this.height,this.knobData.r=.8*this.thickness,this.knobData.level=n-this.knobData.r-this.normalized*(n-2*this.knobData.r),s="translate("+-1*this.thickness/2+",0)",r=i/2):(this.thickness=this.height/2,t=0,e=this.height/2,i=this.width,n=this.thickness,this.knobData.r=.8*this.thickness,this.knobData.level=this.normalized*(i-2*this.knobData.r)+this.knobData.r,s="translate(0,"+-1*this.thickness/2+")",r=n/2),this.bar.setAttribute("x",t),this.bar.setAttribute("y",e),this.bar.setAttribute("transform",s),this.bar.setAttribute("rx",r),this.bar.setAttribute("ry",r),this.bar.setAttribute("width",i),this.bar.setAttribute("height",n),"vertical"===this.orientation?(this.fillbar.setAttribute("x",t),this.fillbar.setAttribute("y",this.knobData.level),this.fillbar.setAttribute("width",i),this.fillbar.setAttribute("height",n-this.knobData.level)):(this.fillbar.setAttribute("x",0),this.fillbar.setAttribute("y",e),this.fillbar.setAttribute("width",this.knobData.level),this.fillbar.setAttribute("height",n)),this.fillbar.setAttribute("transform",s),this.fillbar.setAttribute("rx",r),this.fillbar.setAttribute("ry",r),"vertical"===this.orientation?(this.knob.setAttribute("cx",t),this.knob.setAttribute("cy",this.knobData.level)):(this.knob.setAttribute("cx",this.knobData.level),this.knob.setAttribute("cy",e)),this.knob.setAttribute("r",this.knobData.r)}},colorInterface:{value:function(){this.bar.setAttribute("fill",this.colors.fill),this.fillbar.setAttribute("fill",this.colors.accent),this.knob.setAttribute("fill",this.colors.accent)}},render:{value:function(){this.clicked||(this.knobData.r=.75*this.thickness),this.knob.setAttribute("r",this.knobData.r),"vertical"===this.orientation?(this.knobData.level=this.knobData.r+this._value.normalized*(this.height-2*this.knobData.r),this.knob.setAttribute("cy",this.height-this.knobData.level),this.fillbar.setAttribute("y",this.height-this.knobData.level),this.fillbar.setAttribute("height",this.knobData.level)):(this.knobData.level=this._value.normalized*(this.width-2*this.knobData.r)+this.knobData.r,this.knob.setAttribute("cx",this.knobData.level),this.fillbar.setAttribute("x",0),this.fillbar.setAttribute("width",this.knobData.level))}},click:{value:function(){this.knobData.r=.9*this.thickness,this.position.anchor=this.mouse,this.move()}},move:{value:function(){this.clicked&&(this.position.update(this.mouse),this._value.updateNormal(this.position.value),this.emit("change",this._value.value),this.render())}},release:{value:function(){this.render()}},normalized:{get:function(){return this._value.normalized}},value:{get:function(){return this._value.value},set:function(t){this._value.update(t),this.position.value=this._value.normalized,this.emit("change",this._value.value),this.render()}},min:{get:function(){return this._value.min},set:function(t){this._value.min=t}},max:{get:function(){return this._value.max},set:function(t){this._value.max=t}},step:{get:function(){return this._value.step},set:function(t){this._value.step=t}},mode:{get:function(){return this.position.mode},set:function(t){this.position.mode=t}}}),e}(h);t.exports=c},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(4),h=i(13),l=i(6),u=function(t){function e(){o(this,e);var t=["value"],i={size:[40,20],target:!1,state:!1};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this._state=new h(this.settings.state),this.init()}return r(e,t),n(e,{buildInterface:{value:function(){this.bar=a.create("rect"),this.knob=a.create("circle"),this.element.appendChild(this.bar),this.element.appendChild(this.knob)}},sizeInterface:{value:function(){this.height<this.width/2?this.knobSize=this.height/2:this.knobSize=this.width/4,this.bar.setAttribute("x",this.width/2-1.5*this.knobSize),this.bar.setAttribute("y",this.height/2-this.knobSize/2),this.bar.setAttribute("rx",this.knobSize/2),this.bar.setAttribute("ry",this.knobSize/2),this.bar.setAttribute("width",3*this.knobSize),this.bar.setAttribute("height",this.knobSize),this.knob.setAttribute("cx",this.width/2-this.knobSize),this.knob.setAttribute("cy",this.height/2),this.knob.setAttribute("r",this.knobSize)}},colorInterface:{value:function(){this.knob.setAttribute("fill",this.colors.accent),this.render()}},render:{value:function(){this.state?(this.knob.setAttribute("cx",this.width/2+this.knobSize),this.bar.setAttribute("fill",this.colors.accent)):(this.knob.setAttribute("cx",this.width/2-this.knobSize),this.bar.setAttribute("fill",this.colors.fill))}},click:{value:function(){this.flip(),this.render(),this.emit("change",this.state)}},state:{get:function(){return this._state.state},set:function(t){this._state.flip(t),this.emit("change",this.state),this.render()}},flip:{value:function(){this._state.flip(),this.render()}}}),e}(l);t.exports=u},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(4),h=i(17),l=function(t){function e(){o(this,e);var t=["mode"],i={size:[80,80],mode:"aftertouch",state:!1};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.mode=this.settings.mode,this.init(),this.render()}return r(e,t),n(e,{buildInterface:{value:function(){this.pad=a.create("circle"),this.element.appendChild(this.pad),this.interactionTarget=this.pad,this.defs=a.create("defs"),this.element.appendChild(this.defs),this.gradient=a.radialGradient(this.defs,2),this.gradient.stops[0].setAttribute("offset","30%"),this.gradient.stops[1].setAttribute("offset","100%")}},sizeInterface:{value:function(){this.pad.setAttribute("cx",this.width/2),this.pad.setAttribute("cy",this.height/2),this.pad.setAttribute("r",Math.min(this.width,this.height)/2-this.width/40),this.pad.setAttribute("stroke-width",this.width/20)}},colorInterface:{value:function(){this.gradient.stops[0].setAttribute("stop-color",this.colors.accent),this.gradient.stops[1].setAttribute("stop-color",this.colors.fill),this.render()}},render:{value:function(){this.state?("aftertouch"===this.mode?(this.pad.setAttribute("stroke","url(#"+this.gradient.id+")"),this.gradient.element.setAttribute("cx",100*this.position.x+"%"),this.gradient.element.setAttribute("cy",100*(1-this.position.y)+"%")):this.pad.setAttribute("stroke",this.colors.accent),this.pad.setAttribute("fill",this.colors.accent)):(this.pad.setAttribute("fill",this.colors.fill),this.pad.setAttribute("stroke",this.colors.mediumLight))}}}),e}(h);t.exports=l},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(4),h=i(5),l=i(13),u=i(6),c=function(t){function e(t,i,n){o(this,e),s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t,i,n),this.mode=this.settings.mode||"button",this.position={x:0,y:0},this._state=new l(this.settings.state)}return r(e,t),n(e,{buildInterface:{value:function(){this.pad=a.create("circle"),this.pad.setAttribute("fill","#d18"),this.pad.setAttribute("stroke","#d18"),this.pad.setAttribute("stroke-width",4),this.element.appendChild(this.pad),this.interactionTarget=this.pad,this.sizeInterface()}},sizeInterface:{value:function(){this.pad.setAttribute("cx",this.width/2),this.pad.setAttribute("cy",this.height/2),this.pad.setAttribute("r",Math.min(this.width,this.height)/2-2)}},render:{value:function(){this.state?(this.pad.setAttribute("fill",this.colors.accent),this.pad.setAttribute("stroke",this.colors.accent)):(this.pad.setAttribute("fill",this.colors.fill),this.pad.setAttribute("stroke",this.colors.mediumLight))}},down:{value:function(t){switch(this.mode){case"impulse":this.turnOn(),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.turnOff.bind(this),30);break;case"button":this.turnOn();break;case"aftertouch":this.position={x:h.clip(this.mouse.x/this.width,0,1),y:h.clip(1-this.mouse.y/this.height,0,1)},this.turnOn();break;case"toggle":this.flip(t)}}},bend:{value:function(t){"aftertouch"===this.mode&&(this.mouse=t||this.mouse,this.position={x:h.clip(this.mouse.x/this.width,0,1),y:h.clip(1-this.mouse.y/this.height,0,1)},this.emit("change",{state:this.state,x:this.position.x,y:this.position.y}),this.render())}},up:{value:function(){switch(this.mode){case"button":this.turnOff();break;case"aftertouch":this.turnOff(),this.position={x:h.clip(this.mouse.x/this.width,0,1),y:h.clip(1-this.mouse.y/this.height,0,1)}}}},click:{value:function(){this.down()}},move:{value:function(){this.bend()}},release:{value:function(){this.up()}},state:{get:function(){return this._state.state},set:function(t){this._state.flip(t),"aftertouch"===this.mode?this.emit("change",{state:this.state,x:this.position.x,y:this.position.y}):this.emit("change",this.state),this.render()}},flip:{value:function(t){this._state.flip(t),"aftertouch"===this.mode?this.emit("change",{state:this.state,x:this.position.x,y:this.position.y}):this.emit("change",this.state),this.render()}},turnOn:{value:function(t){this._state.on(),!1!==t&&("aftertouch"===this.mode?this.emit("change",{state:this.state,x:this.position.x,y:this.position.y}):this.emit("change",this.state)),this.render()}},turnOff:{value:function(t){this._state.off(),!1!==t&&("aftertouch"===this.mode?this.emit("change",{state:this.state,x:this.position.x,y:this.position.y}):this.emit("change",this.state)),this.render()}}}),e}(u);t.exports=c},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(17),h=function(t){function e(){o(this,e);var t=["value"],i={size:[150,50],state:!1,text:"Play"};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this._text=this.settings.text,this.settings.alternate&&(this.settings.alternateText=this.settings.alternate,console.warn("'alternate' initiator is deprecated. Use 'alternateText' instead.")),this._alternateText=this.settings.alternateText,this.mode=this.settings.alternateText?"toggle":"button",this.init(),this.render(),this.state=this.settings.state}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement("div"),this.parent.appendChild(this.element),this.textElement=document.createElement("div"),this.textElement.innerHTML=this._text,this.element.appendChild(this.textElement)}},buildInterface:{value:function(){}},colorInterface:{value:function(){this.element.style.color=this.colors.dark,this.render()}},sizeInterface:{value:function(){var t=this.height/3,e=this.width/(this._text.length+2);if(t=Math.min(t,e),this.alternateText){var i=this.width/(this.alternateText.length+2);t=Math.min(t,i)}var n="width: "+this.width+"px;";n+="height: "+this.height+"px;",n+="padding: "+(this.height-t)/2+"px 0px;",n+="box-sizing: border-box;",n+="text-align: center;",n+="font-family: inherit;",n+="font-weight: 700;",n+="opacity: 1;",n+="font-size:"+t+"px;",this.textElement.style.cssText=n,this.render()}},render:{value:function(){this.state?(this.element.style.backgroundColor=this.colors.accent,this.textElement.style.color=this.colors.fill,this.alternateText?this.textElement.innerHTML=this._alternateText:this.textElement.innerHTML=this._text):(this.element.style.backgroundColor=this.colors.fill,this.textElement.style.color=this.colors.dark,this.textElement.innerHTML=this._text)}},alternateText:{get:function(){return this._alternateText},set:function(t){this.mode=t?"toggle":"button",this._alternateText=t,this.render()}},text:{get:function(){return this._text},set:function(t){this._text=t,this.sizeInterface(),this.render()}}}),e}(a);t.exports=h},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(6),h=i(16),l=function(t){function e(){o(this,e);var t=["value"],i={size:[120,25],numberOfButtons:4,active:-1};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.buttons=[],this._numberOfButtons=this.settings.numberOfButtons,this.active=this.settings.active,this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement("div"),this.parent.appendChild(this.element)}},buildInterface:{value:function(){for(var t=0;t<this._numberOfButtons;t++){var e=document.createElement("span"),i=new h(e,{mode:"toggle",component:!0},this.update.bind(this,t));this.buttons.push(i),this.element.appendChild(e)}}},sizeInterface:{value:function(){for(var t=this.width/this._numberOfButtons,e=this.height,i=0;i<this._numberOfButtons;i++)this.buttons[i].resize(t,e)}},colorInterface:{value:function(){for(var t=0;t<this._numberOfButtons;t++)this.buttons[t].colors=this.colors,this.buttons[t].render()}},update:{value:function(t){this.buttons[t].state?this.select(t):this.deselect()}},render:{value:function(){for(var t=0;t<this.buttons.length;t++)t===this.active?this.buttons[t].turnOn(!1):this.buttons[t].turnOff(!1)}},select:{value:function(t){t>=0&&t<this.buttons.length&&(this.active=t,this.emit("change",this.active),this.render())}},deselect:{value:function(){this.active=-1,this.emit("change",this.active),this.render()}},numberOfButtons:{get:function(){return this._numberOfButtons},set:function(t){this._numberOfButtons=t;for(var e=0;e<this.buttons.length;e++)this.buttons[e].destroy();this.buttons=[],this.empty(),this.buildInterface()}}}),e}(a);t.exports=l},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(6),h=i(11),l=i(5),u=function(t){function e(){o(this,e);var t=["value"],i={size:[60,30],value:0,min:0,max:2e4,step:1};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this._value=new h(this.settings.min,this.settings.max,this.settings.step,this.settings.value),this.decimalPlaces=2,this.actual=0,this.max=this._value.max,this.min=this._value.min,this.step=this._value.step,this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement("input"),this.element.type="text",this.element.addEventListener("blur",function(){this.element.style.backgroundColor=this.colors.fill,this.element.style.color=this.colors.dark,this.element.value!==this.value&&(this.value=parseFloat(this.element.value),this.render())}.bind(this)),this.element.addEventListener("keydown",function(t){(t.which<48||t.which>57)&&189!==t.which&&190!==t.which&&8!==t.which&&t.preventDefault(),13===t.which&&(this.element.blur(),this.value=this.element.value,this.emit("change",this.value),this.render())}.bind(this)),this.parent.appendChild(this.element)}},sizeInterface:{value:function(){this._minDimension=Math.min(this.width,this.height);var t="width: "+this.width+"px;";t+="height: "+this.height+"px;",t+="background-color: #e7e7e7;",t+="color: #333;",t+="font-family: arial;",t+="font-weight: 500;",t+="font-size:"+this._minDimension/2+"px;",t+="border: none;",t+="outline: none;",t+="padding: "+this._minDimension/4+"px "+this._minDimension/4+"px;",t+="box-sizing: border-box;",t+="userSelect: text;",t+="mozUserSelect: text;",t+="webkitUserSelect: text;",this.element.style.cssText+=t,this.element.value=this.value}},colorInterface:{value:function(){this.element.style.backgroundColor=this.colors.fill,this.element.style.color=this.colors.dark}},render:{value:function(){this.element.value=l.prune(this.value,this.decimalPlaces)}},click:{value:function(){this.hasMoved=!1,this.element.readOnly=!0,this.actual=this.value,this.initial={y:this.mouse.y},this.changeFactor=l.invert(this.mouse.x/this.width),console.log(this.changeFactor)}},move:{value:function(){if(this.hasMoved=!0,this.clicked){var t=this.actual-(this.mouse.y-this.initial.y)*(l.clip(this.max-this.min,0,1e3)/200)*Math.pow(this.changeFactor,2);this.value=t,this.render(),this._value.changed&&this.emit("change",this.value)}}},release:{value:function(){this.hasMoved?document.body.focus():(this.element.readOnly=!1,this.element.focus(),this.element.setSelectionRange(0,this.element.value.length),this.element.style.backgroundColor=this.colors.accent,this.element.style.color=this.colors.light)}},link:{value:function(t){var e=this;this.min=t.min,this.max=t.max,this.step=t.step,t.on("change",function(t){e.passiveUpdate(t)}),this.on("change",function(e){t.value=e}),this.value=t.value}},passiveUpdate:{value:function(t){this._value.update(t),this.render()}},value:{get:function(){return this._value.value},set:function(t){this._value.update(t),this.emit("change",this.value),this.render()}},min:{get:function(){return this._value.min},set:function(t){this._value.min=t}},max:{get:function(){return this._value.max},set:function(t){this._value.max=t}},step:{get:function(){return this._value.step},set:function(t){this._value.step=t}}}),e}(a);t.exports=u},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(6),h=function(t){function e(){o(this,e);var t=["value"],i={size:[100,30],options:["default","options"]};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this._selectedIndex=-1,this._value=!1,this._options=this.settings.options,this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement("select"),this.element.style.fontSize=this.height/2+"px",this.element.style.outline="none",this.element.style.highlight="none",this.element.style.width=this.width+"px",this.element.style.height=this.height+"px",this.boundRender=this.render.bind(this),this.element.addEventListener("change",this.boundRender),this.parent.appendChild(this.element)}},attachListeners:{value:function(){}},buildInterface:{value:function(){this.defineOptions()}},colorInterface:{value:function(){this.element.style.backgroundColor=this.colors.fill,this.element.style.color=this.colors.dark,this.element.style.border="solid 0px "+this.colors.mediumLight}},render:{value:function(){this._value=this.element.options[this.element.selectedIndex].text,this._selectedIndex=this.element.selectedIndex,this.emit("change",{value:this._value,index:this._selectedIndex})}},click:{value:function(){}},move:{value:function(){}},release:{value:function(){}},defineOptions:{value:function(t){t&&(this._options=t);for(var e=this.element.options.length-1;e>=0;e--)this.element.remove(e);for(var e=0;e<this._options.length;e++)this.element.options.add(new Option(this._options[e],e))}},value:{get:function(){return this._value},set:function(t){this._value=t;for(var e=0;e<this.element.options.length;e++)if(t===this.element.options[e].text){this.selectedIndex=e;break}}},selectedIndex:{get:function(){return this._selectedIndex},set:function(t){this._selectedIndex=t,this.element.selectedIndex=t,this.render()}},customDestroy:{value:function(){this.element.removeEventListener("change",this.boundRender)}}}),e}(a);t.exports=h},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(4),h=i(5),l=i(6),u=i(11),c=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),f=function(t){function e(){o(this,e);var t=["min","max","value"],i={size:[75,75],interaction:"radial",mode:"relative",min:0,max:1,step:0,value:0};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.interaction=this.settings.interaction,this._value=new u(this.settings.min,this.settings.max,this.settings.step,this.settings.value),this.position=new c.Handle(this.settings.mode,this.interaction,[0,this.width],[this.height,0]),this.init(),this.value=this._value.value,this.position.value=this._value.normalized,this.previousAngle=!1,this.emit("change",this.value)}return r(e,t),n(e,{buildInterface:{value:function(){this.background=a.create("circle"),this.screw=a.create("circle"),this.handle=a.create("path"),this.handle2=a.create("path"),this.handleFill=a.create("path"),this.handle2Fill=a.create("path"),this.handleLine=a.create("path"),this.element.appendChild(this.background),this.element.appendChild(this.handle),this.element.appendChild(this.handle2),this.element.appendChild(this.handleFill),this.element.appendChild(this.handle2Fill),this.element.appendChild(this.handleLine),this.element.appendChild(this.screw)}},sizeInterface:{value:function(){this.position.resize([0,this.width],[this.height,0]);var t={x:this.width/2,y:this.height/2},e=Math.min(this.width,this.height);this.background.setAttribute("cx",t.x),this.background.setAttribute("cy",t.y),this.background.setAttribute("r",e/2-e/40),this.screw.setAttribute("cx",t.x),this.screw.setAttribute("cy",t.y),this.screw.setAttribute("r",e/12);var i=this.value,n={start:1.5*Math.PI,end:h.clip(h.scale(i,0,.5,1.5*Math.PI,.5*Math.PI),.5*Math.PI,1.5*Math.PI)},s={start:2.5*Math.PI,end:h.clip(h.scale(i,.5,1,2.5*Math.PI,1.5*Math.PI),1.5*Math.PI,2.5*Math.PI)},r=a.arc(t.x,t.y,e/2-e/40,n.start,n.end),o=a.arc(t.x,t.y,e/2-e/40,s.start,s.end);this.handle.setAttribute("d",r),this.handle.setAttribute("stroke-width",e/20),this.handle.setAttribute("fill","none"),this.handle2.setAttribute("d",o),this.handle2.setAttribute("stroke-width",e/20),this.handle2.setAttribute("fill","none"),r+=" L "+t.x+" "+t.y,this.handleFill.setAttribute("d",r),this.handleFill.setAttribute("fill-opacity","0.3"),o+=" L "+t.x+" "+t.y,this.handle2Fill.setAttribute("d",o),this.handle2Fill.setAttribute("fill-opacity","0.3");var l=void 0;l=i<.5?n.end:s.end;var u=t.x+Math.cos(l)*(e/2),c=t.y+Math.sin(l)*(e/2)*-1;this.handleLine.setAttribute("d","M "+t.x+" "+t.y+" L "+u+" "+c),this.handleLine.setAttribute("stroke-width",e/20)}},colorInterface:{value:function(){this.background.setAttribute("fill",this.colors.fill),this.screw.setAttribute("fill",this.colors.accent),this.handle.setAttribute("stroke",this.colors.accent),this.handle2.setAttribute("stroke",this.colors.accent),this.handleFill.setAttribute("fill",this.colors.accent),this.handle2Fill.setAttribute("fill",this.colors.accent),this.handleLine.setAttribute("stroke",this.colors.accent)}},render:{value:function(){var t=this._value.normalized,e={x:this.width/2,y:this.height/2},i=Math.min(this.width,this.height),n={start:1.5*Math.PI,end:h.clip(h.scale(t,0,.5,1.5*Math.PI,.5*Math.PI),.5*Math.PI,1.5*Math.PI)},s={start:2.5*Math.PI,end:h.clip(h.scale(t,.5,1,2.5*Math.PI,1.5*Math.PI),1.5*Math.PI,2.5*Math.PI)},r=a.arc(e.x,e.y,i/2-i/40,n.start,n.end),o=a.arc(e.x,e.y,i/2-i/40,s.start,s.end);this.handle.setAttribute("d",r),this.handle2.setAttribute("d",o),r+=" L "+e.x+" "+e.y,this.handleFill.setAttribute("d",r),o+=" L "+e.x+" "+e.y,this.handle2Fill.setAttribute("d",o);var l=void 0;l=t<=.5?n.end:s.end;var u=e.x+Math.cos(l)*(i/2),c=e.y+Math.sin(l)*(i/2)*-1;this.handleLine.setAttribute("d","M "+e.x+" "+e.y+" L "+u+" "+c)}},click:{value:function(){"relative"===this.mode&&(this.previousAngle=!1),this.position.anchor=this.mouse,this.position.value=this._value.normalized,this.move()}},move:{value:function(){if(this.clicked){this.position.update(this.mouse);var t=this.position.value*Math.PI*2;t<0&&(t+=2*Math.PI),"relative"===this.mode&&!1!==this.previousAngle&&Math.abs(this.previousAngle-t)>2&&(t=this.previousAngle>3?2*Math.PI:0),this.previousAngle=t;var e=t/(2*Math.PI);this.value=this._value.updateNormal(e),"relative"===this.mode&&(this.position.value=e),this.emit("change",this._value.value),this.render()}}},release:{value:function(){}},value:{get:function(){return this._value.value},set:function(t){this._value.update(t),this.position.value=this._value.normalized,this.emit("change",this._value.value),this.render()}},min:{get:function(){return this._value.min},set:function(t){this._value.min=t}},max:{get:function(){return this._value.max},set:function(t){this._value.max=t}},step:{get:function(){return this._value.step},set:function(t){this._value.step=t}},mode:{get:function(){return this.position.mode},set:function(t){this.position.mode=t}},normalized:{get:function(){return this._value.normalized},set:function(t){this._value.updateNormal(t),this.emit("change",this.value)}}}),e}(l);t.exports=f},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(4),h=i(6),l=i(17),u=i(9),c=function(t){function e(){o(this,e);var t=["value","note","color"],i={size:[80,80],target:!1,mode:"button",value:0};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.note=this.settings.note,this.color=this.settings.color,this.colors={w:"#fff",b:"#666"},this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=a.create("svg"),this.element.setAttribute("width",this.width),this.element.setAttribute("height",this.height),this.parent.appendChild(this.element)}},buildInterface:{value:function(){var t=this;this.pad=a.create("rect"),this.element.appendChild(this.pad),this.interactionTarget=this.pad,u.exists||(this.click=function(){t.piano.interacting=!0,t.piano.paintbrush=!t.state,t.down(t.piano.paintbrush)},this.pad.addEventListener("mouseover",function(){t.piano.interacting&&t.down(t.piano.paintbrush)}),this.move=function(){t.piano.interacting&&t.bend()},this.release=function(){t.piano.interacting=!1},this.pad.addEventListener("mouseup",function(){t.piano.interacting&&t.up()}),this.pad.addEventListener("mouseout",function(){t.piano.interacting&&t.up()}))}},sizeInterface:{value:function(){this.pad.setAttribute("x",.5),this.pad.setAttribute("y",.5),this.width>2?this.pad.setAttribute("width",this.width-1):this.pad.setAttribute("width",this.width),this.height,this.pad.setAttribute("height",this.height),this.pad.setAttribute("rx",0),this.pad.setAttribute("ry",0)}},render:{value:function(){this.state?this.pad.setAttribute("fill",this.colors.accent):this.pad.setAttribute("fill",this.colors[this.color])}}}),e}(l),f=function(t){function e(){o(this,e);var t=["value"],i={size:[500,125],lowNote:24,highNote:60,mode:"button"};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.keyPattern=["w","b","w","b","w","w","b","w","b","w","b","w"],this.paintbrush=!1,this.mode=this.settings.mode,this.range={low:this.settings.lowNote,high:this.settings.highNote},this.range.size=this.range.high-this.range.low,this.keys=[],this.toggleTo=!1,this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement("div"),this.element.style.position="relative",this.element.style.borderRadius="0px",this.element.style.display="block",this.element.style.width="100%",this.element.style.height="100%",this.parent.appendChild(this.element)}},buildInterface:{value:function(){this.keys=[];for(var t=0;t<this.range.high-this.range.low;t++){var e=document.createElement("span"),i=(t+this.range.low)%this.keyPattern.length,n=new c(e,{component:!0,note:t+this.range.low,color:this.keyPattern[i],mode:this.mode},this.keyChange.bind(this,t+this.range.low));n.piano=this,u.exists&&(n.pad.index=t,n.preClick=n.preMove=n.preRelease=function(){},n.click=n.move=n.release=function(){},n.preTouch=n.preTouchMove=n.preTouchRelease=function(){},n.touch=n.touchMove=n.touchRelease=function(){}),this.keys.push(n),this.element.appendChild(e)}u.exists&&this.addTouchListeners()}},sizeInterface:{value:function(){for(var t=0,e=[],i=0;i<this.range.high-this.range.low;i++){e.push(t);var n=(i+this.range.low)%this.keyPattern.length,s=(i+1+this.range.low)%this.keyPattern.length;i+1+this.range.low>=this.range.high?t+=1:"w"===this.keyPattern[n]&&"w"===this.keyPattern[s]?t+=1:t+=.5}for(var r=t,o=(this.width-2)/r,a=(this.height-2)/2,i=0;i<this.keys.length;i++){var h=this.keys[i].parent;h.style.position="absolute",h.style.left=e[i]*o+1+"px","w"===this.keys[i].color?(h.style.top="1px",this.keys[i].resize(o,2*a)):(h.style.zIndex=1,h.style.top="1px",this.keys[i].resize(o,1.1*a))}}},colorInterface:{value:function(){this.element.style.backgroundColor=this.colors.mediumLight;for(var t=0;t<this.keys.length;t++)this.keys[t].colors={w:this.colors.light,b:this.colors.dark,accent:this.colors.accent,border:this.colors.mediumLight},this.keys[t].colorInterface(),this.keys[t].render()}},keyChange:{value:function(t,e){var i={note:t};i.state="object"==typeof e?e.state:e,this.emit("change",i)}},render:{value:function(){}},addTouchListeners:{value:function(){var t=this;this.preClick=this.preMove=this.preRelease=function(){},this.click=this.move=this.release=function(){},this.preTouch=this.preTouchMove=this.preTouchRelease=function(){},this.touch=this.touchMove=this.touchRelease=function(){},this.currentElement=!1,this.element.addEventListener("touchstart",function(e){console.log("touchstart");var i=document.elementFromPoint(e.targetTouches[0].clientX,e.targetTouches[0].clientY),n=t.keys[i.index];t.paintbrush=!n.state,n.down(t.paintbrush),t.currentElement=i.index,e.preventDefault(),e.stopPropagation()}),this.element.addEventListener("touchmove",function(e){var i=document.elementFromPoint(e.targetTouches[0].clientX,e.targetTouches[0].clientY),n=t.keys[i.index];if(i.index!==t.currentElement){if(t.currentElement){t.keys[t.currentElement].up()}n.down(t.paintbrush)}else n.bend();t.currentElement=i.index,e.preventDefault(),e.stopPropagation()}),this.element.addEventListener("touchend",function(e){t.keys[t.currentElement].up(),t.interacting=!1,t.currentElement=!1,e.preventDefault(),e.stopPropagation()})}},setRange:{value:function(t,e){this.range.low=t,this.range.high=e,this.empty(),this.buildInterface()}},toggleKey:{value:function(t,e){this.keys[t-this.range.low].flip(e)}},toggleIndex:{value:function(t,e){this.keys[t].flip(e)}}}),e}(h);t.exports=f},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(4),h=i(7),l=i(6),u=i(17),c=i(25),f=i(28),d=i(9),v=function(t){function e(){o(this,e);var t=["value"],i={size:[80,80],target:!1,mode:"toggle",value:0};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.index=this.settings.index,this.row=this.settings.row,this.column=this.settings.column,this.matrix=this.settings.matrix,this.interacting=!1,this.paintbrush=!1,this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=a.create("svg"),this.element.setAttribute("width",this.width),this.element.setAttribute("height",this.height),this.element.style.top="0px",this.element.style.left="0px",this.element.style.position="absolute",this.parent.appendChild(this.element)}},buildInterface:{value:function(){var t=this;this.pad=a.create("rect"),this.element.appendChild(this.pad),this.interactionTarget=this.pad,d.exists||(this.click=function(){t.matrix.interacting=!0,t.matrix.paintbrush=!t.state,t.down(t.matrix.paintbrush)},this.pad.addEventListener("mouseover",function(){t.matrix.interacting&&t.down(t.matrix.paintbrush)}),this.move=function(){},this.pad.addEventListener("mousemove",function(e){t.matrix.interacting&&(t.offset||(t.offset=h.findPosition(t.element)),t.mouse=h.locateMouse(e,t.offset),t.bend())}),this.release=function(){t.matrix.interacting=!1},this.pad.addEventListener("mouseup",function(){t.matrix.interacting&&t.up()}),this.pad.addEventListener("mouseout",function(){t.matrix.interacting&&t.up()}))}},sizeInterface:{value:function(){this.pad.setAttribute("x",1),this.pad.setAttribute("y",1),this.width>2?this.pad.setAttribute("width",this.width-2):this.pad.setAttribute("width",this.width),this.height>2?this.pad.setAttribute("height",this.height-2):this.pad.setAttribute("height",this.height),this.pad.setAttribute("fill",this.matrix.colors.fill)}},render:{value:function(){this.state?this.pad.setAttribute("fill",this.matrix.colors.accent):this.pad.setAttribute("fill",this.matrix.colors.fill)}}}),e}(u),p=function(t){function e(){o(this,e);var t=["value"],i={size:[400,200],mode:"toggle",rows:5,columns:10};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.active=-1,this.mode=this.settings.mode,this.interval=new Nexus.Interval(200,function(){},!1),this.matrix=new c(this.settings.rows,this.settings.columns),this.matrix.ui=this,this.stepper=new f(0,this.columns),this.init()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement("div"),this.element.style.position="relative",this.element.style.display="block",this.element.style.width="100%",this.element.style.height="100%",this.parent.appendChild(this.element),d.exists&&this.addTouchListeners()}},buildInterface:{value:function(){this.cells=[];for(var t=0;t<this.matrix.length;t++){var e=this.matrix.locate(t),i=document.createElement("span");i.style.position="absolute";var n=new v(i,{component:!0,index:t,row:e.row,column:e.column,mode:this.mode,matrix:this},this.keyChange.bind(this,t));d.exists&&(n.pad.index=t,n.preClick=n.preMove=n.preRelease=function(){},n.click=n.move=n.release=function(){},n.preTouch=n.preTouchMove=n.preTouchRelease=function(){},n.touch=n.touchMove=n.touchRelease=function(){}),this.cells.push(n),this.element.appendChild(i)}this.sizeInterface()}},sizeInterface:{value:function(){for(var t=this.width/this.columns,e=this.height/this.rows,i=0;i<this.cells.length;i++){var n=this.cells[i].parent;n.style.left=this.cells[i].column*t+"px",n.style.top=this.cells[i].row*e+"px",this.cells[i].resize(t,e)}}},colorInterface:{value:function(){for(var t=0;t<this.cells.length;t++)this.cells[t].render()}},update:{value:function(){var t=this;this.matrix.iterate(function(e,i,n){t.matrix.pattern[e][i]!==t.cells[n].state&&(t.matrix.pattern[e][i]>0?t.cells[n].turnOn():t.cells[n].turnOff())})}},keyChange:{value:function(t,e){var i=this.matrix.locate(t);this.matrix.pattern[i.row][i.column]=e;var n={row:i.row,column:i.column,state:e};this.emit("change",n)}},render:{value:function(){var t=this;this.stepper.value>=0&&this.matrix.iterate(function(e,i,n){i===t.stepper.value?(t.cells[n].pad.setAttribute("stroke",t.colors.mediumLight),t.cells[n].pad.setAttribute("stroke-width","1"),t.cells[n].pad.setAttribute("stroke-opacity","1")):t.cells[n].pad.setAttribute("stroke","none")})}},start:{value:function(t){this.interval.event=this.next.bind(this),t&&this.interval.ms(t),this.interval.start()}},stop:{value:function(){this.interval.stop()}},next:{value:function(){this.stepper.next(),this.emit("step",this.matrix.column(this.stepper.value).reverse()),this.render()}},addTouchListeners:{value:function(){var t=this;this.preClick=this.preMove=this.preRelease=function(){},this.click=this.move=this.release=function(){},this.preTouch=this.preTouchMove=this.preTouchRelease=function(){},this.touch=this.touchMove=this.touchRelease=function(){},this.currentElement=!1,this.element.addEventListener("touchstart",function(e){var i=document.elementFromPoint(e.targetTouches[0].clientX,e.targetTouches[0].clientY),n=t.cells[i.index];t.paintbrush=!n.state,n.down(t.paintbrush),t.currentElement=i.index,e.preventDefault(),e.stopPropagation()}),this.element.addEventListener("touchmove",function(e){var i=document.elementFromPoint(e.targetTouches[0].clientX,e.targetTouches[0].clientY),n=t.cells[i.index];if(i.index!==t.currentElement){if(t.currentElement>=0){t.cells[t.currentElement].up()}n.down(t.paintbrush)}else n.bend();t.currentElement=i.index,e.preventDefault(),e.stopPropagation()}),this.element.addEventListener("touchend",function(e){t.cells[t.currentElement].up(),t.interacting=!1,t.currentElement=!1,e.preventDefault(),e.stopPropagation()})}},rows:{get:function(){return this.matrix.rows},set:function(t){this.matrix.rows=t,this.empty(),this.buildInterface(),this.update()}},columns:{get:function(){return this.matrix.columns},set:function(t){this.matrix.columns=t,this.stepper.max=t,this.empty(),this.buildInterface(),this.update()}}}),e}(l);t.exports=p},function(t,e,i){"use strict";var n=function(t){return t&&t.__esModule?t.default:t},s=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=n(i(5)),a=n(i(26)),h=function(){function t(e,i){var n=this;r(this,t),this.pattern=[],this.create(e,i),this.toggle={cell:function(t,e){return n.pattern[e][t]=!n.pattern[e][t],n.ui&&n.ui.update(),n.pattern[e][t]},all:function(){n.iterate(function(t,e){n.toggle.cell(e,t)}),n.ui&&n.ui.update()},row:function(t){for(var e=0;e<n.columns;e++)n.toggle.cell(e,t);n.ui&&n.ui.update()},column:function(t){for(var e=0;e<n.rows;e++)n.toggle.cell(t,e);n.ui&&n.ui.update()}},this.set={cell:function(t,e,i){n.pattern[e][t]=i,n.ui&&n.ui.update()},all:function(t){n.pattern=t,n.ui&&n.ui.update()},row:function(t,e){n.pattern[t]=e,n.ui&&n.ui.update()},column:function(t,e){n.pattern.forEach(function(i,s){n.pattern[s][t]=e[s]}),n.ui&&n.ui.update()}},this.rotate={all:function(t){t||0===t||(t=1),(t%=n.pattern[0].length)<0&&(t=n.pattern[0].length+t);for(var e=0;e<n.rows;e++){var i=n.pattern[e].splice(n.pattern[e].length-t,t);n.pattern[e]=i.concat(n.pattern[e])}n.ui&&n.ui.update()},row:function(t,e){e||0===e||(e=1),(e%=n.pattern[0].length)<0&&(e=n.pattern[0].length+e);var i=n.pattern[t].splice(n.pattern[t].length-e,e);n.pattern[t]=i.concat(n.pattern[t]),n.ui&&n.ui.update()},column:function(t,e){e||0===e||(e=1),(e%=n.pattern.length)<0&&(e=n.pattern.length+e);var i=[];n.pattern.forEach(function(e){i.push(e[t])});var s=i.splice(i.length-e,e);i=s.concat(i),n.pattern.forEach(function(e,n){e[t]=i[n]}),n.ui&&n.ui.update()}},this.populate={all:function(t){var e=new a(t);n.iterate(function(t,i){n.pattern[t][i]=o.coin(e.next())}),n.ui&&n.ui.update()},row:function(){var t=void 0===arguments[0]?0:arguments[0],e=void 0===arguments[1]?1:arguments[1],i=new a(e);n.pattern[t].forEach(function(e,s){n.pattern[t][s]=o.coin(i.next())}),n.ui&&n.ui.update()},column:function(){var t=void 0===arguments[0]?0:arguments[0],e=void 0===arguments[1]?1:arguments[1],i=new a(e);n.pattern.forEach(function(e,s){n.pattern[s][t]=o.coin(i.next())}),n.ui&&n.ui.update()}},this.erase={all:function(){n.set.all(0)},row:function(t){n.set.row(t,0)},column:function(t){n.set.column(t,0)}}}return s(t,{create:{value:function(t,e){var i=this;this.pattern=[];for(var n=0;n<t;n++){var s=new Array(e);this.pattern.push(s)}this.iterate(function(t,e){i.pattern[t][e]=!1})}},iterate:{value:function(t,e){for(var i=0,n=0;n<this.rows;n++){e&&e(n);for(var s=0;s<this.columns;s++)t(n,s,i),i++}}},formatAsText:{value:function(){var t=this,e="";return this.iterate(function(i,n){e+=(t.pattern[i][n]?1:0)+" "},function(){e+="\n"}),e}},log:{value:function(){console.log(this.formatAsText())}},update:{value:function(t){this.pattern=t||this.pattern}},length:{get:function(){return this.rows*this.columns}},locate:{value:function(t){return{row:~~(t/this.columns),column:t%this.columns}}},indexOf:{value:function(t,e){return e+t*this.columns}},row:{value:function(t){var e=function(e){return t.apply(this,arguments)};return e.toString=function(){return t.toString()},e}(function(t){for(var e=[],i=0;i<this.columns;i++)e.push(this.pattern[t]?1:0);return e})},column:{value:function(t){var e=function(e){return t.apply(this,arguments)};return e.toString=function(){return t.toString()},e}(function(t){for(var e=[],i=0;i<this.rows;i++)e.push(this.pattern[i][t]?1:0);return e})},rows:{get:function(){return this.pattern.length},set:function(t){var e=this,i=this.pattern.slice(0);this.create(t,this.columns),this.iterate(function(t,n){i[t]&&i[t][n]&&(e.pattern[t][n]=i[t][n])})}},columns:{get:function(){return this.pattern[0].length},set:function(t){var e=this,i=this.pattern.slice(0);this.create(this.rows,t),this.iterate(function(t,n){i[t]&&i[t][n]&&(e.pattern[t][n]=i[t][n])})}}}),t}();t.exports=h},function(t,e,i){"use strict";var n=function(t){return t&&t.__esModule?t.default:t},s=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=n(i(5)),a=n(i(27)),h=function(){function t(){var e=void 0===arguments[0]?[0,10,20,30]:arguments[0],i=void 0===arguments[1]?"up":arguments[1],n=void 0!==arguments[2]&&arguments[2];r(this,t),this.values=e,Array.isArray(this.values)||(this.values=[this.values]),this._mode=i,this.position=n,this.drunkWalk=new a(0,this.values.length-1),this.startValues={up:0,down:this.values.length-1,drunk:~~(this.values.length/2),random:o.ri(this.values.length)},!1!==this.position?this.next=this[this._mode]:this.next=this.first}return s(t,{mode:{get:function(){return this._mode},set:function(t){if("up"!==t&&"down"!==t&&"random"!==t&&"drunk"!==t)return void console.error("The only modes currently allowed are: up, down, random, drunk");this._mode=t,this.position&&(this.next=this[this._mode])}},value:{get:function(){return this.values[this.position]},set:function(t){this.position=this.values.indexOf(t)}},first:{value:function(){return!1!==this.position?(this.next=this[this._mode],this.next()):(this.position=this.startValues[this._mode],this.next=this[this._mode],this.value)}},up:{value:function(){return this.position++,this.position%=this.values.length,this.value}},down:{value:function(){return this.position--,this.position<0&&(this.position=(this.position+this.values.length)%this.values.length),this.value}},random:{value:function(){return this.position=o.ri(0,this.values.length),this.value}},drunk:{value:function(){return this.drunkWalk.max=this.values.length,this.drunkWalk.value=this.position,this.position=this.drunkWalk.next(),this.value}}}),t}();t.exports=h},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(t){return t&&t.__esModule?t.default:t}(i(5)),o=function(){function t(){var e=void 0===arguments[0]?0:arguments[0],i=void 0===arguments[1]?9:arguments[1],n=void 0===arguments[2]?0:arguments[2],r=void 0===arguments[3]?1:arguments[3],o=void 0!==arguments[4]&&arguments[4];s(this,t),this.min=e,this.max=i,this.value=n,this.increment=r,this.loop=o}return n(t,{next:{value:function(){return this.value+=r.pick(-1*this.increment,this.increment),this.value>this.max&&(this.loop?this.value=this.min:this.value=this.max-this.increment),this.value<this.min&&(this.loop?this.value=this.max:this.value=this.min+this.increment),this.value}}}),t}();t.exports=o},function(t,e,i){"use strict";var n=function(t){return t&&t.__esModule?t.default:t},s=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=n(i(5)),a=n(i(27)),h=function(){function t(){var e=void 0===arguments[0]?0:arguments[0],i=void 0===arguments[1]?10:arguments[1],n=void 0===arguments[2]?"up":arguments[2],s=void 0!==arguments[3]&&arguments[3];r(this,t),this.min=e,this.max=i,this.value=s,this.mode=n,this.drunkWalk=new a(this.min,this.max),!1!==this.value?this.next=this[this._mode]:this.next=this.first}return s(t,{mode:{set:function(t){if("up"!==t&&"down"!==t&&"random"!==t&&"drunk"!==t)return void console.error("The only modes currently allowed are: up, down, random, drunk");this._mode=t,this.value&&(this.next=this[this._mode])},get:function(){return this._mode}},first:{value:function(){return!1!==this.value?(this.next=this[this._mode],this.next()):(this.startValues={up:this.min,down:this.max,drunk:~~o.average(this.min,this.max),random:o.ri(this.min,this.max)},this.value=this.startValues[this._mode],this.next=this[this._mode],this.value)}},up:{value:function(){return this.value++,this.value>=this.max&&(this.value=this.min),this.value}},down:{value:function(){return this.value--,this.value<this.min&&(this.value=this.max),this.value}},random:{value:function(){return this.value=o.ri(this.min,this.max),this.value}},drunk:{value:function(){return this.drunkWalk.min=this.min,this.drunkWalk.max=this.max,this.drunkWalk.value=this.value,this.value=this.drunkWalk.next(),this.value}}}),t}();t.exports=h},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(4),h=i(5),l=i(6),u=i(11),c=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),f=function(t){function e(){o(this,e);var t=["range"],i={size:[200,200],range:.5,mode:"absolute",speakers:[[.5,.2],[.75,.25],[.8,.5],[.75,.75],[.5,.8],[.25,.75],[.2,.5],[.25,.25]]};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.value={x:new u(0,1,0,.5),y:new u(0,1,0,.5)},this.mode=this.settings.mode,this.position={x:new c.Handle(this.mode,"horizontal",[0,this.width],[this.height,0]),y:new c.Handle(this.mode,"vertical",[0,this.width],[this.height,0])},this.position.x.value=this.value.x.normalized,this.position.y.value=this.value.y.normalized,this.speakers=this.settings.speakers,this.range=this.settings.range,this.levels=[],this.init(),this.calculateLevels(),this.render()}return r(e,t),n(e,{buildInterface:{value:function(){this.knob=a.create("circle"),this.element.appendChild(this.knob),this.speakerElements=[];for(var t=0;t<this.speakers.length;t++){var e=a.create("circle");this.element.appendChild(e),this.speakerElements.push(e)}}},sizeInterface:{value:function(){this._minDimension=Math.min(this.width,this.height),this.knobRadius={off:3*~~(this._minDimension/100)+5},this.knobRadius.on=2*this.knobRadius.off,this.knob.setAttribute("cx",this.width/2),this.knob.setAttribute("cy",this.height/2),this.knob.setAttribute("r",this.knobRadius.off);for(var t=0;t<this.speakers.length;t++){var e=this.speakerElements[t],i=this.speakers[t];e.setAttribute("cx",i[0]*this.width),e.setAttribute("cy",i[1]*this.height),e.setAttribute("r",this._minDimension/20+5),e.setAttribute("fill-opacity","0")}this.position.x.resize([0,this.width],[this.height,0]),this.position.y.resize([0,this.width],[this.height,0]),this.calculateLevels(),this.render()}},colorInterface:{value:function(){this.element.style.backgroundColor=this.colors.fill,this.knob.setAttribute("fill",this.colors.mediumLight);for(var t=0;t<this.speakers.length;t++){var e=this.speakerElements[t];e.setAttribute("fill",this.colors.accent),e.setAttribute("stroke",this.colors.accent)}}},render:{value:function(){this.knobCoordinates={x:this.value.x.normalized*this.width,y:this.height-this.value.y.normalized*this.height},this.knob.setAttribute("cx",this.knobCoordinates.x),this.knob.setAttribute("cy",this.knobCoordinates.y)}},click:{value:function(){this.position.x.anchor=this.mouse,this.position.y.anchor=this.mouse,this.move()}},move:{value:function(){this.clicked&&(this.position.x.update(this.mouse),this.position.y.update(this.mouse),this.calculateLevels(),this.emit("change",this.levels),this.render())}},release:{value:function(){this.render()}},normalized:{get:function(){return{x:this.value.x.normalized,y:this.value.y.normalized}}},calculateLevels:{value:function(){var t=this;this.value.x.updateNormal(this.position.x.value),this.value.y.updateNormal(this.position.y.value),this.levels=[],this.speakers.forEach(function(e,i){var n=h.distance(e[0]*t.width,e[1]*t.height,t.position.x.value*t.width,(1-t.position.y.value)*t.height),s=h.clip(1-n/(t.range*t.width),0,1);t.levels.push(s),t.speakerElements[i].setAttribute("fill-opacity",s)})}},moveSource:{value:function(t,e){var i={x:t*this.width,y:e*this.height};this.position.x.update(i),this.position.y.update(i),this.calculateLevels(),this.emit("change",this.levels),this.render()}},moveSpeaker:{value:function(t,e,i){this.speakers[t]=[e,i],this.speakerElements[t].setAttribute("cx",e*this.width),this.speakerElements[t].setAttribute("cy",i*this.height),this.calculateLevels(),this.emit("change",this.levels),this.render()}}}),e}(l);t.exports=f},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(5),h=i(4),l=i(6),u=function(t){function e(){o(this,e);var t=["value"],i={size:[80,80]};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this._active=!0,this.init(),this.boundUpdate=this.update.bind(this),window.DeviceOrientationEvent?this.orientationListener=window.addEventListener("deviceorientation",this.boundUpdate,!1):(this._active=!1,this.colorInterface())}return r(e,t),n(e,{buildInterface:{value:function(){this.title=h.create("text"),this.circleX=h.create("circle"),this.circleY=h.create("circle"),this.circleZ=h.create("circle"),this.barX=h.create("path"),this.barY=h.create("path"),this.barZ=h.create("path"),this.barX2=h.create("path"),this.barY2=h.create("path"),this.barZ2=h.create("path"),this.barX.setAttribute("opacity","0.8"),this.barY.setAttribute("opacity","0.8"),this.barZ.setAttribute("opacity","0.8"),this.barX2.setAttribute("opacity","0.8"),this.barY2.setAttribute("opacity","0.8"),this.barZ2.setAttribute("opacity","0.8"),this.circleX.setAttribute("cx",3*this.width/12),this.circleX.setAttribute("cy",3*this.height/4),this.circleX.setAttribute("r",this.height/10),this.circleX.setAttribute("opacity","0.4"),this.circleY.setAttribute("cx",6*this.width/12),this.circleY.setAttribute("cy",3*this.height/4),this.circleY.setAttribute("r",this.height/10),this.circleY.setAttribute("opacity","0.4"),this.circleZ.setAttribute("cx",9*this.width/12),this.circleZ.setAttribute("cy",3*this.height/4),this.circleZ.setAttribute("r",this.height/10),this.circleZ.setAttribute("opacity","0.4"),this.barX.setAttribute("stroke-width",Math.round(this.height/30)),this.barY.setAttribute("stroke-width",Math.round(this.height/30)),this.barZ.setAttribute("stroke-width",Math.round(this.height/30)),this.barX.setAttribute("fill","none"),this.barY.setAttribute("fill","none"),this.barZ.setAttribute("fill","none"),this.barX2.setAttribute("stroke-width",Math.round(this.height/30)),this.barY2.setAttribute("stroke-width",Math.round(this.height/30)),this.barZ2.setAttribute("stroke-width",Math.round(this.height/30)),this.barX2.setAttribute("fill","none"),this.barY2.setAttribute("fill","none"),this.barZ2.setAttribute("fill","none"),this.title.setAttribute("x",this.width/2),this.title.setAttribute("y",this.height/3+7),this.title.setAttribute("font-size","15px"),this.title.setAttribute("font-weight","bold"),this.title.setAttribute("letter-spacing","2px"),this.title.setAttribute("opacity","0.7"),this.title.setAttribute("text-anchor","middle"),this.title.textContent="TILT",this.element.appendChild(this.circleX),this.element.appendChild(this.circleY),this.element.appendChild(this.circleZ),this.element.appendChild(this.barX),this.element.appendChild(this.barY),this.element.appendChild(this.barZ),this.element.appendChild(this.barX2),this.element.appendChild(this.barY2),this.element.appendChild(this.barZ2),this.element.appendChild(this.title)}},colorInterface:{value:function(){this._active?(this.element.style.backgroundColor=this.colors.accent,this.circleX.setAttribute("fill",this.colors.light),this.circleY.setAttribute("fill",this.colors.light),this.circleZ.setAttribute("fill",this.colors.light),this.circleX.setAttribute("stroke",this.colors.light),this.circleY.setAttribute("stroke",this.colors.light),this.circleZ.setAttribute("stroke",this.colors.light),this.barX.setAttribute("stroke",this.colors.light),this.barY.setAttribute("stroke",this.colors.light),this.barZ.setAttribute("stroke",this.colors.light),this.barX2.setAttribute("stroke",this.colors.light),this.barY2.setAttribute("stroke",this.colors.light),this.barZ2.setAttribute("stroke",this.colors.light),this.title.setAttribute("fill",this.colors.light)):(this.element.style.backgroundColor=this.colors.fill,this.circleX.setAttribute("fill",this.colors.mediumLight),this.circleY.setAttribute("fill",this.colors.mediumLight),this.circleZ.setAttribute("fill",this.colors.mediumLight),this.circleX.setAttribute("stroke",this.colors.mediumLight),this.circleY.setAttribute("stroke",this.colors.mediumLight),this.circleZ.setAttribute("stroke",this.colors.mediumLight),this.barX.setAttribute("stroke",this.colors.mediumLight),this.barY.setAttribute("stroke",this.colors.mediumLight),this.barZ.setAttribute("stroke",this.colors.mediumLight),this.barX2.setAttribute("stroke",this.colors.mediumLight),this.barY2.setAttribute("stroke",this.colors.mediumLight),this.barZ2.setAttribute("stroke",this.colors.mediumLight),this.title.setAttribute("fill",this.colors.mediumLight))}},update:{value:function(t){if(this._active){var e=t.beta,i=t.gamma,n=t.alpha;i=a.scale(i,-90,90,0,1),e=a.scale(e,-90,90,0,1),n=a.scale(n,0,360,0,1);var s={start:1.5*Math.PI,end:a.clip(a.scale(i,0,.5,1.5*Math.PI,.5*Math.PI),.5*Math.PI,1.5*Math.PI)},r={start:2.5*Math.PI,end:a.clip(a.scale(i,.5,1,2.5*Math.PI,1.5*Math.PI),1.5*Math.PI,2.5*Math.PI)},o=h.arc(this.circleX.cx.baseVal.value,this.circleX.cy.baseVal.value,this.circleX.r.baseVal.value,s.start,s.end),l=h.arc(this.circleX.cx.baseVal.value,this.circleX.cy.baseVal.value,this.circleX.r.baseVal.value,r.start,r.end);this.barX.setAttribute("d",o),this.barX2.setAttribute("d",l),s={start:1.5*Math.PI,end:a.clip(a.scale(e,0,.5,1.5*Math.PI,.5*Math.PI),.5*Math.PI,1.5*Math.PI)},r={start:2.5*Math.PI,end:a.clip(a.scale(e,.5,1,2.5*Math.PI,1.5*Math.PI),1.5*Math.PI,2.5*Math.PI)},o=h.arc(this.circleY.cx.baseVal.value,this.circleY.cy.baseVal.value,this.circleY.r.baseVal.value,s.start,s.end),l=h.arc(this.circleY.cx.baseVal.value,this.circleY.cy.baseVal.value,this.circleY.r.baseVal.value,r.start,r.end),this.barY.setAttribute("d",o),this.barY2.setAttribute("d",l),s={start:1.5*Math.PI,end:a.clip(a.scale(n,0,.5,1.5*Math.PI,.5*Math.PI),.5*Math.PI,1.5*Math.PI)},r={start:2.5*Math.PI,end:a.clip(a.scale(n,.5,1,2.5*Math.PI,1.5*Math.PI),1.5*Math.PI,2.5*Math.PI)},o=h.arc(this.circleZ.cx.baseVal.value,this.circleZ.cy.baseVal.value,this.circleZ.r.baseVal.value,s.start,s.end),l=h.arc(this.circleZ.cx.baseVal.value,this.circleZ.cy.baseVal.value,this.circleZ.r.baseVal.value,r.start,r.end),this.barZ.setAttribute("d",o),this.barZ2.setAttribute("d",l),this.emit("change",{x:i,y:e,z:n})}}},click:{value:function(){window.DeviceOrientationEvent&&(this.active=!this.active)}},active:{get:function(){return this._active},set:function(t){this._active=t,this.colorInterface()}},customDestroy:{value:function(){window.removeEventListener("deviceorientation",this.boundUpdate,!1)}}}),e}(l);t.exports=u},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(7),h=i(5),l=i(6),u=i(32),c=i(9),f=function(t){function e(){var t=this;o(this,e);var i=["scale","value"],n={size:[120,20],orientation:"vertical",mode:"absolute",scale:[0,1],step:0,value:0,hasKnob:!0};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,i,n),c.exists||(this.click=function(){t.multislider.interacting=!0,t.multislider.interpolation={index:t.index,value:t.value},t.down(),t.multislider.values[t.index]=t.value},this.element.addEventListener("mouseover",function(e){if(t.multislider.interacting){if(t.offset||(t.offset=a.findPosition(t.element)),t.mouse=a.locateMouse(e,t.offset),t.down(),t.multislider.values[t.index]=t.value,t.multislider.interpolation){var i=Math.abs(t.multislider.interpolation.index-t.index);if(i>1)for(var n=Math.min(t.multislider.interpolation.index,t.index),s=Math.max(t.multislider.interpolation.index,t.index),r=t.multislider.sliders[n].value,o=t.multislider.sliders[s].value,l=n;l<s;l++){t.multislider.sliders[l].value=h.interp((l-n)/i,r,o);var u=t.multislider.sliders[l].value;t.multislider.values[l]=u,t.multislider.update(l,u)}}t.multislider.interpolation={index:t.index,value:t.value}}}),this.move=function(){},this.element.addEventListener("mousemove",function(e){t.multislider.interacting&&(t.offset||(t.offset=a.findPosition(t.element)),t.mouse=a.locateMouse(e,t.offset),t.slide(),t.multislider.values[t.index]=t.value)}),this.release=function(){t.multislider.interacting=!1,t.multislider.interpolation=!1},this.element.addEventListener("mouseup",function(){t.multislider.interacting&&(t.up(),t.multislider.interpolation=!1,t.multislider.values[t.index]=t.value)}),this.element.addEventListener("mouseout",function(){t.multislider.interacting&&(t.up(),t.multislider.values[t.index]=t.value)})),this.customStyle()}return r(e,t),n(e,{customStyle:{value:function(){this.bar.setAttribute("x",0),this.bar.setAttribute("transform","translate(0,0)"),this.bar.setAttribute("rx",0),this.bar.setAttribute("ry",0),this.bar.setAttribute("width",this.width),this.bar.setAttribute("height",this.height),this.fillbar.setAttribute("x",0),this.fillbar.setAttribute("transform","translate(0,0)"),this.fillbar.setAttribute("rx",0),this.fillbar.setAttribute("ry",0),this.fillbar.setAttribute("width",this.width),this.fillbar.setAttribute("height",this.height)}}}),e}(u),d=function(t){function e(){o(this,e);var t=["value"],i={size:[200,100],numberOfSliders:5,min:0,max:1,step:0,values:[.7,.7,.7,.7,.7]};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this._numberOfSliders=this.settings.numberOfSliders,this.values=this.settings.values,this.sliders=[],this.interacting=!1,this.init()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement("div"),this.parent.appendChild(this.element)}},buildInterface:{value:function(){var t=this.settings.min,e=this.settings.max,i=this.settings.step;this.sliders.length&&(t=this.sliders[0].min,e=this.sliders[0].max,i=this.sliders[0].step),this.sliders=[];for(var n=0;n<this._numberOfSliders;n++){var s=document.createElement("span"),r=new f(s,{scale:[t,e],step:i,mode:"absolute",orientation:"vertical",value:this.values[n],hasKnob:!1,component:!0},this.update.bind(this,n));r.multislider=this,r.index=n,c.exists&&(r.bar.index=n,r.fillbar.index=n,r.preClick=r.preMove=r.preRelease=function(){},r.click=r.move=r.release=function(){},r.preTouch=r.preTouchMove=r.preTouchRelease=function(){},r.touch=r.touchMove=r.touchRelease=function(){}),this.sliders.push(r),this.element.appendChild(s)}c.exists&&this.addTouchListeners()}},colorInterface:{value:function(){for(var t=0;t<this.sliders.length;t++)this.sliders[t].colors=this.colors,this.sliders[t].colorInterface()}},sizeInterface:{value:function(){for(var t=this.width/this.sliders.length,e=this.height,i=0;i<this.sliders.length;i++)this.sliders[i].resize(t,e),this.sliders[i].customStyle()}},update:{value:function(t,e){this.emit("change",{index:t,value:e})}},addTouchListeners:{value:function(){var t=this;this.preClick=this.preMove=this.preRelease=function(){},this.click=this.move=this.release=function(){},this.preTouch=this.preTouchMove=this.preTouchRelease=function(){},this.touch=this.touchMove=this.touchRelease=function(){},this.currentElement=!1,this.element.addEventListener("touchstart",function(e){var i=document.elementFromPoint(e.targetTouches[0].clientX,e.targetTouches[0].clientY),n=t.sliders[i.index];n.offset||(n.offset=a.findPosition(n.element)),n.mouse=a.locateMouse(e,n.offset),n.down(),t.currentElement=i.index,e.preventDefault(),e.stopPropagation()}),this.element.addEventListener("touchmove",function(e){var i=document.elementFromPoint(e.targetTouches[0].clientX,e.targetTouches[0].clientY),n=t.sliders[i.index];if(n.offset||(n.offset=a.findPosition(n.element)),n.mouse=a.locateMouse(e,n.offset),i.index!==t.currentElement){if(t.currentElement>=0){t.sliders[t.currentElement].up()}n.down()}else n.slide();t.currentElement=i.index,e.preventDefault(),e.stopPropagation()}),this.element.addEventListener("touchend",function(e){t.sliders[t.currentElement].up(),t.interacting=!1,t.currentElement=!1,e.preventDefault(),e.stopPropagation()})}},numberOfSliders:{get:function(){return this.sliders.length},set:function(t){t!==this.sliders.length&&(this.sliders.forEach(function(t){t.destroy()}),this.empty(),this._numberOfSliders=t,this.buildInterface())}},min:{get:function(){return this.sliders[0].min},set:function(t){this.sliders.forEach(function(e){e.min=t})}},max:{get:function(){return this.sliders[0].max},set:function(t){this.sliders.forEach(function(e){e.max=t})}},step:{get:function(){return this.sliders[0].step},set:function(t){this.sliders.forEach(function(e){e.step=t})}},setSlider:{value:function(t,e){this.sliders[t].value=e,this.emit("change",{index:t,value:e})}},setAllSliders:{value:function(t){var e=this;this.values=t,this.sliders.forEach(function(i,n){i.value=t[n%t.length],e.emit("change",{index:n,value:i.value})})}}}),e}(l);t.exports=d},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(4),h=i(6),l=i(11),u=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),c=function(t){function e(t,i,n){o(this,e),s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t,i,n),this.orientation=this.settings.orientation,this.hasKnob=this.settings.hasKnob,this._value=new l(this.settings.scale[0],this.settings.scale[1],this.settings.step,this.settings.value),this.init(),this.position=new u.Handle(this.settings.mode,this.orientation,[0,this.width],[this.height,0]),this.position.value=this._value.normalized,this.value=this._value.value,this.emit("change",this.value)}return r(e,t),n(e,{buildInterface:{value:function(){this.bar=a.create("rect"),this.fillbar=a.create("rect"),this.knob=a.create("circle"),this.element.appendChild(this.bar),this.element.appendChild(this.fillbar),this.element.appendChild(this.knob),this.sizeInterface()}},sizeInterface:{value:function(){this.settings.orientation||(this.width<this.height?this.orientation="vertical":this.orientation="horizontal");var t=void 0,e=void 0,i=void 0,n=void 0,s=void 0,r=void 0;this.knobData={level:0,r:0},"vertical"===this.orientation?(this.thickness=this.width/2,t=this.width/2,e=0,i=this.thickness,n=this.height,this.knobData.r=.8*this.thickness,this.knobData.level=n-this.normalized*n,s="translate("+-1*this.thickness/2+",0)",r=i/2):(this.thickness=this.height/2,t=0,e=this.height/2,i=this.width,n=this.thickness,this.knobData.r=.8*this.thickness,this.knobData.level=this.normalized*i,s="translate(0,"+-1*this.thickness/2+")",r=n/2),this.bar.setAttribute("x",t),this.bar.setAttribute("y",e),this.bar.setAttribute("transform",s),this.bar.setAttribute("rx",r),this.bar.setAttribute("ry",r),this.bar.setAttribute("width",i),this.bar.setAttribute("height",n),"vertical"===this.orientation?(this.fillbar.setAttribute("x",t),this.fillbar.setAttribute("y",this.knobData.level),this.fillbar.setAttribute("width",i),this.fillbar.setAttribute("height",n-this.knobData.level)):(this.fillbar.setAttribute("x",0),this.fillbar.setAttribute("y",e),this.fillbar.setAttribute("width",this.knobData.level),this.fillbar.setAttribute("height",n)),this.fillbar.setAttribute("transform",s),this.fillbar.setAttribute("rx",r),this.fillbar.setAttribute("ry",r),"vertical"===this.orientation?(this.knob.setAttribute("cx",t),this.knob.setAttribute("cy",this.knobData.level)):(this.knob.setAttribute("cx",this.knobData.level),this.knob.setAttribute("cy",e)),this.knob.setAttribute("r",this.knobData.r),this.position&&this.position.resize([0,this.width],[this.height,0])}},colorInterface:{value:function(){this.bar.setAttribute("fill",this.colors.fill),this.fillbar.setAttribute("fill",this.colors.accent),this.knob.setAttribute("fill",this.colors.accent),this.hasKnob||this.knob.setAttribute("fill","none")}},render:{value:function(){this.clicked||(this.knobData.r=.75*this.thickness),this.knob.setAttribute("r",this.knobData.r),"vertical"===this.orientation?(this.knobData.level=this._value.normalized*this.height,this.knob.setAttribute("cy",this.height-this.knobData.level),this.fillbar.setAttribute("y",this.height-this.knobData.level),this.fillbar.setAttribute("height",this.knobData.level)):(this.knobData.level=this._value.normalized*this.width,this.knob.setAttribute("cx",this.knobData.level),this.fillbar.setAttribute("x",0),this.fillbar.setAttribute("width",this.knobData.level))}},down:{value:function(){this.clicked=!0,this.knobData.r=.9*this.thickness,this.position.anchor=this.mouse,this.slide()}},slide:{value:function(){this.clicked&&(this.position.update(this.mouse),this.value=this._value.updateNormal(this.position.value),this.emit("change",this.value))}},up:{value:function(){this.clicked=!1,this.render()}},normalized:{get:function(){return this._value.normalized}},value:{get:function(){return this._value.value},set:function(t){this._value.update(t),this.position.value=this._value.normalized,this.render()}},min:{get:function(){return this._value.min},set:function(t){this._value.min=t}},max:{get:function(){return this._value.max},set:function(t){this._value.max=t}},step:{get:function(){return this._value.step},set:function(t){this._value.step=t}},mode:{get:function(){return this.position.mode},set:function(t){this.position.mode=t}}}),e}(h);t.exports=c},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(4),h=i(5),l=i(6),u=i(11),c=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),f=function(t){function e(){o(this,e);var t=["scale","value"],i={size:[120,20],orientation:"horizontal",mode:"relative",scale:[-1,1],step:0,value:0,hasKnob:!0};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.orientation=this.settings.orientation,this.mode=this.settings.mode,this.hasKnob=this.settings.hasKnob,this.step=this.settings.step,this._value=new u(this.settings.scale[0],this.settings.scale[1],this.settings.step,this.settings.value),this.init(),this.position=new c.Handle(this.mode,this.orientation,[0,this.width],[this.height,0]),this.position.value=this._value.normalized,this.value=this._value.value,this.emit("change",this.value)}return r(e,t),n(e,{buildInterface:{value:function(){this.bar=a.create("rect"),this.knob=a.create("circle"),this.element.appendChild(this.bar),this.element.appendChild(this.knob)}},sizeInterface:{value:function(){this.position&&this.position.resize([0,this.width],[this.height,0]),this.width<this.height?this.orientation="vertical":this.orientation="horizontal";var t=void 0,e=void 0,i=void 0,n=void 0,s=void 0,r=void 0;this.knobData={level:0,r:0},"vertical"===this.orientation?(this.thickness=this.width/2,t=this.width/2,e=0,i=this.thickness,n=this.height,this.knobData.r=.8*this.thickness,this.knobData.level=n-this.knobData.r-this.normalized*(n-2*this.knobData.r),s="translate("+-1*this.thickness/2+",0)",r=i/2):(this.thickness=this.height/2,t=0,e=this.height/2,i=this.width,n=this.thickness,this.knobData.r=.8*this.thickness,this.knobData.level=this.normalized*(i-2*this.knobData.r)+this.knobData.r,s="translate(0,"+-1*this.thickness/2+")",r=n/2),this.bar.setAttribute("x",t),this.bar.setAttribute("y",e),this.bar.setAttribute("transform",s),this.bar.setAttribute("rx",r),this.bar.setAttribute("ry",r),this.bar.setAttribute("width",i),this.bar.setAttribute("height",n),"vertical"===this.orientation?(this.knob.setAttribute("cx",t),this.knob.setAttribute("cy",this.knobData.level)):(this.knob.setAttribute("cx",this.knobData.level),this.knob.setAttribute("cy",e)),this.knob.setAttribute("r",this.knobData.r)}},colorInterface:{value:function(){this.bar.setAttribute("fill",this.colors.fill),this.knob.setAttribute("fill",this.colors.accent),this.hasKnob||this.knob.setAttribute("fill","transparent")}},render:{value:function(){this.clicked||(this.knobData.r=.75*this.thickness),this.knob.setAttribute("r",this.knobData.r),"vertical"===this.orientation?(this.knobData.level=this.knobData.r+this._value.normalized*(this.height-2*this.knobData.r),this.knob.setAttribute("cy",this.height-this.knobData.level)):(this.knobData.level=this._value.normalized*(this.width-2*this.knobData.r)+this.knobData.r,this.knob.setAttribute("cx",this.knobData.level))}},click:{value:function(){this.knobData.r=.9*this.thickness,this.position.anchor=this.mouse,this.move()}},move:{value:function(){this.clicked&&(this.position.update(this.mouse),this.value=this._value.updateNormal(this.position.value),this.emit("change",{value:this.value,L:Math.pow(h.scale(this.value,-1,1,1,0),2),R:Math.pow(h.scale(this.value,-1,1,0,1),2)}))}},release:{value:function(){this.render()}},value:{get:function(){return this._value.value},set:function(t){this._value.update(t),this.position.value=this._value.normalized,this.emit("change",{value:this.value,L:Math.pow(h.scale(this.value,-1,1,1,0),2),R:Math.pow(h.scale(this.value,-1,1,0,1),2)}),this.render()}},normalized:{get:function(){return this._value.normalized}}}),e}(l);t.exports=f},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(5),h=i(4),l=i(6),u=function(t,e){this.x=t.x,this.y=t.y,this.envelope=e,this.element=h.create("circle"),this.element.setAttribute("fill",this.envelope.colors.accent),this.envelope.element.appendChild(this.element),this.resize=function(){var t=2+~~(Math.min(this.envelope.width,this.envelope.height)/50);this.element.setAttribute("r",t)},this.move=function(t,e){if(this.x=t||0===t?t:this.x,this.y=e||0===e?e:this.y,this.envelope.nodes.indexOf(this)>=0){var i=this.envelope.nodes.indexOf(this)-1,n=this.envelope.nodes.indexOf(this)+1,s=this.envelope.nodes[i],r=this.envelope.nodes[n],o=i>=0?s.x:0,a=n<this.envelope.nodes.length?r.x:1;this.x<o&&(this.x=o),this.x>a&&(this.x=a)}this.location=this.getCoordinates(),this.element.setAttribute("cx",this.location.x),this.element.setAttribute("cy",this.location.y)},this.getCoordinates=function(){return{x:this.x*this.envelope.width,y:(1-this.y)*this.envelope.height}},this.move(this.x,this.y,!0),this.resize(),this.destroy=function(){this.envelope.element.removeChild(this.element),this.envelope.nodes.splice(this.envelope.nodes.indexOf(this),1)}},c=function(t){function e(){o(this,e);var t=["value"],i={size:[300,150],points:[{x:.1,y:.4},{x:.35,y:.6},{x:.65,y:.2},{x:.9,y:.4}]};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.points=this.settings.points,this.nodes=[],this.selected=!1,this.init()}return r(e,t),n(e,{buildInterface:{value:function(){var t=this;this.points.forEach(function(e){var i=new u(e,t);t.nodes.push(i)}),this.sortPoints(),this.line=h.create("polyline"),this.line.setAttribute("stroke-width",2),this.line.setAttribute("fill","none"),this.element.appendChild(this.line),this.fill=h.create("polyline"),this.fill.setAttribute("fill-opacity","0.2"),this.element.appendChild(this.fill)}},sizeInterface:{value:function(){for(var t=0;t<this.nodes.length;t++)this.nodes[t].resize(),this.nodes[t].move();this.render()}},colorInterface:{value:function(){var t=this;this.element.style.backgroundColor=this.colors.fill,this.line.setAttribute("stroke",this.colors.accent),this.fill.setAttribute("fill",this.colors.accent),this.nodes.forEach(function(e){e.element.setAttribute("fill",t.colors.accent)})}},render:{value:function(){this.calculatePath()}},calculatePoints:{value:function(){var t=this;this.points=[],this.nodes.forEach(function(e){t.points.push({x:e.x,y:e.y})})}},calculatePath:{value:function(){var t="0 "+this.nodes[0].location.y+", ";this.nodes.forEach(function(e){t+=e.location.x+" "+e.location.y+", "}),t+=this.width+" "+this.nodes[this.nodes.length-1].location.y,this.line.setAttribute("points",t),t+=", "+this.width+" "+this.height+", ",t+="0 "+this.height,this.fill.setAttribute("points",t)}},click:{value:function(){this.hasMoved=!1,this.selected=this.findNearestNode(),this.nodes[this.selected].move(this.mouse.x/this.width,1-this.mouse.y/this.height),this.scaleNode(this.selected),this.calculatePoints(),this.emit("change",this.points),this.render()}},move:{value:function(){this.clicked&&(this.mouse.x=a.clip(this.mouse.x,0,this.width),this.hasMoved=!0,this.nodes[this.selected].move(this.mouse.x/this.width,1-this.mouse.y/this.height),this.scaleNode(this.selected),this.calculatePoints(),this.emit("change",this.points),this.render())}},release:{value:function(){this.hasMoved||this.nodes[this.selected].destroy(),this.calculatePoints(),this.emit("change",this.points),this.render(),this.selected=null}},findNearestNode:{value:function(){for(var t=null,e=1e4,i=this.mouse.x/this.width,n=1-this.mouse.y/this.height,s=this.nodes,r=0;r<s.length;r++){var o=Math.sqrt(Math.pow(s[r].x-i,2)+Math.pow(s[r].y-n,2));o<e&&(e=o,t=r,i>s[r].x)}return e>.07&&(t=this.getIndexFromX(this.mouse.x/this.width),this.nodes.splice(t,0,new u({x:this.mouse.x/this.width,y:1-this.mouse.y/this.height},this)),this.hasMoved=!0),t}},getIndexFromX:{value:function(t){var e=this,i=0;return this.nodes.forEach(function(n,s){e.nodes[s].x<=t&&(i=s+1)}),i}},scaleNode:{value:function(t){var e=a.clip(this.nodes[t].x,0,1),i=a.clip(this.nodes[t].y,0,1);this.nodes[t].move(e,i)}},sortPoints:{value:function(){this.nodes.sort(function(t,e){return t.x>e.x})}},addPoint:{value:function(t,e){var i=this.nodes.length;this.sortPoints();for(var n=0;n<this.nodes.length;n++)if(t<this.nodes[n].x){i=n;break}this.nodes.splice(i,0,new u({x:t,y:e},this)),this.scaleNode(i),this.calculatePoints(),this.emit("change",this.points),this.render()}},scan:{value:function(t){var e=this.getIndexFromX(t),i=e-1;i<0&&(i=0),e>=this.nodes.length&&(e=this.nodes.length-1);var n=this.nodes[i],s=this.nodes[e],r=a.scale(t,n.x,s.x,0,1),o=a.interp(r,n.y,s.y);return this.emit("scan",o),o}},movePoint:{value:function(t,e,i){this.nodes[t].move(e,i),this.scaleNode(t),this.calculatePoints(),this.emit("change",this.points),this.render()}},adjustPoint:{value:function(t,e,i){this.nodes[t].move(this.nodes[t].x+e,this.nodes[t].y+i),this.scaleNode(t),this.calculatePoints(),this.emit("change",this.points),this.render()}},destroyPoint:{value:function(t){this.nodes[t].destroy(),this.calculatePoints(),this.emit("change",this.points),this.render()}},setPoints:{value:function(t){for(var e=this;this.nodes.length;)this.nodes[0].destroy();t.forEach(function(t){e.addPoint(t.x,t.y)}),this.calculatePoints(),this.emit("change",this.points),this.render()}}}),e}(l);t.exports=c},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(7),h=i(6),l=i(1).context,u=function(t){function e(){o(this,e);var t=["scale","value"],i={size:[300,150]};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.context=l(),this.analyser=this.context.createAnalyser(),this.analyser.fftSize=2048,this.bufferLength=this.analyser.frequencyBinCount,this.dataArray=new Uint8Array(this.bufferLength),this.active=!0,this.source=!1,this.init()}return r(e,t),n(e,{buildFrame:{value:function(){this.canvas=new a.SmartCanvas(this.parent),this.element=this.canvas.element}},sizeInterface:{value:function(){this.canvas.resize(this.width,this.height)}},colorInterface:{value:function(){this.canvas.element.style.backgroundColor=this.colors.fill}},render:{value:function(){if(this.active&&requestAnimationFrame(this.render.bind(this)),this.analyser.getByteFrequencyData(this.dataArray),this.canvas.context.fillStyle=this.colors.fill,this.canvas.context.fillRect(0,0,this.canvas.element.width,this.canvas.element.height),this.source&&this.dataArray)for(var t=this.canvas.element.width/this.bufferLength,e=void 0,i=0,n=this.canvas.element.width/50,s=0;s<this.bufferLength;s+=n)e=Math.max.apply(null,this.dataArray.subarray(s,s+n)),e/=255,e*=this.canvas.element.height,this.canvas.context.fillStyle=this.colors.accent,this.canvas.context.fillRect(i,this.canvas.element.height-e,t*n,e),i+=t*n}},connect:{value:function(t){this.source&&this.disconnect(),this.source=t,this.source.connect(this.analyser),this.render()}},disconnect:{value:function(){this.source.disconnect(this.analyser),this.source=null}},click:{value:function(){this.active=!this.active,this.render()}},customDestroy:{value:function(){this.active=!1}}}),e}(h);t.exports=u},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(7),h=i(5),l=i(6),u=i(1).context,c=function(t){function e(){o(this,e);var t=["scale","value"],i={size:[30,100]};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.context=u(),this.channels=2,this.splitter=this.context.createChannelSplitter(this.channels),this.analysers=[];for(var n=0;n<this.channels;n++){var r=this.context.createAnalyser();this.splitter.connect(r,n),r.fftSize=1024,r.smoothingTimeConstant=1,this.analysers.push(r)}this.bufferLength=this.analysers[0].frequencyBinCount,this.dataArray=new Float32Array(this.bufferLength),this.active=!0,this.db=-1/0,this.init(),this.meterWidth=this.canvas.element.width/this.channels,this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.canvas=new a.SmartCanvas(this.parent),this.element=this.canvas.element}},sizeInterface:{value:function(){this.canvas.resize(this.width,this.height)}},colorInterface:{value:function(){this.canvas.element.style.backgroundColor=this.colors.fill}},render:{value:function(){this.active&&requestAnimationFrame(this.render.bind(this)),this.canvas.context.fillStyle=this.colors.fill,this.canvas.context.fillRect(0,0,this.canvas.element.width,this.canvas.element.height);for(var t=0;t<this.analysers.length;t++){if(this.source){this.analysers[t].getFloatTimeDomainData(this.dataArray);for(var e=0,i=0;i<this.dataArray.length;i++)e+=this.dataArray[i]*this.dataArray[i];e=Math.sqrt(e/this.dataArray.length),this.db=20*Math.log10(e)}else this.db>-200&&this.db!==-1/0?this.db-=1:this.db=-1/0;if(this.db>-70){var n=h.normalize(this.db,-70,5),s=n*n,r=h.scale(s,0,1,this.element.height,0);this.canvas.context.fillStyle=this.colors.accent,this.canvas.context.fillRect(this.meterWidth*t,r,this.meterWidth,this.canvas.element.height-r)}}}},connect:{value:function(t,e){this.source&&this.disconnect(),e?this.channels=e:t.channelCount?this.channels=t.channelCount:this.channels=2,this.meterWidth=this.canvas.element.width/this.channels,this.source=t,this.source.connect(this.splitter)}},disconnect:{value:function(){this.source.disconnect(this.splitter),this.source=!1,this.meterWidth=this.canvas.element.width/this.channels}},click:{value:function(){this.active=!this.active,this.render()}},customDestroy:{value:function(){this.active=!1}}}),e}(l);t.exports=c},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if("value"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=i(7),h=i(6),l=i(1).context,u=function(t){function e(){o(this,e);var t=["scale","value"],i={size:[300,150]};s(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,arguments,t,i),this.context=l(),this.analyser=this.context.createAnalyser(),this.analyser.fftSize=2048,this.bufferLength=this.analyser.frequencyBinCount,this.dataArray=new Uint8Array(this.bufferLength),this.analyser.getByteTimeDomainData(this.dataArray),this.active=!0,this.source=!1,this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.canvas=new a.SmartCanvas(this.parent),this.element=this.canvas.element}},sizeInterface:{value:function(){this.canvas.resize(this.width,this.height)}},colorInterface:{value:function(){this.canvas.element.style.backgroundColor=this.colors.fill}},render:{value:function(){if(this.active&&requestAnimationFrame(this.render.bind(this)),this.analyser.getByteTimeDomainData(this.dataArray),this.canvas.context.fillStyle=this.colors.fill,this.canvas.context.fillRect(0,0,this.canvas.element.width,this.canvas.element.height),this.canvas.context.lineWidth=~~(this.height/100+2),this.canvas.context.strokeStyle=this.colors.accent,this.canvas.context.beginPath(),this.source)for(var t=1*this.canvas.element.width/this.bufferLength,e=0,i=0;i<this.bufferLength;i++){var n=this.dataArray[i]/128,s=n*this.canvas.element.height/2;0===i?this.canvas.context.moveTo(e,s):this.canvas.context.lineTo(e,s),e+=t}else this.canvas.context.moveTo(0,this.canvas.element.height/2),this.canvas.context.lineTo(this.canvas.element.width,this.canvas.element.height/2);this.canvas.context.stroke()}},connect:{value:function(t){this.source&&this.disconnect(),this.source=t,this.source.connect(this.analyser),this.render()}},disconnect:{value:function(){this.source&&(this.source.disconnect(this.analyser),this.source=null)}},click:{value:function(){this.active=!this.active,this.render()}},customDestroy:{value:function(){this.active=!1}}}),e}(h);t.exports=u},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(t){return t&&t.__esModule?t:{default:t}}(i(39)),o=function(t){return t&&t.__esModule?t.default:t}(i(7)),a=i(1).colors,h=function(){function t(e,i){s(this,t),this.meta={},this.meta.target=e,this.meta.parent=o.parseElement(e),this.meta.colors={},i?(this.meta.attribute=i.attribute||"nexus-ui",this.meta.title=i.name||!1,this.meta.open=i.open||!1):(this.meta.attribute="nexus-ui",this.meta.title=!1,this.meta.open=!1);var n=a();this.meta.colors.accent=n.accent,this.meta.colors.fill=n.fill,this.meta.colors.light=n.light,this.meta.colors.dark=n.dark,this.meta.colors.mediumLight=n.mediumLight,this.meta.colors.mediumDark=n.mediumDark,this.buildInterface(),this.colorInterface()}return n(t,{buildInterface:{value:function(){var t=this;for(this.meta.parent.style.boxSizing="border-box",this.meta.parent.style.userSelect="none",this.meta.parent.style.mozUserSelect="none",this.meta.parent.style.webkitUserSelect="none",this.meta.contents=document.createElement("div");this.meta.parent.childNodes.length>0;)this.meta.contents.appendChild(this.meta.parent.childNodes[0]);this.meta.contents.style.padding="0px",this.meta.contents.style.boxSizing="border-box",this.meta.title&&(this.meta.titleBar=document.createElement("div"),this.meta.titleBar.innerHTML=this.meta.title,this.meta.titleBar.style.fontFamily="arial",this.meta.titleBar.style.position="relative",this.meta.titleBar.style.color="#888",this.meta.titleBar.style.padding="7px",this.meta.titleBar.style.fontSize="12px",this.meta.button=document.createElement("div"),this.meta.button.style.position="absolute",this.meta.button.style.top="5px",this.meta.button.style.right="5px",this.meta.button.innerHTML="-",this.meta.button.style.padding="0px 5px 2px",this.meta.button.style.lineHeight="12px",this.meta.button.style.fontSize="15px",this.meta.button.style.cursor="pointer",this.meta.button.addEventListener("mouseover",function(){t.meta.button.style.backgroundColor=t.meta.colors.mediumDark}),this.meta.button.addEventListener("mouseleave",function(){t.meta.button.style.backgroundColor=t.meta.colors.mediumLight}),this.meta.button.addEventListener("click",function(){t.meta.open?t.hide():t.show()}),this.meta.titleBar.appendChild(this.meta.button),this.meta.parent.appendChild(this.meta.titleBar)),this.meta.parent.appendChild(this.meta.contents);var e=r.section(this.meta.target,this.meta.attribute);for(var i in e)this[i]=e[i]}},colorInterface:{value:function(){this.meta.title&&(this.meta.button.style.backgroundColor=this.meta.colors.mediumLight,this.meta.button.style.border="solid 0px "+this.meta.colors.fill,this.meta.parent.style.border="solid 1px "+this.meta.colors.mediumLight,this.meta.parent.style.backgroundColor=this.meta.colors.light,this.meta.titleBar.style.backgroundColor=this.meta.colors.fill)}},show:{value:function(){this.meta.contents.style.display="block",this.meta.open=!0}},hide:{value:function(){this.meta.contents.style.display="none",this.meta.open=!1}},colorize:{value:function(t,e){for(var i in this)this[i].colorize&&this[i].colorize(t,e);this.meta.colors[t]=e,this.colorInterface()}},empty:{value:function(){for(var t in this)this[t].destroy&&this[t].destroy()}}}),t}();t.exports=h},function(t,e,i){"use strict";var n=function(t){return t&&t.__esModule?t.default:t};Object.defineProperty(e,"__esModule",{value:!0});var s=n(i(7)),r=n(i(2)),o=function(t,e){var i=t.type;return e[i]?e[i]++:e[i]=1,i+e[i]},a=function(t,e,i){i=i||{};for(var n=0;n<t.attributes.length;n++){var s=t.attributes[n];i[s.nodeName]=s.nodeValue}e=e[0].toUpperCase()+e.slice(1);var o=new r[e](t,i);return o.id=t.id,o},h=function(t,e){e=e||"nexus-ui";for(var i={},n=s.parseElement(t),h={},l=n.getElementsByTagName("*"),u=[],c=0;c<l.length;c++)u.push(l[c]);for(var c=0;c<u.length;c++){var f=u[c].getAttribute(e);if(f){var d=!1;for(var v in r)f.toLowerCase()===v.toLowerCase()&&(d=v);console.log(d);var p=a(u[c],d);if(p.id)h[p.id]=p;else{h[o(p,i)]=p}}}return h},l=function(t,e,i){var n=document.createElement("div");return i=i||{},e=e?s.parseElement(e):document.body,e.appendChild(n),i.target=n,i.size&&(n.style.width=i.size[0]+"px",n.style.height=i.size[1]+"px"),a(n,t,i)};e.element=a,e.section=h,e.add=l},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(t){return t&&t.__esModule?t.default:t}(i(5)),o=function(){function t(){s(this,t),this.scale=[],this.mode={output:"frequency",input:"step"},this.etmajor=[261.62558,293.664764,329.627563,349.228241,391.995422,440,493.883301,523.25116],this.root=r.mtof(60),this.createScale(0,2,4,5,7,9,11)}return n(t,{note:{value:function(t,e){return"frequency"===this.mode.output?this.frequency(t,e):"ratio"===this.mode.output?this.ratio(t,e):"MIDI"===this.mode.output?this.MIDI(t,e):this.frequency(t,e)}},frequency:{value:function(t,e){"midi"!==this.mode.input&&"MIDI"!==this.mode.input||(this.stepIn+=60);var i=Math.floor(t/this.scale.length);e&&(i+=e);for(var n=t%this.scale.length;n<0;)n+=this.scale.length;var s=this.scale[n],r=this.root*s;return r*=Math.pow(2,i),r=Math.floor(1e11*r)/1e11}},ratio:{value:function(t,e){"midi"!==this.mode.input&&"MIDI"!==this.mode.input||(this.stepIn+=60);var i=Math.floor(t/this.scale.length);e&&(i+=e);var n=t%this.scale.length,s=Math.pow(2,i)*this.scale[n];return s=Math.floor(1e11*s)/1e11,s}},MIDI:{value:function(t,e){var i=this.frequency(t,e),n=69+12*Math.log(i/440)/Math.log(2);return n=Math.floor(1e9*n)/1e9}},createScale:{value:function(){for(var t=[],e=0;e<arguments.length;e++)t.push(r.mtof(60+arguments[e]));this.loadScaleFromFrequencies(t)}},createJIScale:{value:function(){this.scale=[];for(var t=0;t<arguments.length;t++)this.scale.push(arguments[t])}},loadScaleFromFrequencies:{value:function(t){this.scale=[];for(var e=0;e<t.length-1;e++)this.scale.push(t[e]/t[0])}},loadScale:{value:function(t){var e=this.scales[t].frequencies;this.loadScaleFromFrequencies(e)}},search:{value:function(t){var e=[];for(var i in this.scales)-1!==i.toLowerCase().indexOf(t.toLowerCase())&&e.push(i);return e}},chord:{value:function(t){for(var e=[],i=0;i<t.length;i++)e.push(this.note(t[i]));return e}}}),t}();t.exports=o},function(t,e){"use strict";var i=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),n=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(){for(var e=arguments.length,i=Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];var r=void 0===arguments[0]?3:arguments[0];n(this,t),r<0&&(r=1),this.length=r,this.onVals=i,this.array=new Array(r).fill(0),i.length>0&&this.on.apply(this,i)}return i(t,{select:{value:function(t){return this.array.fill(0),this.array[t]=1,this.array}},flip:{value:function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];var n=this.array;return e.length>0?e.forEach(function(t){t>n.length-1?console.warn("Warning: AnonRadio["+t+"] does not exist"):n[t]=n[t]?0:1}):n.forEach(function(t,e,i){i[e]=t?0:1}),n}},on:{value:function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];var n=this.array;return e.length>0?e.forEach(function(t){t>n.length-1?console.warn("Warning: AnonRadio["+t+"] exceeds size of object"):(1===n[t]&&console.warn("Warning: AnonRadio["+t+"] was already on."),n[t]=1)}):n.fill(1),n}},off:{value:function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];var n=this.array;return e.length>0?e.forEach(function(t){n[t]=0}):n.fill(0),n}}}),t}();t.exports=s},function(t,e,i){var n=i(43);t.exports=n,"undefined"!=typeof window&&(window.WAAClock=n)},function(t,e,i){(function(e){var i={toleranceLate:.1,toleranceEarly:.001},n=function(t,e,i){this.clock=t,this.func=i,this._cleared=!1,this.toleranceLate=t.toleranceLate,this.toleranceEarly=t.toleranceEarly,this._latestTime=null,this._earliestTime=null,this.deadline=null,this.repeatTime=null,this.schedule(e)};n.prototype.clear=function(){return this.clock._removeEvent(this),this._cleared=!0,this},n.prototype.repeat=function(t){if(0===t)throw new Error("delay cannot be 0");return this.repeatTime=t,this.clock._hasEvent(this)||this.schedule(this.deadline+this.repeatTime),this},n.prototype.tolerance=function(t){return"number"==typeof t.late&&(this.toleranceLate=t.late),"number"==typeof t.early&&(this.toleranceEarly=t.early),this._refreshEarlyLateDates(),this.clock._hasEvent(this)&&(this.clock._removeEvent(this),this.clock._insertEvent(this)),this},n.prototype.isRepeated=function(){return null!==this.repeatTime},n.prototype.schedule=function(t){this._cleared=!1,this.deadline=t,this._refreshEarlyLateDates(),this.clock.context.currentTime>=this._earliestTime?this._execute():this.clock._hasEvent(this)?(this.clock._removeEvent(this),this.clock._insertEvent(this)):this.clock._insertEvent(this)},n.prototype.timeStretch=function(t,e){this.isRepeated()&&(this.repeatTime=this.repeatTime*e);var i=t+e*(this.deadline-t);if(this.isRepeated())for(;this.clock.context.currentTime>=i-this.toleranceEarly;)i+=this.repeatTime;this.schedule(i)},n.prototype._execute=function(){!1!==this.clock._started&&(this.clock._removeEvent(this),this.clock.context.currentTime<this._latestTime?this.func(this):(this.onexpired&&this.onexpired(this),console.warn("event expired")),this.clock._hasEvent(this)||!this.isRepeated()||this._cleared||this.schedule(this.deadline+this.repeatTime))},n.prototype._refreshEarlyLateDates=function(){this._latestTime=this.deadline+this.toleranceLate,this._earliestTime=this.deadline-this.toleranceEarly};var s=t.exports=function(t,e){e=e||{},this.tickMethod=e.tickMethod||"ScriptProcessorNode",this.toleranceEarly=e.toleranceEarly||i.toleranceEarly,this.toleranceLate=e.toleranceLate||i.toleranceLate,this.context=t,this._events=[],this._started=!1};s.prototype.setTimeout=function(t,e){return this._createEvent(t,this._absTime(e))},s.prototype.callbackAtTime=function(t,e){return this._createEvent(t,e)},s.prototype.timeStretch=function(t,e,i){return e.forEach(function(e){e.timeStretch(t,i)}),e},s.prototype.start=function(){if(!1===this._started){var t=this;if(this._started=!0,this._events=[],"ScriptProcessorNode"===this.tickMethod){this._clockNode=this.context.createScriptProcessor(256,1,1),this._clockNode.connect(this.context.destination),this._clockNode.onaudioprocess=function(){e.nextTick(function(){t._tick()})}}else if("manual"!==this.tickMethod)throw new Error("invalid tickMethod "+this.tickMethod)}},s.prototype.stop=function(){!0===this._started&&(this._started=!1,this._clockNode.disconnect())},s.prototype._tick=function(){for(var t=this._events.shift();t&&t._earliestTime<=this.context.currentTime;)t._execute(),t=this._events.shift();t&&this._events.unshift(t)},s.prototype._createEvent=function(t,e){return new n(this,e,t)},s.prototype._insertEvent=function(t){this._events.splice(this._indexByTime(t._earliestTime),0,t)},s.prototype._removeEvent=function(t){var e=this._events.indexOf(t);-1!==e&&this._events.splice(e,1)},s.prototype._hasEvent=function(t){return-1!==this._events.indexOf(t)},s.prototype._indexByTime=function(t){for(var e,i=0,n=this._events.length;i<n;)e=Math.floor((i+n)/2),this._events[e]._earliestTime<t?i=e+1:n=e;return i},s.prototype._absTime=function(t){return t+this.context.currentTime},s.prototype._relTime=function(t){return t-this.context.currentTime}}).call(e,i(44))},function(t,e){function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function s(t){if(u===setTimeout)return setTimeout(t,0);if((u===i||!u)&&setTimeout)return u=setTimeout,setTimeout(t,0);try{return u(t,0)}catch(e){try{return u.call(null,t,0)}catch(e){return u.call(this,t,0)}}}function r(t){if(c===clearTimeout)return clearTimeout(t);if((c===n||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(t);try{return c(t)}catch(e){try{return c.call(null,t)}catch(e){return c.call(this,t)}}}function o(){p&&d&&(p=!1,d.length?v=d.concat(v):m=-1,v.length&&a())}function a(){if(!p){var t=s(o);p=!0;for(var e=v.length;e;){for(d=v,v=[];++m<e;)d&&d[m].run();m=-1,e=v.length}d=null,p=!1,r(t)}}function h(t,e){this.fun=t,this.array=e}function l(){}var u,c,f=t.exports={};!function(){try{u="function"==typeof setTimeout?setTimeout:i}catch(t){u=i}try{c="function"==typeof clearTimeout?clearTimeout:n}catch(t){c=n}}();var d,v=[],p=!1,m=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];v.push(new h(t,e)),1!==v.length||p||s(a)},h.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(t){return[]},f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e,i){"use strict";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=i(1).clock,o=function(){function t(e,i,n){s(this,t),this.rate=e,this.on=n,this.clock=r(),this.pattern=[1],this.index=0,this.event=i||function(){},this.on&&this.start()}return n(t,{_event:{value:function(t){this.event(t),this.index++}},stop:{value:function(){this.on=!1,this.interval.clear()}},start:{value:function(){this.on=!0,this.interval=this.clock.callbackAtTime(this._event.bind(this),this.clock.context.currentTime).repeat(this.rate/1e3).tolerance({early:.1,late:1})}},ms:{value:function(t){if(this.on){var e=t/this.rate;this.rate=t,this.clock.timeStretch(this.clock.context.currentTime,[this.interval],e)}else this.rate=t}}}),t}();t.exports=o}])})},function(t,e,i){"use strict";function n(t){if(t.altKey||t.ctrlKey||t.metaKey)return void t.stopPropagation();if(document.activeElement instanceof HTMLInputElement&&t.keyCode in o)return void t.stopPropagation();if(t.keyCode in r){var e=r[t.keyCode];t.shiftKey&&(e+=a.length),e-=7,h(e)}}function s(t){h=t}Object.defineProperty(e,"__esModule",{value:!0});var r={},o={},a="zxcvbnmasdfghjklqwertyuiop",h=function(){};a.toUpperCase().split("").map(function(t,e){r[t.charCodeAt(0)]=e}),"1234567890".split("").map(function(t,e){r[t.charCodeAt(0)]=e+a.length,o[t.charCodeAt(0)]=!0}),window.addEventListener("keydown",n,!0),e.default={listen:s}},function(t,e,i){"use strict";function n(t){return t[Math.floor(Math.random()*t.length)]}function s(t){return Math.floor(Math.random()*t)}function r(t,e){return t-e*Math.floor(t/e)}function o(t,e,i){return(t-e)/(i-e)}function a(t){t=t.slice(0);for(var e=t.length;e>0;e--){var i=s(e),n=t[e-1];t[e-1]=t[i],t[i]=n}return t}function h(t){if(_){var e=document.createElement("div"),i=document.createElement("div");i.innerHTML="Tap to start - please unmute your phone",Object.assign(e.style,{position:"absolute",width:"100%",height:"100%",zIndex:"10000",top:"0px",left:"0px",backgroundColor:"rgba(0, 0, 0, 0.8)"}),Object.assign(i.style,{position:"absolute",left:"50%",top:"50%",padding:"20px",backgroundColor:"#7F33ED",color:"white",fontFamily:"monospace",borderRadius:"3px",transform:"translate3D(-50%,-50%,0)",textAlign:"center",lineHeight:"1.5"}),e.appendChild(i),document.body.appendChild(e),StartAudioContext.setContext(Tone.context),StartAudioContext.on(i),StartAudioContext.onStarted(function(i){e.remove(),t()})}else t()}function l(t){for(var e=atob(t.split(",")[1]),i=t.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(e.length),s=new Uint8Array(n),r=0;r<e.length;r++)s[r]=e.charCodeAt(r);return new Blob([n],{type:i})}function u(t){return 69+12*Math.log2(t/440)}function c(t){return 440*Math.pow(2,(t-69)/12)}function f(t){return function(e){E.isMobile?t():e.press&&t()}}function d(t,e,i,n){var s=document.querySelector(e+" + .val"),r=function(t){s.innerHTML=i?parseInt(t):t.toFixed(2),n&&n(t)};t.on("change",r),s.innerHTML=i?parseInt(t.value):t.value.toFixed(2),t.update=r}function v(t,e,i,n){var s=t.active,r=document.querySelector(e+" + .val"),o=function(e){-1===e?e=t.active=s:s=e,r.innerHTML=i[e][1],n&&n(e)};t.on("change",o),o(t.active),t.update=o}function p(t,e,i){Object.keys(e).forEach(function(i){var n=e[i],s=document.createElement("option");s.innerHTML=n.name,s.value=i,t.appendChild(s)}),t.addEventListener("input",function(t){i(t.target.value)})}function m(t,e,i,n,s,r){var o=document.createElement("div");o.classList.add("block");var a=document.createElement("div");a.setAttribute("id",e);var h=document.createElement("span");h.classList.add("val");var l=document.createElement("label");l.innerHTML=i,o.appendChild(l),o.appendChild(a),o.appendChild(h),t.appendChild(o),n.size=[200,24];var u=new y.default.Slider("#"+e,n);return d(u,"#"+e,s,r),u}function b(t,e,i){var n=document.createElement("div");n.classList.add("stat");var s=document.createElement("div");s.classList.add("key");var r=document.createElement("div");r.classList.add("val"),n.appendChild(s),n.appendChild(r),t.appendChild(n),s.innerHTML=e,r.innerHTML=i();var o=void 0;return function(){var t=i();o!==t&&(r.innerText=o=t)}}Object.defineProperty(e,"__esModule",{value:!0}),e.Statistic=e.Slider=e.build_options=e.update_radio_value_on_change=e.update_value_on_change=e.dataURItoBlob=e.tap=e.mtof=e.ftom=e.requestAudioContext=e.browser=e.randint=e.shuffle=e.choice=e.norm=e.mod=void 0;var g=i(0),y=function(t){return t&&t.__esModule?t:{default:t}}(g),x=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i),w=navigator.userAgent.match(/iPad/i),k=navigator.userAgent.match(/Android/i),_=x||w||k,A=!_;document.body.classList.add(_?"mobile":"desktop");var E={isIphone:x,isIpad:w,isMobile:_,isDesktop:A};e.mod=r,e.norm=o,e.choice=n,e.shuffle=a,e.randint=s,e.browser=E,e.requestAudioContext=h,e.ftom=u,e.mtof=c,e.tap=f,e.dataURItoBlob=l,e.update_value_on_change=d,e.update_radio_value_on_change=v,e.build_options=p,e.Slider=m,e.Statistic=b},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function s(){if(J=setTimeout(s,L.Rate.value),!W){Q+=1;var t=L.T.value;(0,T.shuffle)(V).forEach(function(e){if(e.J>1)return void(e.J-=1);var i=_(e);1===e.J&&(q[e.y][e.x]||(e.J=0,q[e.y][e.x]=e,e.log.push("left jail"))),e.team===z?a(e,i):(r(e,i),Z.update(e,i,t))}),Z.id===D.SIM_GENOCIDE&&(V=V.filter(function(t){return!t.dead})),v()}}function r(t,e){t.CAv=o(e),t.G=t.H*(1-L.L.value),t.P=1-Math.exp(-L.k.value*t.CAv),t.NetR=t.R*t.P*Math.pow(L.J.value,L.alpha.value),t.GN=t.G-t.NetR}function o(t){var e=0,i=1;return t.forEach(function(t){t.team!==S&&(t.team===z?e+=1:i+=1)}),e/i}function a(t,e){e.some(function(t){return!(t.team===z||!t.active)&&(h(t),!0)}),f(t,e)}function h(t){t.J=(0,T.randint)(L.J.value),t.active=!1,q[t.y][t.x]=null,t.log.push("sent to jail")}function l(t,e){t.dead=!0,t.Age=0,q[t.y][t.x]=null,t.log.push(e)}function u(t,e){e.some(function(e){if(e.team===S){var i=e.y,n=e.x;return q[i][n]=c(i,n,t),t.log.push("gave birth"),!0}return!1})}function c(t,e,i){if(!(V.length>=L.Size.value*L.Size.value)){var n={id:U++,team:i?i.team:(0,T.randint)(Z.teams)+1,H:i?i.H:Math.random(),R:Math.random(),J:0,Age:(0,T.randint)(L.MaxAge.value)+1,active:!1,G:0,CAv:0,P:0,NetR:0,GN:0,log:[],y:t,x:e};return V.push(n),n}}function f(t,e){t.dead||t.J||e.some(function(e){if(e.team===S){var i=e.y,n=e.x;return q[t.y][t.x]=null,q[i][n]=t,t.y=i,t.x=n,!0}return!1})}function d(t){var e=void 0,i=void 0,n=void 0,s=void 0;return"GN"===G?(e=t[G],i=t.active?0:180,n=1-e,s=1-e):(e=t[G],i=t.active?0:100,n=1,s=1-2*e),"hsl("+[0|i,(100*n|0)+"%",(100*s|0)+"%"].join(",")+")"}function v(){var t=L.Size.value;I.clearRect(0,0,(t+1)*Y*2,t*Y),x(function(e,i){var n=q[e][i];n?n.team===z?(I.fillStyle="#000000",I.fillRect((i+t+1)*Y,e*Y,Y-B,Y-B),I.fillRect(i*Y,e*Y,Y-B,Y-B)):(I.save(),n===K&&(I.strokeStyle="#000",I.strokeRect((i+t+1)*Y,e*Y,Y,Y),I.strokeRect(i*Y,e*Y,Y,Y)),I.fillStyle=d(n),I.fillRect((i+t+1)*Y,e*Y,Y-B,Y-B),I.fillStyle=Z.color(n),I.fillRect(i*Y,e*Y,Y-B,Y-B),I.save()):(I.fillStyle="#ffffff",I.fillRect((i+t+1)*Y,e*Y,Y-B,Y-B),I.fillRect(i*Y,e*Y,Y-B,Y-B))}),H.forEach(function(t){return t()}),K.dead&&p()}function p(){var t=void 0;do{t=(0,T.choice)(V)}while(t.dead||t.team===z);K=t}function m(){V=[],q=[],U=0,Q=0;var t=L.Pop.value,e=L.Cops.value;q=x(function(e,i){return Math.random()<t?c(e,i):null});for(var i=0,n=V.length*e;i<n;i++)V[(0,T.randint)(V.length)].team=z;p(V),$={old_age:0,in_jail:0,murder:0}}function b(){w(),g()}function g(){clearTimeout(J),m(),s()}function y(){(W=!W)||(clearTimeout(J),s())}function x(t){for(var e=[],i=L.Size.value,n=0;n<i;n++){e[n]=[];for(var s=0;s<i;s++)e[n][s]=t(n,s,0)}return e}function w(){L.Size&&(C.width=(L.Size.value+1)*Y*2,C.height=L.Size.value*Y)}function k(t,e){var i=L.Size.value;return t=(0,T.mod)(t,i),e=(0,T.mod)(e,i),q[t][e]||{y:t,x:e,team:S}}function _(t){var e=t.y,i=t.x;return(0,T.shuffle)(F.map(function(t){return k(e+t[0],i+t[1])}))}function A(t){Z=N[t],console.log(Z.name),m()}function E(t){G=t,console.log("viewing",t+":",X[t].name)}function P(t){return t?"Yes":"No"}var O=i(0),M=(n(O),i(1)),T=(n(M),i(2)),C=document.querySelector("canvas"),I=C.getContext("2d"),L=window.nx={},z=0,S=-1,D={SIM_REBELLION:0,SIM_GENOCIDE:1},j=["#000000","#008000","#000080","#008080","#00ff80","#0080ff"],R=["#000000","#800000","#800080","#808080","#80ff80","#8080ff"],F=[[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]],N={rebellion:{id:D.SIM_REBELLION,name:"Civil Violence Model I: Generalized Rebellion Against Central Authority",teams:1,update:function(t,e,i){if(!(t.J>0)){var n=t.GN>i;n&&!t.active?t.log.push("went active"):!n&&t.active&&t.log.push("went inactive"),t.active=n,f(t,e)}},color:function(t){return t.active?R[t.team]:j[t.team]}},genocide:{id:D.SIM_GENOCIDE,name:"Civil Violence Model II: Inter-Group Violence",teams:2,update:function(t,e,i){if(!t.dead){if(t.Age--<=0)return void(t.J>0?(l(t,"died in jail"),$.in_jail+=1):(l(t,"died of old age"),$.old_age+=1));t.GN>i&&e.some(function(e){return e.team!==S&&e.team!==z&&e.team!==t.team&&(l(e,"died of murder"),t.active=!0,t.log.push("killed someone"),$.murder+=1,!0)}),Math.random()<L.Rep.value&&u(t,e),f(t,e)}},color:function(t){return j[t.team]}}},X={G:{value:"G",name:"Grievance"},CAv:{value:"CAv",name:"Cop-to-Active ratio"},P:{value:"P",name:"Arrest probability"},NetR:{value:"NetR",name:"Net risk of being arrested"},GN:{value:"GN",name:"Distance from threshold"}},Y=10,B=1,V=[],q=[],H=[],Z=N.rebellion,G="G",W=!1,J=void 0,U=0,K=void 0,Q=0,$={};!function(){(0,T.build_options)(document.querySelector("#sim"),N,A),(0,T.build_options)(document.querySelector("#view"),X,E);var t=document.querySelector("#options");L.Size=(0,T.Slider)(t,"world_size","World size",{min:10,max:200,step:1,value:40},!0,b),L.Rate=(0,T.Slider)(t,"rate","Frame rate",{min:10,max:1e3,step:10,value:200},!0,m),L.L=(0,T.Slider)(t,"governmental_legitimacy","Governmental legitimacy",{min:0,max:1,step:.01,value:.9},!1),L.T=(0,T.Slider)(t,"activation_threshold","Grievance threshold",{min:0,max:1,step:.01,value:.1},!1),L.Rep=(0,T.Slider)(t,"birth_rate","Birth rate",{min:0,max:1,step:.001,value:.05},!1),L.MaxAge=(0,T.Slider)(t,"max_age","Max age",{min:0,max:1e3,step:1,value:200},!0),L.J=(0,T.Slider)(t,"max_jail_term","Maximum jail term",{min:1,max:100,step:1,value:30},!0),L.alpha=(0,T.Slider)(t,"jail_deterrent","Jail deterrent",{min:0,max:2,step:.01,value:0},!1),L.k=(0,T.Slider)(t,"arrest_constant","Arrest probability constant",{min:1,max:10,step:.01,value:2.3},!1),L.Pop=(0,T.Slider)(t,"population_density","Population density",{min:0,max:1,step:.01,value:.7},!1,g),L.Cops=(0,T.Slider)(t,"cop_density","Cop density",{min:0,max:.1,step:.002,value:.05},!1,g);var e=document.querySelector("#stats"),i=document.querySelector("#log");H=[(0,T.Statistic)(e,"Time",function(){return Q}),(0,T.Statistic)(e,"Agents",function(){return V.length}),(0,T.Statistic)(e,"Cops",function(){return V.filter(function(t){return t.team===z}).length}),(0,T.Statistic)(e,"Team #1",function(){return V.filter(function(t){return 1===t.team}).length}),(0,T.Statistic)(e,"Team #2",function(){return V.filter(function(t){return 2===t.team}).length}),(0,T.Statistic)(e,"Quiescent",function(){return V.filter(function(t){return!t.active}).length}),(0,T.Statistic)(e,"Active",function(){return V.filter(function(t){return t.active}).length}),(0,T.Statistic)(e,"Jailed",function(){return V.filter(function(t){return t.J>0}).length}),(0,T.Statistic)(e,"Died of old age",function(){return $.old_age}),(0,T.Statistic)(e,"Died in jail",function(){return $.in_jail}),(0,T.Statistic)(e,"Murder rate",function(){return $.murder}),(0,T.Statistic)(e,"~ ~ ~",function(){return""}),(0,T.Statistic)(e,"Selected Agent #",function(){return K&&K.id}),(0,T.Statistic)(e,"Position",function(){return K&&K.x+","+K.y}),(0,T.Statistic)(e,"Hardship",function(){return K&&K.H.toFixed(2)}),(0,T.Statistic)(e,"Risk tolerance",function(){return K&&K.R.toFixed(2)}),(0,T.Statistic)(e,"Grievance",function(){return K&&K.G.toFixed(2)}),(0,T.Statistic)(e,"Score",function(){return K&&K.GN.toFixed(2)}),(0,T.Statistic)(e,"Cop / Active ratio",function(){return K&&K.CAv.toFixed(2)}),(0,T.Statistic)(e,"Arrest probability",function(){return K&&K.P.toFixed(2)}),(0,T.Statistic)(e,"Net risk",function(){return K&&K.NetR.toFixed(2)}),(0,T.Statistic)(e,"Active",function(){return K&&P(K.active)}),(0,T.Statistic)(e,"Age",function(){return K&&K.Age}),(0,T.Statistic)(e,"In Jail?",function(){return K&&P(K.J)}),(0,T.Statistic)(e,"Dead?",function(){return K&&P(K.dead)}),(0,T.Statistic)(e,"Jail term",function(){return K&&(K.J?K.J:"")}),(0,T.Statistic)(i,"Log",function(){return K&&K.log.join("\n")})],document.querySelector("button#restart").addEventListener("click",g),document.querySelector("button#pause").addEventListener("click",y),document.querySelector("button#observe").addEventListener("click",function(){p()}),document.querySelector(".loading").classList.remove("loading"),w(),g()}()}]);
+//# sourceMappingURL=bundle.js.map \ No newline at end of file
diff --git a/bundle.js.map b/bundle.js.map
new file mode 100644
index 0000000..ccfd9ed
--- /dev/null
+++ b/bundle.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"./bundle.js","sources":["webpack:///./bundle.js"],"sourcesContent":["!function(t){function e(n){if(i[n])return i[n].exports;var s=i[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,\"a\",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p=\"\",e(e.s=3)}([function(t,e,i){!function(e,i){t.exports=i()}(0,function(){return function(t){function e(n){if(i[n])return i[n].exports;var s=i[n]={exports:{},id:n,loaded:!1};return t[n].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var i={};return e.m=t,e.c=i,e.p=\"\",e(0)}([function(t,e,i){\"use strict\";var n=function(t){return t&&t.__esModule?t.default:t}(i(1));t.exports=n},function(t,e,i){\"use strict\";function n(){return k.colors}function s(){return k.context}function r(){return k.clock}var o=function(t){return t&&t.__esModule?t.default:t},a=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),h=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")};e.colors=n,e.context=s,e.clock=r,Object.defineProperty(e,\"__esModule\",{value:!0});var l=o(i(2)),u=o(i(5)),c=o(i(38)),f=o(i(40)),d=function(t){return t&&t.__esModule?t:{default:t}}(i(39)),v=i(28),p=i(41),m=i(27),b=i(26),g=i(25),y=o(i(42)),x=o(i(45)),w=function(){function t(e){h(this,t);for(var i in l)this[i]=l[i];for(var i in u)this[i]=u[i];var n={Rack:c},s={Counter:v,Radio:p,Drunk:m,Sequence:b,Matrix:g};for(var i in s)this[i]=s[i];for(var i in n)this[i]=n[i];var r=window.AudioContext||window.webkitAudioContext;this._context=e||new r,this.tune=new f,this.note=this.tune.note.bind(this.tune),this.clock=new y(this._context),this.clock.start(),this.Interval=x,this.colors={accent:\"#2bb\",fill:\"#eee\",light:\"#fff\",dark:\"#333\",mediumLight:\"#ccc\",mediumDark:\"#666\"},this.transform=d,this.add=d.add,this.Add={};for(var i in l)this.Add[i]=d.add.bind(this,i);var o=document.getElementsByTagName(\"style\"),a=document.createElement(\"style\");if(a.type=\"text/css\",a.innerHTML=\"[nexus-ui]{height:5000px;width:5000px}\",o.length>0){o[0].parentNode.insertBefore(a,o[0])}else document.write(\"<style>[nexus-ui]{height:5000px;width:5000px}</style>\")}return a(t,{context:{get:function(){return this._context},set:function(t){this.clock.stop(),this._context=t,this.clock=new y(this.context),this.clock.start()}}}),t}(),k=new w;e.default=k},function(t,e,i){\"use strict\";t.exports={Position:i(3),Slider:i(14),Toggle:i(15),Button:i(16),TextButton:i(18),RadioButton:i(19),Number:i(20),Select:i(21),Dial:i(22),Piano:i(23),Sequencer:i(24),Pan2D:i(29),Tilt:i(30),Multislider:i(31),Pan:i(33),Envelope:i(34),Spectrogram:i(35),Meter:i(36),Oscilloscope:i(37)}},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(4),h=i(6),l=i(11),u=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),c=function(t){function e(){o(this,e);var t=[\"value\"],i={size:[200,200],mode:\"absolute\",minX:0,maxX:1,stepX:0,x:.5,minY:0,maxY:1,stepY:0,y:.5};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this._x=new l(this.settings.minX,this.settings.maxX,this.settings.stepX,this.settings.x),this._y=new l(this.settings.minY,this.settings.maxY,this.settings.stepY,this.settings.y),this.position={x:new u.Handle(this.settings.mode,\"horizontal\",[0,this.width],[this.height,0]),y:new u.Handle(this.settings.mode,\"vertical\",[0,this.width],[this.height,0])},this.position.x.value=this._x.normalized,this.position.y.value=this._y.normalized,this.init(),this.render()}return r(e,t),n(e,{buildInterface:{value:function(){this.knob=a.create(\"circle\"),this.element.appendChild(this.knob)}},sizeInterface:{value:function(){this.position.x.resize([0,this.width],[this.height,0]),this.position.y.resize([0,this.width],[this.height,0]),this._minDimension=Math.min(this.width,this.height),this.knobRadius={off:5*~~(this._minDimension/100)+5},this.knobRadius.on=2*this.knobRadius.off,this.knob.setAttribute(\"cx\",this.width/2),this.knob.setAttribute(\"cy\",this.height/2),this.knob.setAttribute(\"r\",this.knobRadius.off)}},colorInterface:{value:function(){this.element.style.backgroundColor=this.colors.fill,this.knob.setAttribute(\"fill\",this.colors.accent)}},render:{value:function(){this.clicked?this.knob.setAttribute(\"r\",this.knobRadius.on):this.knob.setAttribute(\"r\",this.knobRadius.off),this.knobCoordinates={x:this._x.normalized*this.width,y:this.height-this._y.normalized*this.height},this.knob.setAttribute(\"cx\",this.knobCoordinates.x),this.knob.setAttribute(\"cy\",this.knobCoordinates.y)}},click:{value:function(){this.position.x.anchor=this.mouse,this.position.y.anchor=this.mouse,this.move()}},move:{value:function(){this.clicked&&(this.position.x.update(this.mouse),this.position.y.update(this.mouse),this._x.updateNormal(this.position.x.value),this._y.updateNormal(this.position.y.value),this.emit(\"change\",{x:this._x.value,y:this._y.value}),this.render())}},release:{value:function(){this.render()}},x:{get:function(){return this._x.value},set:function(t){this._x.update(t),this.emit(\"change\",{x:this._x.value,y:this._y.value}),this.render()}},y:{get:function(){return this._y.value},set:function(t){this._y.update(t),this.emit(\"change\",{x:this._x.value,y:this._y.value}),this.render()}},normalized:{get:function(){return{x:this._x.normalized,y:this._y.normalized}}},minX:{get:function(){return this._x.min},set:function(t){this._x.min=t,this.render()}},minY:{get:function(){return this._y.min},set:function(t){this._y.min=t,this.render()}},maxX:{get:function(){return this._x.max},set:function(t){this._x.max=t,this.render()}},maxY:{get:function(){return this._y.max},set:function(t){this._y.max=t,this.render()}},stepX:{get:function(){return this._x.step},set:function(t){this._x.step=t,this.render()}},stepY:{get:function(){return this._y.step},set:function(t){this._y.step=t,this.render()}},mode:{get:function(){return this.position.x.mode},set:function(t){this.position.x.mode=t,this.position.y.mode=t}}}),e}(h);t.exports=c},function(t,e,i){\"use strict\";var n=i(5);t.exports={create:function(t){return document.createElementNS(\"http://www.w3.org/2000/svg\",t)},arc:function(t,e,i,s,r){var o=n.toCartesian(i,r),a=n.toCartesian(i,s),h=r-s<=180?\"0\":\"1\";return[\"M\",o.x+t,o.y+e,\"A\",i,i,0,h,0,a.x+t,a.y+e].join(\" \")},radialGradient:function(t,e){var i=\"gradient\"+n.ri(1e11),s=[],r=document.createElementNS(\"http://www.w3.org/2000/svg\",\"radialGradient\");r.setAttribute(\"id\",i),r.setAttribute(\"cx\",\"50%\"),r.setAttribute(\"cy\",\"50%\"),r.setAttribute(\"r\",\"50%\"),t.appendChild(r);for(var o=0;o<e;o++){var a=document.createElementNS(\"http://www.w3.org/2000/svg\",\"stop\");a.setAttribute(\"id\",\"stop\"+o),r.appendChild(a),s.push(a)}return{id:i,stops:s,element:r}}}},function(t,e){\"use strict\";e.clip=function(t,e,i){return Math.min(Math.max(t,e),i)},e.normalize=function(t,e,i){return(t-e)/(i-e)},e.scale=function(t,e,i,n,s){return e===i?n:(t-e)*(s-n)/(i-e)+n},e.toPolar=function(t,e){var i=Math.sqrt(t*t+e*e),n=Math.atan2(e,t);return n<0&&(n+=2*Math.PI),{radius:i,angle:n}},e.toCartesian=function(t,e){return{x:t*Math.cos(e),y:t*Math.sin(e)*-1}},e.prune=function(t,e){return parseFloat(t.toFixed(e))},e.invert=function(t){return e.scale(t,1,0,0,1)},e.mtof=function(t){return 440*Math.pow(2,(t-69)/12)},e.interp=function(t,e,i){return t*(i-e)+e},e.pick=function(){return arguments[~~(Math.random()*arguments.length)]},e.octave=function(t){return Math.pow(2,t)},e.ri=function(t,e){e||(e=t,t=0);var i=Math.min(t,e),n=Math.max(t,e);return Math.floor(Math.random()*(n-i)+i)},e.rf=function(t,e){e||(e=t,t=0);var i=Math.min(t,e),n=Math.max(t,e);return Math.random()*(n-i)+i},e.cycle=function(t,e,i){return t++,t>=i&&(t=e),t},e.average=function(t){for(var e=0,i=0;i<t.length;i++)e+=t[i];return e/t.length},e.distance=function(t,e,i,n){var s=t-i,r=e-n;return Math.sqrt(s*s+r*r)},e.gainToDB=function(t){return 20*Math.log10(t)},e.coin=function(){var t=void 0===arguments[0]?.5:arguments[0];return e.rf(0,1)<t?1:0}},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(4),h=i(7),l=i(8),u=i(9),c=i(10),f=i(1).colors,d=function(t){function e(t,i,n){o(this,e),s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this),this.type=this.constructor.name,this.settings=this.parseSettings(t,i,n),this.mouse={},this.wait=!1,this.colors={};var r=f();this.colors.accent=r.accent,this.colors.fill=r.fill,this.colors.light=r.light,this.colors.dark=r.dark,this.colors.mediumLight=r.mediumLight,this.colors.mediumDark=r.mediumDark}return r(e,t),n(e,{parseSettings:{value:function(t,e,i){e.unshift(\"target\"),i.defaultSize=i.size.splice(0,2),i.size=!1;var n={target:document.body,colors:{},snapWithParent:!0,event:function(){},component:!1};for(var s in i)n[s]=i[s];for(var r=0;r<t.length;r++){var o=t[r];if(l.isObject(o))for(var s in o)n[s]=o[s];else if(\"function\"==typeof o)n.event=o;else if(e.length>=1){var s=e.splice(0,1)[0];n[s]=o}}return this.parent=h.parseElement(n.target),this.parent&&this.parent instanceof HTMLElement&&!n.component&&(this.parent.hasAttribute(\"nexus-ui\")||this.parent.setAttribute(\"nexus-ui\",\"\")),n.size&&Array.isArray(n.size)&&n.snapWithParent?(this.width=n.size[0],this.height=n.size[1],this.parent.style.width=this.width+\"px\",this.parent.style.height=this.height+\"px\"):n.snapWithParent&&!n.component?(this.width=parseFloat(window.getComputedStyle(this.parent,null).getPropertyValue(\"width\").replace(\"px\",\"\")),this.height=parseFloat(window.getComputedStyle(this.parent,null).getPropertyValue(\"height\").replace(\"px\",\"\")),5e3==this.width&&(this.width=n.defaultSize[0],this.parent.style.width=this.parent.width=this.width+\"px\"),5e3==this.height&&(this.height=n.defaultSize[1],this.parent.style.height=this.parent.height=this.height+\"px\")):(n.size=n.defaultSize,this.width=n.size[0],this.height=n.size[1]),n.event?this.event=this.on(\"change\",n.event):this.event=!1,n}},init:{value:function(){this.buildFrame(),this.buildInterface(),this.sizeInterface(),this.attachListeners(),this.colorInterface(),this.finalTouches()}},buildFrame:{value:function(){this.element=a.create(\"svg\"),this.element.setAttribute(\"width\",this.width),this.element.setAttribute(\"height\",this.height),this.parent.appendChild(this.element)}},buildInterface:{value:function(){}},sizeInterface:{value:function(){}},colorInterface:{value:function(){}},attachListeners:{value:function(){var t=this;this.interactionTarget=this.interactionTarget||this.element,u.exists&&(this.interactionTarget.addEventListener(\"touchstart\",function(e){return t.preTouch(e)}),this.interactionTarget.addEventListener(\"touchmove\",function(e){return t.preTouchMove(e)}),this.interactionTarget.addEventListener(\"touchend\",function(e){return t.preTouchRelease(e)})),this.boundPreMove=function(e){return t.preMove(e)},this.boundPreRelease=function(e){return t.preRelease(e)},this.interactionTarget.addEventListener(\"mousedown\",function(e){return t.preClick(e)})}},finalTouches:{value:function(){this.element.style.cursor=\"pointer\"}},preClick:{value:function(t){this.element instanceof HTMLElement&&(this.width=window.getComputedStyle(this.element,null).getPropertyValue(\"width\").replace(\"px\",\"\")),this.offset=h.findPosition(this.element),this.mouse=h.locateMouse(t,this.offset),this.clicked=!0,this.click(),this.moveEvent=document.addEventListener(\"mousemove\",this.boundPreMove),this.releaseEvent=document.addEventListener(\"mouseup\",this.boundPreRelease),this.emit(\"click\"),t.preventDefault(),t.stopPropagation()}},preMove:{value:function(t){var e=this;this.wait||(this.mouse=h.locateMouse(t,this.offset),this.move(),this.wait=!0,setTimeout(function(){e.wait=!1},25)),t.preventDefault(),t.stopPropagation()}},preRelease:{value:function(t){this.mouse=h.locateMouse(t,this.offset),this.clicked=!1,this.release(),this.emit(\"release\"),document.removeEventListener(\"mousemove\",this.boundPreMove),document.removeEventListener(\"mouseup\",this.boundPreRelease),t.preventDefault(),t.stopPropagation()}},click:{value:function(){}},move:{value:function(){}},release:{value:function(){}},preTouch:{value:function(t){this.element instanceof HTMLElement&&(this.width=window.getComputedStyle(this.element,null).getPropertyValue(\"width\").replace(\"px\",\"\")),this.offset=h.findPosition(this.element),this.mouse=h.locateTouch(t,this.offset),this.clicked=!0,this.touch(t),this.emit(\"click\"),t.preventDefault(),t.stopPropagation()}},preTouchMove:{value:function(t){this.clicked&&(this.mouse=h.locateTouch(t,this.offset),this.touchMove(),t.preventDefault(),t.stopPropagation())}},preTouchRelease:{value:function(t){this.mouse=h.locateTouch(t,this.offset),this.clicked=!1,this.touchRelease(),this.emit(\"release\"),t.preventDefault(),t.stopPropagation()}},touch:{value:function(){this.click()}},touchMove:{value:function(){this.move()}},touchRelease:{value:function(){this.release()}},resize:{value:function(t,e){this.width=t,this.height=e,this.parent.style.width=this.width+\"px\",this.parent.style.height=this.height+\"px\",this.element.setAttribute(\"width\",this.width),this.element.setAttribute(\"height\",this.height),this.sizeInterface()}},empty:{value:function(){for(;this.element.lastChild;)this.element.removeChild(this.element.lastChild)}},destroy:{value:function(){this.empty(),this.parent.removeChild(this.element),this.removeAllListeners(),this.instrument&&delete this.instrument[this.id],this.customDestroy()}},customDestroy:{value:function(){}},colorize:{value:function(t,e){this.colors[t]=e,this.colorInterface()}}}),e}(c);t.exports=d},function(t,e){\"use strict\";e.findPosition=function(t){var e=t.getBoundingClientRect();return{top:e.top+window.scrollY,left:e.left+window.scrollX}},e.parseElement=function(t){return\"string\"==typeof t&&(t=document.getElementById(t.replace(\"#\",\"\"))),t instanceof HTMLElement||t instanceof SVGElement?t:\"No valid parent argument\"},e.locateMouse=function(t,e){return{x:t.pageX-e.left,y:t.pageY-e.top}},e.locateTouch=function(t,e){return{x:!!t.targetTouches.length&&t.targetTouches[0].pageX-e.left,y:!!t.targetTouches.length&&t.targetTouches[0].pageY-e.top}},e.SmartCanvas=function(t){var e=this;this.element=document.createElement(\"canvas\"),this.context=this.element.getContext(\"2d\"),t.appendChild(this.element),this.resize=function(t,i){e.element.width=2*t,e.element.height=2*i,e.element.style.width=t+\"px\",e.element.style.height=i+\"px\"}}},function(t,e){\"use strict\";e.isObject=function(t){return\"object\"==typeof t&&!Array.isArray(t)&&null!==t&&t instanceof SVGElement==!1&&t instanceof HTMLElement==!1}},function(t,e){\"use strict\";e.exists=\"ontouchstart\"in document.documentElement},function(t,e){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return\"function\"==typeof t}function s(t){return\"number\"==typeof t}function r(t){return\"object\"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=i,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(t){if(!s(t)||t<0||isNaN(t))throw TypeError(\"n must be a positive number\");return this._maxListeners=t,this},i.prototype.emit=function(t){var e,i,s,a,h,l;if(this._events||(this._events={}),\"error\"===t&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified \"error\" event. ('+e+\")\");throw u.context=e,u}if(i=this._events[t],o(i))return!1;if(n(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),i.apply(this,a)}else if(r(i))for(a=Array.prototype.slice.call(arguments,1),l=i.slice(),s=l.length,h=0;h<s;h++)l[h].apply(this,a);return!0},i.prototype.addListener=function(t,e){var s;if(!n(e))throw TypeError(\"listener must be a function\");return this._events||(this._events={}),this._events.newListener&&this.emit(\"newListener\",t,n(e.listener)?e.listener:e),this._events[t]?r(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,r(this._events[t])&&!this._events[t].warned&&(s=o(this._maxListeners)?i.defaultMaxListeners:this._maxListeners)&&s>0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error(\"(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.\",this._events[t].length),\"function\"==typeof console.trace&&console.trace()),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(t,e){function i(){this.removeListener(t,i),s||(s=!0,e.apply(this,arguments))}if(!n(e))throw TypeError(\"listener must be a function\");var s=!1;return i.listener=e,this.on(t,i),this},i.prototype.removeListener=function(t,e){var i,s,o,a;if(!n(e))throw TypeError(\"listener must be a function\");if(!this._events||!this._events[t])return this;if(i=this._events[t],o=i.length,s=-1,i===e||n(i.listener)&&i.listener===e)delete this._events[t],this._events.removeListener&&this.emit(\"removeListener\",t,e);else if(r(i)){for(a=o;a-- >0;)if(i[a]===e||i[a].listener&&i[a].listener===e){s=a;break}if(s<0)return this;1===i.length?(i.length=0,delete this._events[t]):i.splice(s,1),this._events.removeListener&&this.emit(\"removeListener\",t,e)}return this},i.prototype.removeAllListeners=function(t){var e,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)\"removeListener\"!==e&&this.removeAllListeners(e);return this.removeAllListeners(\"removeListener\"),this._events={},this}if(i=this._events[t],n(i))this.removeListener(t,i);else if(i)for(;i.length;)this.removeListener(t,i[i.length-1]);return delete this._events[t],this},i.prototype.listeners=function(t){return this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},i.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},i.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},r=i(5),o=function(){function t(){var e=void 0===arguments[0]?0:arguments[0],i=void 0===arguments[1]?1:arguments[1],n=void 0===arguments[2]?0:arguments[2],r=void 0===arguments[3]?0:arguments[3];s(this,t),this.min=e,this.max=i,this.step=n,this.value=r,this.changed=!1,this.oldValue=!1,this.update(this.value)}return n(t,{update:{value:function(t){return this.step?this.value=r.clip(Math.round((t-this.min)/this.step)*this.step+this.min,this.min,this.max):this.value=r.clip(t,this.min,this.max),this.oldValue!==this.value?(this.oldValue=this.value,this.changed=!0):this.changed=!1,this.value}},updateNormal:{value:function(t){return this.value=r.scale(t,0,1,this.min,this.max),this.update(this.value)}},normalized:{get:function(){return r.normalize(this.value,this.min,this.max)}}}),t}();t.exports=o},function(t,e,i){\"use strict\";var n=function(t){return t&&t.__esModule?t.default:t},s=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")};Object.defineProperty(e,\"__esModule\",{value:!0});var o=n(i(5)),a=n(i(13));e.Handle=function(){function t(){var e=void 0===arguments[0]?\"absolute\":arguments[0],i=void 0===arguments[1]?\"vertical\":arguments[1],n=void 0===arguments[2]?[0,100]:arguments[2],s=void 0===arguments[3]?[0,100]:arguments[3];r(this,t),this.mode=e,this.direction=i,this.previous=0,this.value=0,this.sensitivity=1,this.resize(n,s)}return s(t,{resize:{value:function(t,e){this.boundary={min:{x:t[0],y:e[0]},max:{x:t[1],y:e[1]},center:{x:(t[1]-t[0])/2+t[0],y:(e[1]-e[0])/2+e[0]}}}},anchor:{set:function(t){this._anchor=this.convertPositionToValue(t)},get:function(){return this._anchor}},update:{value:function(t){if(\"relative\"===this.mode){var e=this.convertPositionToValue(t)-this.anchor;Math.abs(e)>.5&&(e=0),this.anchor=t,this.value=this.value+e*this.sensitivity}else this.value=this.convertPositionToValue(t);this.value=o.clip(this.value,0,1)}},convertPositionToValue:{value:function(t){switch(this.direction){case\"radial\":var e=o.toPolar(t.x-this.boundary.center.x,t.y-this.boundary.center.y);return e=e.angle/(2*Math.PI),e=(e-.25+1)%1;case\"vertical\":return o.scale(t.y,this.boundary.min.y,this.boundary.max.y,0,1);case\"horizontal\":return o.scale(t.x,this.boundary.min.x,this.boundary.max.x,0,1)}}}}),t}(),e.Button=function(){function t(){var e=void 0===arguments[0]?\"button\":arguments[0];r(this,t),this.mode=e,this.state=new a,this.paintbrush=!1}return s(t,{click:{value:function(){switch(this.mode){case\"impulse\":this.state.on(),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.state.off.bind(this),30),this.emit(\"change\",this.state);break;case\"button\":this.turnOn(),this.emit(\"change\",this.state);break;case\"aftertouch\":this.position={x:o.clip(this.mouse.x/this.width,0,1),y:o.clip(1-this.mouse.y/this.height,0,1)},this.turnOn(),this.emit(\"change\",{state:this.state,x:this.position.x,y:this.position.y});break;case\"toggle\":this.flip(),this.emit(\"change\",this.state)}}},move:{value:function(){\"aftertouch\"===this.mode&&(this.position={x:o.clip(this.mouse.x/this.width,0,1),y:o.clip(1-this.mouse.y/this.height,0,1)},this.emit(\"change\",{state:this.state,x:this.position.x,y:this.position.y}),this.render())}},release:{value:function(){switch(this.mode){case\"button\":this.turnOff(),this.emit(\"change\",this.state);break;case\"aftertouch\":this.turnOff(),this.position={x:this.mouse.x/this.width,y:1-this.mouse.y/this.height},this.emit(\"change\",{state:this.state,x:this.position.x,y:this.position.y})}}}}),t}()},function(t,e){\"use strict\";var i=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),n=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},s=function(){function t(e){n(this,t),this.state=e||!1}return i(t,{flip:{value:function(t){this.state=t||!1===t?t:!this.state}},on:{value:function(){this.state=!0}},off:{value:function(){this.state=!1}}}),t}();t.exports=s},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(4),h=i(6),l=i(11),u=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),c=function(t){function e(){o(this,e);var t=[\"min\",\"max\",\"value\"],i={size:[120,20],mode:\"relative\",min:0,max:1,step:0,value:0};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.orientation=\"vertical\",this._value=new l(this.settings.min,this.settings.max,this.settings.step,this.settings.value),this.position=new u.Handle(this.settings.mode,this.orientation,[0,this.width],[this.height,0]),this.position.value=this._value.normalized,this.init(),this.position.direction=this.orientation,this.emit(\"change\",this.value)}return r(e,t),n(e,{buildInterface:{value:function(){this.bar=a.create(\"rect\"),this.fillbar=a.create(\"rect\"),this.knob=a.create(\"circle\"),this.element.appendChild(this.bar),this.element.appendChild(this.fillbar),this.element.appendChild(this.knob)}},sizeInterface:{value:function(){this.width<this.height?this.orientation=\"vertical\":this.orientation=\"horizontal\",this.position&&this.position.resize([0,this.width],[this.height,0]);var t=void 0,e=void 0,i=void 0,n=void 0,s=void 0,r=void 0;this.knobData={level:0,r:0},\"vertical\"===this.orientation?(this.thickness=this.width/2,t=this.width/2,e=0,i=this.thickness,n=this.height,this.knobData.r=.8*this.thickness,this.knobData.level=n-this.knobData.r-this.normalized*(n-2*this.knobData.r),s=\"translate(\"+-1*this.thickness/2+\",0)\",r=i/2):(this.thickness=this.height/2,t=0,e=this.height/2,i=this.width,n=this.thickness,this.knobData.r=.8*this.thickness,this.knobData.level=this.normalized*(i-2*this.knobData.r)+this.knobData.r,s=\"translate(0,\"+-1*this.thickness/2+\")\",r=n/2),this.bar.setAttribute(\"x\",t),this.bar.setAttribute(\"y\",e),this.bar.setAttribute(\"transform\",s),this.bar.setAttribute(\"rx\",r),this.bar.setAttribute(\"ry\",r),this.bar.setAttribute(\"width\",i),this.bar.setAttribute(\"height\",n),\"vertical\"===this.orientation?(this.fillbar.setAttribute(\"x\",t),this.fillbar.setAttribute(\"y\",this.knobData.level),this.fillbar.setAttribute(\"width\",i),this.fillbar.setAttribute(\"height\",n-this.knobData.level)):(this.fillbar.setAttribute(\"x\",0),this.fillbar.setAttribute(\"y\",e),this.fillbar.setAttribute(\"width\",this.knobData.level),this.fillbar.setAttribute(\"height\",n)),this.fillbar.setAttribute(\"transform\",s),this.fillbar.setAttribute(\"rx\",r),this.fillbar.setAttribute(\"ry\",r),\"vertical\"===this.orientation?(this.knob.setAttribute(\"cx\",t),this.knob.setAttribute(\"cy\",this.knobData.level)):(this.knob.setAttribute(\"cx\",this.knobData.level),this.knob.setAttribute(\"cy\",e)),this.knob.setAttribute(\"r\",this.knobData.r)}},colorInterface:{value:function(){this.bar.setAttribute(\"fill\",this.colors.fill),this.fillbar.setAttribute(\"fill\",this.colors.accent),this.knob.setAttribute(\"fill\",this.colors.accent)}},render:{value:function(){this.clicked||(this.knobData.r=.75*this.thickness),this.knob.setAttribute(\"r\",this.knobData.r),\"vertical\"===this.orientation?(this.knobData.level=this.knobData.r+this._value.normalized*(this.height-2*this.knobData.r),this.knob.setAttribute(\"cy\",this.height-this.knobData.level),this.fillbar.setAttribute(\"y\",this.height-this.knobData.level),this.fillbar.setAttribute(\"height\",this.knobData.level)):(this.knobData.level=this._value.normalized*(this.width-2*this.knobData.r)+this.knobData.r,this.knob.setAttribute(\"cx\",this.knobData.level),this.fillbar.setAttribute(\"x\",0),this.fillbar.setAttribute(\"width\",this.knobData.level))}},click:{value:function(){this.knobData.r=.9*this.thickness,this.position.anchor=this.mouse,this.move()}},move:{value:function(){this.clicked&&(this.position.update(this.mouse),this._value.updateNormal(this.position.value),this.emit(\"change\",this._value.value),this.render())}},release:{value:function(){this.render()}},normalized:{get:function(){return this._value.normalized}},value:{get:function(){return this._value.value},set:function(t){this._value.update(t),this.position.value=this._value.normalized,this.emit(\"change\",this._value.value),this.render()}},min:{get:function(){return this._value.min},set:function(t){this._value.min=t}},max:{get:function(){return this._value.max},set:function(t){this._value.max=t}},step:{get:function(){return this._value.step},set:function(t){this._value.step=t}},mode:{get:function(){return this.position.mode},set:function(t){this.position.mode=t}}}),e}(h);t.exports=c},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(4),h=i(13),l=i(6),u=function(t){function e(){o(this,e);var t=[\"value\"],i={size:[40,20],target:!1,state:!1};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this._state=new h(this.settings.state),this.init()}return r(e,t),n(e,{buildInterface:{value:function(){this.bar=a.create(\"rect\"),this.knob=a.create(\"circle\"),this.element.appendChild(this.bar),this.element.appendChild(this.knob)}},sizeInterface:{value:function(){this.height<this.width/2?this.knobSize=this.height/2:this.knobSize=this.width/4,this.bar.setAttribute(\"x\",this.width/2-1.5*this.knobSize),this.bar.setAttribute(\"y\",this.height/2-this.knobSize/2),this.bar.setAttribute(\"rx\",this.knobSize/2),this.bar.setAttribute(\"ry\",this.knobSize/2),this.bar.setAttribute(\"width\",3*this.knobSize),this.bar.setAttribute(\"height\",this.knobSize),this.knob.setAttribute(\"cx\",this.width/2-this.knobSize),this.knob.setAttribute(\"cy\",this.height/2),this.knob.setAttribute(\"r\",this.knobSize)}},colorInterface:{value:function(){this.knob.setAttribute(\"fill\",this.colors.accent),this.render()}},render:{value:function(){this.state?(this.knob.setAttribute(\"cx\",this.width/2+this.knobSize),this.bar.setAttribute(\"fill\",this.colors.accent)):(this.knob.setAttribute(\"cx\",this.width/2-this.knobSize),this.bar.setAttribute(\"fill\",this.colors.fill))}},click:{value:function(){this.flip(),this.render(),this.emit(\"change\",this.state)}},state:{get:function(){return this._state.state},set:function(t){this._state.flip(t),this.emit(\"change\",this.state),this.render()}},flip:{value:function(){this._state.flip(),this.render()}}}),e}(l);t.exports=u},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(4),h=i(17),l=function(t){function e(){o(this,e);var t=[\"mode\"],i={size:[80,80],mode:\"aftertouch\",state:!1};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.mode=this.settings.mode,this.init(),this.render()}return r(e,t),n(e,{buildInterface:{value:function(){this.pad=a.create(\"circle\"),this.element.appendChild(this.pad),this.interactionTarget=this.pad,this.defs=a.create(\"defs\"),this.element.appendChild(this.defs),this.gradient=a.radialGradient(this.defs,2),this.gradient.stops[0].setAttribute(\"offset\",\"30%\"),this.gradient.stops[1].setAttribute(\"offset\",\"100%\")}},sizeInterface:{value:function(){this.pad.setAttribute(\"cx\",this.width/2),this.pad.setAttribute(\"cy\",this.height/2),this.pad.setAttribute(\"r\",Math.min(this.width,this.height)/2-this.width/40),this.pad.setAttribute(\"stroke-width\",this.width/20)}},colorInterface:{value:function(){this.gradient.stops[0].setAttribute(\"stop-color\",this.colors.accent),this.gradient.stops[1].setAttribute(\"stop-color\",this.colors.fill),this.render()}},render:{value:function(){this.state?(\"aftertouch\"===this.mode?(this.pad.setAttribute(\"stroke\",\"url(#\"+this.gradient.id+\")\"),this.gradient.element.setAttribute(\"cx\",100*this.position.x+\"%\"),this.gradient.element.setAttribute(\"cy\",100*(1-this.position.y)+\"%\")):this.pad.setAttribute(\"stroke\",this.colors.accent),this.pad.setAttribute(\"fill\",this.colors.accent)):(this.pad.setAttribute(\"fill\",this.colors.fill),this.pad.setAttribute(\"stroke\",this.colors.mediumLight))}}}),e}(h);t.exports=l},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(4),h=i(5),l=i(13),u=i(6),c=function(t){function e(t,i,n){o(this,e),s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,t,i,n),this.mode=this.settings.mode||\"button\",this.position={x:0,y:0},this._state=new l(this.settings.state)}return r(e,t),n(e,{buildInterface:{value:function(){this.pad=a.create(\"circle\"),this.pad.setAttribute(\"fill\",\"#d18\"),this.pad.setAttribute(\"stroke\",\"#d18\"),this.pad.setAttribute(\"stroke-width\",4),this.element.appendChild(this.pad),this.interactionTarget=this.pad,this.sizeInterface()}},sizeInterface:{value:function(){this.pad.setAttribute(\"cx\",this.width/2),this.pad.setAttribute(\"cy\",this.height/2),this.pad.setAttribute(\"r\",Math.min(this.width,this.height)/2-2)}},render:{value:function(){this.state?(this.pad.setAttribute(\"fill\",this.colors.accent),this.pad.setAttribute(\"stroke\",this.colors.accent)):(this.pad.setAttribute(\"fill\",this.colors.fill),this.pad.setAttribute(\"stroke\",this.colors.mediumLight))}},down:{value:function(t){switch(this.mode){case\"impulse\":this.turnOn(),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.turnOff.bind(this),30);break;case\"button\":this.turnOn();break;case\"aftertouch\":this.position={x:h.clip(this.mouse.x/this.width,0,1),y:h.clip(1-this.mouse.y/this.height,0,1)},this.turnOn();break;case\"toggle\":this.flip(t)}}},bend:{value:function(t){\"aftertouch\"===this.mode&&(this.mouse=t||this.mouse,this.position={x:h.clip(this.mouse.x/this.width,0,1),y:h.clip(1-this.mouse.y/this.height,0,1)},this.emit(\"change\",{state:this.state,x:this.position.x,y:this.position.y}),this.render())}},up:{value:function(){switch(this.mode){case\"button\":this.turnOff();break;case\"aftertouch\":this.turnOff(),this.position={x:h.clip(this.mouse.x/this.width,0,1),y:h.clip(1-this.mouse.y/this.height,0,1)}}}},click:{value:function(){this.down()}},move:{value:function(){this.bend()}},release:{value:function(){this.up()}},state:{get:function(){return this._state.state},set:function(t){this._state.flip(t),\"aftertouch\"===this.mode?this.emit(\"change\",{state:this.state,x:this.position.x,y:this.position.y}):this.emit(\"change\",this.state),this.render()}},flip:{value:function(t){this._state.flip(t),\"aftertouch\"===this.mode?this.emit(\"change\",{state:this.state,x:this.position.x,y:this.position.y}):this.emit(\"change\",this.state),this.render()}},turnOn:{value:function(t){this._state.on(),!1!==t&&(\"aftertouch\"===this.mode?this.emit(\"change\",{state:this.state,x:this.position.x,y:this.position.y}):this.emit(\"change\",this.state)),this.render()}},turnOff:{value:function(t){this._state.off(),!1!==t&&(\"aftertouch\"===this.mode?this.emit(\"change\",{state:this.state,x:this.position.x,y:this.position.y}):this.emit(\"change\",this.state)),this.render()}}}),e}(u);t.exports=c},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(17),h=function(t){function e(){o(this,e);var t=[\"value\"],i={size:[150,50],state:!1,text:\"Play\"};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this._text=this.settings.text,this.settings.alternate&&(this.settings.alternateText=this.settings.alternate,console.warn(\"'alternate' initiator is deprecated. Use 'alternateText' instead.\")),this._alternateText=this.settings.alternateText,this.mode=this.settings.alternateText?\"toggle\":\"button\",this.init(),this.render(),this.state=this.settings.state}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement(\"div\"),this.parent.appendChild(this.element),this.textElement=document.createElement(\"div\"),this.textElement.innerHTML=this._text,this.element.appendChild(this.textElement)}},buildInterface:{value:function(){}},colorInterface:{value:function(){this.element.style.color=this.colors.dark,this.render()}},sizeInterface:{value:function(){var t=this.height/3,e=this.width/(this._text.length+2);if(t=Math.min(t,e),this.alternateText){var i=this.width/(this.alternateText.length+2);t=Math.min(t,i)}var n=\"width: \"+this.width+\"px;\";n+=\"height: \"+this.height+\"px;\",n+=\"padding: \"+(this.height-t)/2+\"px 0px;\",n+=\"box-sizing: border-box;\",n+=\"text-align: center;\",n+=\"font-family: inherit;\",n+=\"font-weight: 700;\",n+=\"opacity: 1;\",n+=\"font-size:\"+t+\"px;\",this.textElement.style.cssText=n,this.render()}},render:{value:function(){this.state?(this.element.style.backgroundColor=this.colors.accent,this.textElement.style.color=this.colors.fill,this.alternateText?this.textElement.innerHTML=this._alternateText:this.textElement.innerHTML=this._text):(this.element.style.backgroundColor=this.colors.fill,this.textElement.style.color=this.colors.dark,this.textElement.innerHTML=this._text)}},alternateText:{get:function(){return this._alternateText},set:function(t){this.mode=t?\"toggle\":\"button\",this._alternateText=t,this.render()}},text:{get:function(){return this._text},set:function(t){this._text=t,this.sizeInterface(),this.render()}}}),e}(a);t.exports=h},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(6),h=i(16),l=function(t){function e(){o(this,e);var t=[\"value\"],i={size:[120,25],numberOfButtons:4,active:-1};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.buttons=[],this._numberOfButtons=this.settings.numberOfButtons,this.active=this.settings.active,this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement(\"div\"),this.parent.appendChild(this.element)}},buildInterface:{value:function(){for(var t=0;t<this._numberOfButtons;t++){var e=document.createElement(\"span\"),i=new h(e,{mode:\"toggle\",component:!0},this.update.bind(this,t));this.buttons.push(i),this.element.appendChild(e)}}},sizeInterface:{value:function(){for(var t=this.width/this._numberOfButtons,e=this.height,i=0;i<this._numberOfButtons;i++)this.buttons[i].resize(t,e)}},colorInterface:{value:function(){for(var t=0;t<this._numberOfButtons;t++)this.buttons[t].colors=this.colors,this.buttons[t].render()}},update:{value:function(t){this.buttons[t].state?this.select(t):this.deselect()}},render:{value:function(){for(var t=0;t<this.buttons.length;t++)t===this.active?this.buttons[t].turnOn(!1):this.buttons[t].turnOff(!1)}},select:{value:function(t){t>=0&&t<this.buttons.length&&(this.active=t,this.emit(\"change\",this.active),this.render())}},deselect:{value:function(){this.active=-1,this.emit(\"change\",this.active),this.render()}},numberOfButtons:{get:function(){return this._numberOfButtons},set:function(t){this._numberOfButtons=t;for(var e=0;e<this.buttons.length;e++)this.buttons[e].destroy();this.buttons=[],this.empty(),this.buildInterface()}}}),e}(a);t.exports=l},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(6),h=i(11),l=i(5),u=function(t){function e(){o(this,e);var t=[\"value\"],i={size:[60,30],value:0,min:0,max:2e4,step:1};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this._value=new h(this.settings.min,this.settings.max,this.settings.step,this.settings.value),this.decimalPlaces=2,this.actual=0,this.max=this._value.max,this.min=this._value.min,this.step=this._value.step,this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement(\"input\"),this.element.type=\"text\",this.element.addEventListener(\"blur\",function(){this.element.style.backgroundColor=this.colors.fill,this.element.style.color=this.colors.dark,this.element.value!==this.value&&(this.value=parseFloat(this.element.value),this.render())}.bind(this)),this.element.addEventListener(\"keydown\",function(t){(t.which<48||t.which>57)&&189!==t.which&&190!==t.which&&8!==t.which&&t.preventDefault(),13===t.which&&(this.element.blur(),this.value=this.element.value,this.emit(\"change\",this.value),this.render())}.bind(this)),this.parent.appendChild(this.element)}},sizeInterface:{value:function(){this._minDimension=Math.min(this.width,this.height);var t=\"width: \"+this.width+\"px;\";t+=\"height: \"+this.height+\"px;\",t+=\"background-color: #e7e7e7;\",t+=\"color: #333;\",t+=\"font-family: arial;\",t+=\"font-weight: 500;\",t+=\"font-size:\"+this._minDimension/2+\"px;\",t+=\"border: none;\",t+=\"outline: none;\",t+=\"padding: \"+this._minDimension/4+\"px \"+this._minDimension/4+\"px;\",t+=\"box-sizing: border-box;\",t+=\"userSelect: text;\",t+=\"mozUserSelect: text;\",t+=\"webkitUserSelect: text;\",this.element.style.cssText+=t,this.element.value=this.value}},colorInterface:{value:function(){this.element.style.backgroundColor=this.colors.fill,this.element.style.color=this.colors.dark}},render:{value:function(){this.element.value=l.prune(this.value,this.decimalPlaces)}},click:{value:function(){this.hasMoved=!1,this.element.readOnly=!0,this.actual=this.value,this.initial={y:this.mouse.y},this.changeFactor=l.invert(this.mouse.x/this.width),console.log(this.changeFactor)}},move:{value:function(){if(this.hasMoved=!0,this.clicked){var t=this.actual-(this.mouse.y-this.initial.y)*(l.clip(this.max-this.min,0,1e3)/200)*Math.pow(this.changeFactor,2);this.value=t,this.render(),this._value.changed&&this.emit(\"change\",this.value)}}},release:{value:function(){this.hasMoved?document.body.focus():(this.element.readOnly=!1,this.element.focus(),this.element.setSelectionRange(0,this.element.value.length),this.element.style.backgroundColor=this.colors.accent,this.element.style.color=this.colors.light)}},link:{value:function(t){var e=this;this.min=t.min,this.max=t.max,this.step=t.step,t.on(\"change\",function(t){e.passiveUpdate(t)}),this.on(\"change\",function(e){t.value=e}),this.value=t.value}},passiveUpdate:{value:function(t){this._value.update(t),this.render()}},value:{get:function(){return this._value.value},set:function(t){this._value.update(t),this.emit(\"change\",this.value),this.render()}},min:{get:function(){return this._value.min},set:function(t){this._value.min=t}},max:{get:function(){return this._value.max},set:function(t){this._value.max=t}},step:{get:function(){return this._value.step},set:function(t){this._value.step=t}}}),e}(a);t.exports=u},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(6),h=function(t){function e(){o(this,e);var t=[\"value\"],i={size:[100,30],options:[\"default\",\"options\"]};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this._selectedIndex=-1,this._value=!1,this._options=this.settings.options,this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement(\"select\"),this.element.style.fontSize=this.height/2+\"px\",this.element.style.outline=\"none\",this.element.style.highlight=\"none\",this.element.style.width=this.width+\"px\",this.element.style.height=this.height+\"px\",this.boundRender=this.render.bind(this),this.element.addEventListener(\"change\",this.boundRender),this.parent.appendChild(this.element)}},attachListeners:{value:function(){}},buildInterface:{value:function(){this.defineOptions()}},colorInterface:{value:function(){this.element.style.backgroundColor=this.colors.fill,this.element.style.color=this.colors.dark,this.element.style.border=\"solid 0px \"+this.colors.mediumLight}},render:{value:function(){this._value=this.element.options[this.element.selectedIndex].text,this._selectedIndex=this.element.selectedIndex,this.emit(\"change\",{value:this._value,index:this._selectedIndex})}},click:{value:function(){}},move:{value:function(){}},release:{value:function(){}},defineOptions:{value:function(t){t&&(this._options=t);for(var e=this.element.options.length-1;e>=0;e--)this.element.remove(e);for(var e=0;e<this._options.length;e++)this.element.options.add(new Option(this._options[e],e))}},value:{get:function(){return this._value},set:function(t){this._value=t;for(var e=0;e<this.element.options.length;e++)if(t===this.element.options[e].text){this.selectedIndex=e;break}}},selectedIndex:{get:function(){return this._selectedIndex},set:function(t){this._selectedIndex=t,this.element.selectedIndex=t,this.render()}},customDestroy:{value:function(){this.element.removeEventListener(\"change\",this.boundRender)}}}),e}(a);t.exports=h},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(4),h=i(5),l=i(6),u=i(11),c=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),f=function(t){function e(){o(this,e);var t=[\"min\",\"max\",\"value\"],i={size:[75,75],interaction:\"radial\",mode:\"relative\",min:0,max:1,step:0,value:0};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.interaction=this.settings.interaction,this._value=new u(this.settings.min,this.settings.max,this.settings.step,this.settings.value),this.position=new c.Handle(this.settings.mode,this.interaction,[0,this.width],[this.height,0]),this.init(),this.value=this._value.value,this.position.value=this._value.normalized,this.previousAngle=!1,this.emit(\"change\",this.value)}return r(e,t),n(e,{buildInterface:{value:function(){this.background=a.create(\"circle\"),this.screw=a.create(\"circle\"),this.handle=a.create(\"path\"),this.handle2=a.create(\"path\"),this.handleFill=a.create(\"path\"),this.handle2Fill=a.create(\"path\"),this.handleLine=a.create(\"path\"),this.element.appendChild(this.background),this.element.appendChild(this.handle),this.element.appendChild(this.handle2),this.element.appendChild(this.handleFill),this.element.appendChild(this.handle2Fill),this.element.appendChild(this.handleLine),this.element.appendChild(this.screw)}},sizeInterface:{value:function(){this.position.resize([0,this.width],[this.height,0]);var t={x:this.width/2,y:this.height/2},e=Math.min(this.width,this.height);this.background.setAttribute(\"cx\",t.x),this.background.setAttribute(\"cy\",t.y),this.background.setAttribute(\"r\",e/2-e/40),this.screw.setAttribute(\"cx\",t.x),this.screw.setAttribute(\"cy\",t.y),this.screw.setAttribute(\"r\",e/12);var i=this.value,n={start:1.5*Math.PI,end:h.clip(h.scale(i,0,.5,1.5*Math.PI,.5*Math.PI),.5*Math.PI,1.5*Math.PI)},s={start:2.5*Math.PI,end:h.clip(h.scale(i,.5,1,2.5*Math.PI,1.5*Math.PI),1.5*Math.PI,2.5*Math.PI)},r=a.arc(t.x,t.y,e/2-e/40,n.start,n.end),o=a.arc(t.x,t.y,e/2-e/40,s.start,s.end);this.handle.setAttribute(\"d\",r),this.handle.setAttribute(\"stroke-width\",e/20),this.handle.setAttribute(\"fill\",\"none\"),this.handle2.setAttribute(\"d\",o),this.handle2.setAttribute(\"stroke-width\",e/20),this.handle2.setAttribute(\"fill\",\"none\"),r+=\" L \"+t.x+\" \"+t.y,this.handleFill.setAttribute(\"d\",r),this.handleFill.setAttribute(\"fill-opacity\",\"0.3\"),o+=\" L \"+t.x+\" \"+t.y,this.handle2Fill.setAttribute(\"d\",o),this.handle2Fill.setAttribute(\"fill-opacity\",\"0.3\");var l=void 0;l=i<.5?n.end:s.end;var u=t.x+Math.cos(l)*(e/2),c=t.y+Math.sin(l)*(e/2)*-1;this.handleLine.setAttribute(\"d\",\"M \"+t.x+\" \"+t.y+\" L \"+u+\" \"+c),this.handleLine.setAttribute(\"stroke-width\",e/20)}},colorInterface:{value:function(){this.background.setAttribute(\"fill\",this.colors.fill),this.screw.setAttribute(\"fill\",this.colors.accent),this.handle.setAttribute(\"stroke\",this.colors.accent),this.handle2.setAttribute(\"stroke\",this.colors.accent),this.handleFill.setAttribute(\"fill\",this.colors.accent),this.handle2Fill.setAttribute(\"fill\",this.colors.accent),this.handleLine.setAttribute(\"stroke\",this.colors.accent)}},render:{value:function(){var t=this._value.normalized,e={x:this.width/2,y:this.height/2},i=Math.min(this.width,this.height),n={start:1.5*Math.PI,end:h.clip(h.scale(t,0,.5,1.5*Math.PI,.5*Math.PI),.5*Math.PI,1.5*Math.PI)},s={start:2.5*Math.PI,end:h.clip(h.scale(t,.5,1,2.5*Math.PI,1.5*Math.PI),1.5*Math.PI,2.5*Math.PI)},r=a.arc(e.x,e.y,i/2-i/40,n.start,n.end),o=a.arc(e.x,e.y,i/2-i/40,s.start,s.end);this.handle.setAttribute(\"d\",r),this.handle2.setAttribute(\"d\",o),r+=\" L \"+e.x+\" \"+e.y,this.handleFill.setAttribute(\"d\",r),o+=\" L \"+e.x+\" \"+e.y,this.handle2Fill.setAttribute(\"d\",o);var l=void 0;l=t<=.5?n.end:s.end;var u=e.x+Math.cos(l)*(i/2),c=e.y+Math.sin(l)*(i/2)*-1;this.handleLine.setAttribute(\"d\",\"M \"+e.x+\" \"+e.y+\" L \"+u+\" \"+c)}},click:{value:function(){\"relative\"===this.mode&&(this.previousAngle=!1),this.position.anchor=this.mouse,this.position.value=this._value.normalized,this.move()}},move:{value:function(){if(this.clicked){this.position.update(this.mouse);var t=this.position.value*Math.PI*2;t<0&&(t+=2*Math.PI),\"relative\"===this.mode&&!1!==this.previousAngle&&Math.abs(this.previousAngle-t)>2&&(t=this.previousAngle>3?2*Math.PI:0),this.previousAngle=t;var e=t/(2*Math.PI);this.value=this._value.updateNormal(e),\"relative\"===this.mode&&(this.position.value=e),this.emit(\"change\",this._value.value),this.render()}}},release:{value:function(){}},value:{get:function(){return this._value.value},set:function(t){this._value.update(t),this.position.value=this._value.normalized,this.emit(\"change\",this._value.value),this.render()}},min:{get:function(){return this._value.min},set:function(t){this._value.min=t}},max:{get:function(){return this._value.max},set:function(t){this._value.max=t}},step:{get:function(){return this._value.step},set:function(t){this._value.step=t}},mode:{get:function(){return this.position.mode},set:function(t){this.position.mode=t}},normalized:{get:function(){return this._value.normalized},set:function(t){this._value.updateNormal(t),this.emit(\"change\",this.value)}}}),e}(l);t.exports=f},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(4),h=i(6),l=i(17),u=i(9),c=function(t){function e(){o(this,e);var t=[\"value\",\"note\",\"color\"],i={size:[80,80],target:!1,mode:\"button\",value:0};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.note=this.settings.note,this.color=this.settings.color,this.colors={w:\"#fff\",b:\"#666\"},this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=a.create(\"svg\"),this.element.setAttribute(\"width\",this.width),this.element.setAttribute(\"height\",this.height),this.parent.appendChild(this.element)}},buildInterface:{value:function(){var t=this;this.pad=a.create(\"rect\"),this.element.appendChild(this.pad),this.interactionTarget=this.pad,u.exists||(this.click=function(){t.piano.interacting=!0,t.piano.paintbrush=!t.state,t.down(t.piano.paintbrush)},this.pad.addEventListener(\"mouseover\",function(){t.piano.interacting&&t.down(t.piano.paintbrush)}),this.move=function(){t.piano.interacting&&t.bend()},this.release=function(){t.piano.interacting=!1},this.pad.addEventListener(\"mouseup\",function(){t.piano.interacting&&t.up()}),this.pad.addEventListener(\"mouseout\",function(){t.piano.interacting&&t.up()}))}},sizeInterface:{value:function(){this.pad.setAttribute(\"x\",.5),this.pad.setAttribute(\"y\",.5),this.width>2?this.pad.setAttribute(\"width\",this.width-1):this.pad.setAttribute(\"width\",this.width),this.height,this.pad.setAttribute(\"height\",this.height),this.pad.setAttribute(\"rx\",0),this.pad.setAttribute(\"ry\",0)}},render:{value:function(){this.state?this.pad.setAttribute(\"fill\",this.colors.accent):this.pad.setAttribute(\"fill\",this.colors[this.color])}}}),e}(l),f=function(t){function e(){o(this,e);var t=[\"value\"],i={size:[500,125],lowNote:24,highNote:60,mode:\"button\"};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.keyPattern=[\"w\",\"b\",\"w\",\"b\",\"w\",\"w\",\"b\",\"w\",\"b\",\"w\",\"b\",\"w\"],this.paintbrush=!1,this.mode=this.settings.mode,this.range={low:this.settings.lowNote,high:this.settings.highNote},this.range.size=this.range.high-this.range.low,this.keys=[],this.toggleTo=!1,this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement(\"div\"),this.element.style.position=\"relative\",this.element.style.borderRadius=\"0px\",this.element.style.display=\"block\",this.element.style.width=\"100%\",this.element.style.height=\"100%\",this.parent.appendChild(this.element)}},buildInterface:{value:function(){this.keys=[];for(var t=0;t<this.range.high-this.range.low;t++){var e=document.createElement(\"span\"),i=(t+this.range.low)%this.keyPattern.length,n=new c(e,{component:!0,note:t+this.range.low,color:this.keyPattern[i],mode:this.mode},this.keyChange.bind(this,t+this.range.low));n.piano=this,u.exists&&(n.pad.index=t,n.preClick=n.preMove=n.preRelease=function(){},n.click=n.move=n.release=function(){},n.preTouch=n.preTouchMove=n.preTouchRelease=function(){},n.touch=n.touchMove=n.touchRelease=function(){}),this.keys.push(n),this.element.appendChild(e)}u.exists&&this.addTouchListeners()}},sizeInterface:{value:function(){for(var t=0,e=[],i=0;i<this.range.high-this.range.low;i++){e.push(t);var n=(i+this.range.low)%this.keyPattern.length,s=(i+1+this.range.low)%this.keyPattern.length;i+1+this.range.low>=this.range.high?t+=1:\"w\"===this.keyPattern[n]&&\"w\"===this.keyPattern[s]?t+=1:t+=.5}for(var r=t,o=(this.width-2)/r,a=(this.height-2)/2,i=0;i<this.keys.length;i++){var h=this.keys[i].parent;h.style.position=\"absolute\",h.style.left=e[i]*o+1+\"px\",\"w\"===this.keys[i].color?(h.style.top=\"1px\",this.keys[i].resize(o,2*a)):(h.style.zIndex=1,h.style.top=\"1px\",this.keys[i].resize(o,1.1*a))}}},colorInterface:{value:function(){this.element.style.backgroundColor=this.colors.mediumLight;for(var t=0;t<this.keys.length;t++)this.keys[t].colors={w:this.colors.light,b:this.colors.dark,accent:this.colors.accent,border:this.colors.mediumLight},this.keys[t].colorInterface(),this.keys[t].render()}},keyChange:{value:function(t,e){var i={note:t};i.state=\"object\"==typeof e?e.state:e,this.emit(\"change\",i)}},render:{value:function(){}},addTouchListeners:{value:function(){var t=this;this.preClick=this.preMove=this.preRelease=function(){},this.click=this.move=this.release=function(){},this.preTouch=this.preTouchMove=this.preTouchRelease=function(){},this.touch=this.touchMove=this.touchRelease=function(){},this.currentElement=!1,this.element.addEventListener(\"touchstart\",function(e){console.log(\"touchstart\");var i=document.elementFromPoint(e.targetTouches[0].clientX,e.targetTouches[0].clientY),n=t.keys[i.index];t.paintbrush=!n.state,n.down(t.paintbrush),t.currentElement=i.index,e.preventDefault(),e.stopPropagation()}),this.element.addEventListener(\"touchmove\",function(e){var i=document.elementFromPoint(e.targetTouches[0].clientX,e.targetTouches[0].clientY),n=t.keys[i.index];if(i.index!==t.currentElement){if(t.currentElement){t.keys[t.currentElement].up()}n.down(t.paintbrush)}else n.bend();t.currentElement=i.index,e.preventDefault(),e.stopPropagation()}),this.element.addEventListener(\"touchend\",function(e){t.keys[t.currentElement].up(),t.interacting=!1,t.currentElement=!1,e.preventDefault(),e.stopPropagation()})}},setRange:{value:function(t,e){this.range.low=t,this.range.high=e,this.empty(),this.buildInterface()}},toggleKey:{value:function(t,e){this.keys[t-this.range.low].flip(e)}},toggleIndex:{value:function(t,e){this.keys[t].flip(e)}}}),e}(h);t.exports=f},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(4),h=i(7),l=i(6),u=i(17),c=i(25),f=i(28),d=i(9),v=function(t){function e(){o(this,e);var t=[\"value\"],i={size:[80,80],target:!1,mode:\"toggle\",value:0};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.index=this.settings.index,this.row=this.settings.row,this.column=this.settings.column,this.matrix=this.settings.matrix,this.interacting=!1,this.paintbrush=!1,this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=a.create(\"svg\"),this.element.setAttribute(\"width\",this.width),this.element.setAttribute(\"height\",this.height),this.element.style.top=\"0px\",this.element.style.left=\"0px\",this.element.style.position=\"absolute\",this.parent.appendChild(this.element)}},buildInterface:{value:function(){var t=this;this.pad=a.create(\"rect\"),this.element.appendChild(this.pad),this.interactionTarget=this.pad,d.exists||(this.click=function(){t.matrix.interacting=!0,t.matrix.paintbrush=!t.state,t.down(t.matrix.paintbrush)},this.pad.addEventListener(\"mouseover\",function(){t.matrix.interacting&&t.down(t.matrix.paintbrush)}),this.move=function(){},this.pad.addEventListener(\"mousemove\",function(e){t.matrix.interacting&&(t.offset||(t.offset=h.findPosition(t.element)),t.mouse=h.locateMouse(e,t.offset),t.bend())}),this.release=function(){t.matrix.interacting=!1},this.pad.addEventListener(\"mouseup\",function(){t.matrix.interacting&&t.up()}),this.pad.addEventListener(\"mouseout\",function(){t.matrix.interacting&&t.up()}))}},sizeInterface:{value:function(){this.pad.setAttribute(\"x\",1),this.pad.setAttribute(\"y\",1),this.width>2?this.pad.setAttribute(\"width\",this.width-2):this.pad.setAttribute(\"width\",this.width),this.height>2?this.pad.setAttribute(\"height\",this.height-2):this.pad.setAttribute(\"height\",this.height),this.pad.setAttribute(\"fill\",this.matrix.colors.fill)}},render:{value:function(){this.state?this.pad.setAttribute(\"fill\",this.matrix.colors.accent):this.pad.setAttribute(\"fill\",this.matrix.colors.fill)}}}),e}(u),p=function(t){function e(){o(this,e);var t=[\"value\"],i={size:[400,200],mode:\"toggle\",rows:5,columns:10};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.active=-1,this.mode=this.settings.mode,this.interval=new Nexus.Interval(200,function(){},!1),this.matrix=new c(this.settings.rows,this.settings.columns),this.matrix.ui=this,this.stepper=new f(0,this.columns),this.init()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement(\"div\"),this.element.style.position=\"relative\",this.element.style.display=\"block\",this.element.style.width=\"100%\",this.element.style.height=\"100%\",this.parent.appendChild(this.element),d.exists&&this.addTouchListeners()}},buildInterface:{value:function(){this.cells=[];for(var t=0;t<this.matrix.length;t++){var e=this.matrix.locate(t),i=document.createElement(\"span\");i.style.position=\"absolute\";var n=new v(i,{component:!0,index:t,row:e.row,column:e.column,mode:this.mode,matrix:this},this.keyChange.bind(this,t));d.exists&&(n.pad.index=t,n.preClick=n.preMove=n.preRelease=function(){},n.click=n.move=n.release=function(){},n.preTouch=n.preTouchMove=n.preTouchRelease=function(){},n.touch=n.touchMove=n.touchRelease=function(){}),this.cells.push(n),this.element.appendChild(i)}this.sizeInterface()}},sizeInterface:{value:function(){for(var t=this.width/this.columns,e=this.height/this.rows,i=0;i<this.cells.length;i++){var n=this.cells[i].parent;n.style.left=this.cells[i].column*t+\"px\",n.style.top=this.cells[i].row*e+\"px\",this.cells[i].resize(t,e)}}},colorInterface:{value:function(){for(var t=0;t<this.cells.length;t++)this.cells[t].render()}},update:{value:function(){var t=this;this.matrix.iterate(function(e,i,n){t.matrix.pattern[e][i]!==t.cells[n].state&&(t.matrix.pattern[e][i]>0?t.cells[n].turnOn():t.cells[n].turnOff())})}},keyChange:{value:function(t,e){var i=this.matrix.locate(t);this.matrix.pattern[i.row][i.column]=e;var n={row:i.row,column:i.column,state:e};this.emit(\"change\",n)}},render:{value:function(){var t=this;this.stepper.value>=0&&this.matrix.iterate(function(e,i,n){i===t.stepper.value?(t.cells[n].pad.setAttribute(\"stroke\",t.colors.mediumLight),t.cells[n].pad.setAttribute(\"stroke-width\",\"1\"),t.cells[n].pad.setAttribute(\"stroke-opacity\",\"1\")):t.cells[n].pad.setAttribute(\"stroke\",\"none\")})}},start:{value:function(t){this.interval.event=this.next.bind(this),t&&this.interval.ms(t),this.interval.start()}},stop:{value:function(){this.interval.stop()}},next:{value:function(){this.stepper.next(),this.emit(\"step\",this.matrix.column(this.stepper.value).reverse()),this.render()}},addTouchListeners:{value:function(){var t=this;this.preClick=this.preMove=this.preRelease=function(){},this.click=this.move=this.release=function(){},this.preTouch=this.preTouchMove=this.preTouchRelease=function(){},this.touch=this.touchMove=this.touchRelease=function(){},this.currentElement=!1,this.element.addEventListener(\"touchstart\",function(e){var i=document.elementFromPoint(e.targetTouches[0].clientX,e.targetTouches[0].clientY),n=t.cells[i.index];t.paintbrush=!n.state,n.down(t.paintbrush),t.currentElement=i.index,e.preventDefault(),e.stopPropagation()}),this.element.addEventListener(\"touchmove\",function(e){var i=document.elementFromPoint(e.targetTouches[0].clientX,e.targetTouches[0].clientY),n=t.cells[i.index];if(i.index!==t.currentElement){if(t.currentElement>=0){t.cells[t.currentElement].up()}n.down(t.paintbrush)}else n.bend();t.currentElement=i.index,e.preventDefault(),e.stopPropagation()}),this.element.addEventListener(\"touchend\",function(e){t.cells[t.currentElement].up(),t.interacting=!1,t.currentElement=!1,e.preventDefault(),e.stopPropagation()})}},rows:{get:function(){return this.matrix.rows},set:function(t){this.matrix.rows=t,this.empty(),this.buildInterface(),this.update()}},columns:{get:function(){return this.matrix.columns},set:function(t){this.matrix.columns=t,this.stepper.max=t,this.empty(),this.buildInterface(),this.update()}}}),e}(l);t.exports=p},function(t,e,i){\"use strict\";var n=function(t){return t&&t.__esModule?t.default:t},s=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},o=n(i(5)),a=n(i(26)),h=function(){function t(e,i){var n=this;r(this,t),this.pattern=[],this.create(e,i),this.toggle={cell:function(t,e){return n.pattern[e][t]=!n.pattern[e][t],n.ui&&n.ui.update(),n.pattern[e][t]},all:function(){n.iterate(function(t,e){n.toggle.cell(e,t)}),n.ui&&n.ui.update()},row:function(t){for(var e=0;e<n.columns;e++)n.toggle.cell(e,t);n.ui&&n.ui.update()},column:function(t){for(var e=0;e<n.rows;e++)n.toggle.cell(t,e);n.ui&&n.ui.update()}},this.set={cell:function(t,e,i){n.pattern[e][t]=i,n.ui&&n.ui.update()},all:function(t){n.pattern=t,n.ui&&n.ui.update()},row:function(t,e){n.pattern[t]=e,n.ui&&n.ui.update()},column:function(t,e){n.pattern.forEach(function(i,s){n.pattern[s][t]=e[s]}),n.ui&&n.ui.update()}},this.rotate={all:function(t){t||0===t||(t=1),(t%=n.pattern[0].length)<0&&(t=n.pattern[0].length+t);for(var e=0;e<n.rows;e++){var i=n.pattern[e].splice(n.pattern[e].length-t,t);n.pattern[e]=i.concat(n.pattern[e])}n.ui&&n.ui.update()},row:function(t,e){e||0===e||(e=1),(e%=n.pattern[0].length)<0&&(e=n.pattern[0].length+e);var i=n.pattern[t].splice(n.pattern[t].length-e,e);n.pattern[t]=i.concat(n.pattern[t]),n.ui&&n.ui.update()},column:function(t,e){e||0===e||(e=1),(e%=n.pattern.length)<0&&(e=n.pattern.length+e);var i=[];n.pattern.forEach(function(e){i.push(e[t])});var s=i.splice(i.length-e,e);i=s.concat(i),n.pattern.forEach(function(e,n){e[t]=i[n]}),n.ui&&n.ui.update()}},this.populate={all:function(t){var e=new a(t);n.iterate(function(t,i){n.pattern[t][i]=o.coin(e.next())}),n.ui&&n.ui.update()},row:function(){var t=void 0===arguments[0]?0:arguments[0],e=void 0===arguments[1]?1:arguments[1],i=new a(e);n.pattern[t].forEach(function(e,s){n.pattern[t][s]=o.coin(i.next())}),n.ui&&n.ui.update()},column:function(){var t=void 0===arguments[0]?0:arguments[0],e=void 0===arguments[1]?1:arguments[1],i=new a(e);n.pattern.forEach(function(e,s){n.pattern[s][t]=o.coin(i.next())}),n.ui&&n.ui.update()}},this.erase={all:function(){n.set.all(0)},row:function(t){n.set.row(t,0)},column:function(t){n.set.column(t,0)}}}return s(t,{create:{value:function(t,e){var i=this;this.pattern=[];for(var n=0;n<t;n++){var s=new Array(e);this.pattern.push(s)}this.iterate(function(t,e){i.pattern[t][e]=!1})}},iterate:{value:function(t,e){for(var i=0,n=0;n<this.rows;n++){e&&e(n);for(var s=0;s<this.columns;s++)t(n,s,i),i++}}},formatAsText:{value:function(){var t=this,e=\"\";return this.iterate(function(i,n){e+=(t.pattern[i][n]?1:0)+\" \"},function(){e+=\"\\n\"}),e}},log:{value:function(){console.log(this.formatAsText())}},update:{value:function(t){this.pattern=t||this.pattern}},length:{get:function(){return this.rows*this.columns}},locate:{value:function(t){return{row:~~(t/this.columns),column:t%this.columns}}},indexOf:{value:function(t,e){return e+t*this.columns}},row:{value:function(t){var e=function(e){return t.apply(this,arguments)};return e.toString=function(){return t.toString()},e}(function(t){for(var e=[],i=0;i<this.columns;i++)e.push(this.pattern[t]?1:0);return e})},column:{value:function(t){var e=function(e){return t.apply(this,arguments)};return e.toString=function(){return t.toString()},e}(function(t){for(var e=[],i=0;i<this.rows;i++)e.push(this.pattern[i][t]?1:0);return e})},rows:{get:function(){return this.pattern.length},set:function(t){var e=this,i=this.pattern.slice(0);this.create(t,this.columns),this.iterate(function(t,n){i[t]&&i[t][n]&&(e.pattern[t][n]=i[t][n])})}},columns:{get:function(){return this.pattern[0].length},set:function(t){var e=this,i=this.pattern.slice(0);this.create(this.rows,t),this.iterate(function(t,n){i[t]&&i[t][n]&&(e.pattern[t][n]=i[t][n])})}}}),t}();t.exports=h},function(t,e,i){\"use strict\";var n=function(t){return t&&t.__esModule?t.default:t},s=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},o=n(i(5)),a=n(i(27)),h=function(){function t(){var e=void 0===arguments[0]?[0,10,20,30]:arguments[0],i=void 0===arguments[1]?\"up\":arguments[1],n=void 0!==arguments[2]&&arguments[2];r(this,t),this.values=e,Array.isArray(this.values)||(this.values=[this.values]),this._mode=i,this.position=n,this.drunkWalk=new a(0,this.values.length-1),this.startValues={up:0,down:this.values.length-1,drunk:~~(this.values.length/2),random:o.ri(this.values.length)},!1!==this.position?this.next=this[this._mode]:this.next=this.first}return s(t,{mode:{get:function(){return this._mode},set:function(t){if(\"up\"!==t&&\"down\"!==t&&\"random\"!==t&&\"drunk\"!==t)return void console.error(\"The only modes currently allowed are: up, down, random, drunk\");this._mode=t,this.position&&(this.next=this[this._mode])}},value:{get:function(){return this.values[this.position]},set:function(t){this.position=this.values.indexOf(t)}},first:{value:function(){return!1!==this.position?(this.next=this[this._mode],this.next()):(this.position=this.startValues[this._mode],this.next=this[this._mode],this.value)}},up:{value:function(){return this.position++,this.position%=this.values.length,this.value}},down:{value:function(){return this.position--,this.position<0&&(this.position=(this.position+this.values.length)%this.values.length),this.value}},random:{value:function(){return this.position=o.ri(0,this.values.length),this.value}},drunk:{value:function(){return this.drunkWalk.max=this.values.length,this.drunkWalk.value=this.position,this.position=this.drunkWalk.next(),this.value}}}),t}();t.exports=h},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},r=function(t){return t&&t.__esModule?t.default:t}(i(5)),o=function(){function t(){var e=void 0===arguments[0]?0:arguments[0],i=void 0===arguments[1]?9:arguments[1],n=void 0===arguments[2]?0:arguments[2],r=void 0===arguments[3]?1:arguments[3],o=void 0!==arguments[4]&&arguments[4];s(this,t),this.min=e,this.max=i,this.value=n,this.increment=r,this.loop=o}return n(t,{next:{value:function(){return this.value+=r.pick(-1*this.increment,this.increment),this.value>this.max&&(this.loop?this.value=this.min:this.value=this.max-this.increment),this.value<this.min&&(this.loop?this.value=this.max:this.value=this.min+this.increment),this.value}}}),t}();t.exports=o},function(t,e,i){\"use strict\";var n=function(t){return t&&t.__esModule?t.default:t},s=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},o=n(i(5)),a=n(i(27)),h=function(){function t(){var e=void 0===arguments[0]?0:arguments[0],i=void 0===arguments[1]?10:arguments[1],n=void 0===arguments[2]?\"up\":arguments[2],s=void 0!==arguments[3]&&arguments[3];r(this,t),this.min=e,this.max=i,this.value=s,this.mode=n,this.drunkWalk=new a(this.min,this.max),!1!==this.value?this.next=this[this._mode]:this.next=this.first}return s(t,{mode:{set:function(t){if(\"up\"!==t&&\"down\"!==t&&\"random\"!==t&&\"drunk\"!==t)return void console.error(\"The only modes currently allowed are: up, down, random, drunk\");this._mode=t,this.value&&(this.next=this[this._mode])},get:function(){return this._mode}},first:{value:function(){return!1!==this.value?(this.next=this[this._mode],this.next()):(this.startValues={up:this.min,down:this.max,drunk:~~o.average(this.min,this.max),random:o.ri(this.min,this.max)},this.value=this.startValues[this._mode],this.next=this[this._mode],this.value)}},up:{value:function(){return this.value++,this.value>=this.max&&(this.value=this.min),this.value}},down:{value:function(){return this.value--,this.value<this.min&&(this.value=this.max),this.value}},random:{value:function(){return this.value=o.ri(this.min,this.max),this.value}},drunk:{value:function(){return this.drunkWalk.min=this.min,this.drunkWalk.max=this.max,this.drunkWalk.value=this.value,this.value=this.drunkWalk.next(),this.value}}}),t}();t.exports=h},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(4),h=i(5),l=i(6),u=i(11),c=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),f=function(t){function e(){o(this,e);var t=[\"range\"],i={size:[200,200],range:.5,mode:\"absolute\",speakers:[[.5,.2],[.75,.25],[.8,.5],[.75,.75],[.5,.8],[.25,.75],[.2,.5],[.25,.25]]};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.value={x:new u(0,1,0,.5),y:new u(0,1,0,.5)},this.mode=this.settings.mode,this.position={x:new c.Handle(this.mode,\"horizontal\",[0,this.width],[this.height,0]),y:new c.Handle(this.mode,\"vertical\",[0,this.width],[this.height,0])},this.position.x.value=this.value.x.normalized,this.position.y.value=this.value.y.normalized,this.speakers=this.settings.speakers,this.range=this.settings.range,this.levels=[],this.init(),this.calculateLevels(),this.render()}return r(e,t),n(e,{buildInterface:{value:function(){this.knob=a.create(\"circle\"),this.element.appendChild(this.knob),this.speakerElements=[];for(var t=0;t<this.speakers.length;t++){var e=a.create(\"circle\");this.element.appendChild(e),this.speakerElements.push(e)}}},sizeInterface:{value:function(){this._minDimension=Math.min(this.width,this.height),this.knobRadius={off:3*~~(this._minDimension/100)+5},this.knobRadius.on=2*this.knobRadius.off,this.knob.setAttribute(\"cx\",this.width/2),this.knob.setAttribute(\"cy\",this.height/2),this.knob.setAttribute(\"r\",this.knobRadius.off);for(var t=0;t<this.speakers.length;t++){var e=this.speakerElements[t],i=this.speakers[t];e.setAttribute(\"cx\",i[0]*this.width),e.setAttribute(\"cy\",i[1]*this.height),e.setAttribute(\"r\",this._minDimension/20+5),e.setAttribute(\"fill-opacity\",\"0\")}this.position.x.resize([0,this.width],[this.height,0]),this.position.y.resize([0,this.width],[this.height,0]),this.calculateLevels(),this.render()}},colorInterface:{value:function(){this.element.style.backgroundColor=this.colors.fill,this.knob.setAttribute(\"fill\",this.colors.mediumLight);for(var t=0;t<this.speakers.length;t++){var e=this.speakerElements[t];e.setAttribute(\"fill\",this.colors.accent),e.setAttribute(\"stroke\",this.colors.accent)}}},render:{value:function(){this.knobCoordinates={x:this.value.x.normalized*this.width,y:this.height-this.value.y.normalized*this.height},this.knob.setAttribute(\"cx\",this.knobCoordinates.x),this.knob.setAttribute(\"cy\",this.knobCoordinates.y)}},click:{value:function(){this.position.x.anchor=this.mouse,this.position.y.anchor=this.mouse,this.move()}},move:{value:function(){this.clicked&&(this.position.x.update(this.mouse),this.position.y.update(this.mouse),this.calculateLevels(),this.emit(\"change\",this.levels),this.render())}},release:{value:function(){this.render()}},normalized:{get:function(){return{x:this.value.x.normalized,y:this.value.y.normalized}}},calculateLevels:{value:function(){var t=this;this.value.x.updateNormal(this.position.x.value),this.value.y.updateNormal(this.position.y.value),this.levels=[],this.speakers.forEach(function(e,i){var n=h.distance(e[0]*t.width,e[1]*t.height,t.position.x.value*t.width,(1-t.position.y.value)*t.height),s=h.clip(1-n/(t.range*t.width),0,1);t.levels.push(s),t.speakerElements[i].setAttribute(\"fill-opacity\",s)})}},moveSource:{value:function(t,e){var i={x:t*this.width,y:e*this.height};this.position.x.update(i),this.position.y.update(i),this.calculateLevels(),this.emit(\"change\",this.levels),this.render()}},moveSpeaker:{value:function(t,e,i){this.speakers[t]=[e,i],this.speakerElements[t].setAttribute(\"cx\",e*this.width),this.speakerElements[t].setAttribute(\"cy\",i*this.height),this.calculateLevels(),this.emit(\"change\",this.levels),this.render()}}}),e}(l);t.exports=f},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(5),h=i(4),l=i(6),u=function(t){function e(){o(this,e);var t=[\"value\"],i={size:[80,80]};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this._active=!0,this.init(),this.boundUpdate=this.update.bind(this),window.DeviceOrientationEvent?this.orientationListener=window.addEventListener(\"deviceorientation\",this.boundUpdate,!1):(this._active=!1,this.colorInterface())}return r(e,t),n(e,{buildInterface:{value:function(){this.title=h.create(\"text\"),this.circleX=h.create(\"circle\"),this.circleY=h.create(\"circle\"),this.circleZ=h.create(\"circle\"),this.barX=h.create(\"path\"),this.barY=h.create(\"path\"),this.barZ=h.create(\"path\"),this.barX2=h.create(\"path\"),this.barY2=h.create(\"path\"),this.barZ2=h.create(\"path\"),this.barX.setAttribute(\"opacity\",\"0.8\"),this.barY.setAttribute(\"opacity\",\"0.8\"),this.barZ.setAttribute(\"opacity\",\"0.8\"),this.barX2.setAttribute(\"opacity\",\"0.8\"),this.barY2.setAttribute(\"opacity\",\"0.8\"),this.barZ2.setAttribute(\"opacity\",\"0.8\"),this.circleX.setAttribute(\"cx\",3*this.width/12),this.circleX.setAttribute(\"cy\",3*this.height/4),this.circleX.setAttribute(\"r\",this.height/10),this.circleX.setAttribute(\"opacity\",\"0.4\"),this.circleY.setAttribute(\"cx\",6*this.width/12),this.circleY.setAttribute(\"cy\",3*this.height/4),this.circleY.setAttribute(\"r\",this.height/10),this.circleY.setAttribute(\"opacity\",\"0.4\"),this.circleZ.setAttribute(\"cx\",9*this.width/12),this.circleZ.setAttribute(\"cy\",3*this.height/4),this.circleZ.setAttribute(\"r\",this.height/10),this.circleZ.setAttribute(\"opacity\",\"0.4\"),this.barX.setAttribute(\"stroke-width\",Math.round(this.height/30)),this.barY.setAttribute(\"stroke-width\",Math.round(this.height/30)),this.barZ.setAttribute(\"stroke-width\",Math.round(this.height/30)),this.barX.setAttribute(\"fill\",\"none\"),this.barY.setAttribute(\"fill\",\"none\"),this.barZ.setAttribute(\"fill\",\"none\"),this.barX2.setAttribute(\"stroke-width\",Math.round(this.height/30)),this.barY2.setAttribute(\"stroke-width\",Math.round(this.height/30)),this.barZ2.setAttribute(\"stroke-width\",Math.round(this.height/30)),this.barX2.setAttribute(\"fill\",\"none\"),this.barY2.setAttribute(\"fill\",\"none\"),this.barZ2.setAttribute(\"fill\",\"none\"),this.title.setAttribute(\"x\",this.width/2),this.title.setAttribute(\"y\",this.height/3+7),this.title.setAttribute(\"font-size\",\"15px\"),this.title.setAttribute(\"font-weight\",\"bold\"),this.title.setAttribute(\"letter-spacing\",\"2px\"),this.title.setAttribute(\"opacity\",\"0.7\"),this.title.setAttribute(\"text-anchor\",\"middle\"),this.title.textContent=\"TILT\",this.element.appendChild(this.circleX),this.element.appendChild(this.circleY),this.element.appendChild(this.circleZ),this.element.appendChild(this.barX),this.element.appendChild(this.barY),this.element.appendChild(this.barZ),this.element.appendChild(this.barX2),this.element.appendChild(this.barY2),this.element.appendChild(this.barZ2),this.element.appendChild(this.title)}},colorInterface:{value:function(){this._active?(this.element.style.backgroundColor=this.colors.accent,this.circleX.setAttribute(\"fill\",this.colors.light),this.circleY.setAttribute(\"fill\",this.colors.light),this.circleZ.setAttribute(\"fill\",this.colors.light),this.circleX.setAttribute(\"stroke\",this.colors.light),this.circleY.setAttribute(\"stroke\",this.colors.light),this.circleZ.setAttribute(\"stroke\",this.colors.light),this.barX.setAttribute(\"stroke\",this.colors.light),this.barY.setAttribute(\"stroke\",this.colors.light),this.barZ.setAttribute(\"stroke\",this.colors.light),this.barX2.setAttribute(\"stroke\",this.colors.light),this.barY2.setAttribute(\"stroke\",this.colors.light),this.barZ2.setAttribute(\"stroke\",this.colors.light),this.title.setAttribute(\"fill\",this.colors.light)):(this.element.style.backgroundColor=this.colors.fill,this.circleX.setAttribute(\"fill\",this.colors.mediumLight),this.circleY.setAttribute(\"fill\",this.colors.mediumLight),this.circleZ.setAttribute(\"fill\",this.colors.mediumLight),this.circleX.setAttribute(\"stroke\",this.colors.mediumLight),this.circleY.setAttribute(\"stroke\",this.colors.mediumLight),this.circleZ.setAttribute(\"stroke\",this.colors.mediumLight),this.barX.setAttribute(\"stroke\",this.colors.mediumLight),this.barY.setAttribute(\"stroke\",this.colors.mediumLight),this.barZ.setAttribute(\"stroke\",this.colors.mediumLight),this.barX2.setAttribute(\"stroke\",this.colors.mediumLight),this.barY2.setAttribute(\"stroke\",this.colors.mediumLight),this.barZ2.setAttribute(\"stroke\",this.colors.mediumLight),this.title.setAttribute(\"fill\",this.colors.mediumLight))}},update:{value:function(t){if(this._active){var e=t.beta,i=t.gamma,n=t.alpha;i=a.scale(i,-90,90,0,1),e=a.scale(e,-90,90,0,1),n=a.scale(n,0,360,0,1);var s={start:1.5*Math.PI,end:a.clip(a.scale(i,0,.5,1.5*Math.PI,.5*Math.PI),.5*Math.PI,1.5*Math.PI)},r={start:2.5*Math.PI,end:a.clip(a.scale(i,.5,1,2.5*Math.PI,1.5*Math.PI),1.5*Math.PI,2.5*Math.PI)},o=h.arc(this.circleX.cx.baseVal.value,this.circleX.cy.baseVal.value,this.circleX.r.baseVal.value,s.start,s.end),l=h.arc(this.circleX.cx.baseVal.value,this.circleX.cy.baseVal.value,this.circleX.r.baseVal.value,r.start,r.end);this.barX.setAttribute(\"d\",o),this.barX2.setAttribute(\"d\",l),s={start:1.5*Math.PI,end:a.clip(a.scale(e,0,.5,1.5*Math.PI,.5*Math.PI),.5*Math.PI,1.5*Math.PI)},r={start:2.5*Math.PI,end:a.clip(a.scale(e,.5,1,2.5*Math.PI,1.5*Math.PI),1.5*Math.PI,2.5*Math.PI)},o=h.arc(this.circleY.cx.baseVal.value,this.circleY.cy.baseVal.value,this.circleY.r.baseVal.value,s.start,s.end),l=h.arc(this.circleY.cx.baseVal.value,this.circleY.cy.baseVal.value,this.circleY.r.baseVal.value,r.start,r.end),this.barY.setAttribute(\"d\",o),this.barY2.setAttribute(\"d\",l),s={start:1.5*Math.PI,end:a.clip(a.scale(n,0,.5,1.5*Math.PI,.5*Math.PI),.5*Math.PI,1.5*Math.PI)},r={start:2.5*Math.PI,end:a.clip(a.scale(n,.5,1,2.5*Math.PI,1.5*Math.PI),1.5*Math.PI,2.5*Math.PI)},o=h.arc(this.circleZ.cx.baseVal.value,this.circleZ.cy.baseVal.value,this.circleZ.r.baseVal.value,s.start,s.end),l=h.arc(this.circleZ.cx.baseVal.value,this.circleZ.cy.baseVal.value,this.circleZ.r.baseVal.value,r.start,r.end),this.barZ.setAttribute(\"d\",o),this.barZ2.setAttribute(\"d\",l),this.emit(\"change\",{x:i,y:e,z:n})}}},click:{value:function(){window.DeviceOrientationEvent&&(this.active=!this.active)}},active:{get:function(){return this._active},set:function(t){this._active=t,this.colorInterface()}},customDestroy:{value:function(){window.removeEventListener(\"deviceorientation\",this.boundUpdate,!1)}}}),e}(l);t.exports=u},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(7),h=i(5),l=i(6),u=i(32),c=i(9),f=function(t){function e(){var t=this;o(this,e);var i=[\"scale\",\"value\"],n={size:[120,20],orientation:\"vertical\",mode:\"absolute\",scale:[0,1],step:0,value:0,hasKnob:!0};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,i,n),c.exists||(this.click=function(){t.multislider.interacting=!0,t.multislider.interpolation={index:t.index,value:t.value},t.down(),t.multislider.values[t.index]=t.value},this.element.addEventListener(\"mouseover\",function(e){if(t.multislider.interacting){if(t.offset||(t.offset=a.findPosition(t.element)),t.mouse=a.locateMouse(e,t.offset),t.down(),t.multislider.values[t.index]=t.value,t.multislider.interpolation){var i=Math.abs(t.multislider.interpolation.index-t.index);if(i>1)for(var n=Math.min(t.multislider.interpolation.index,t.index),s=Math.max(t.multislider.interpolation.index,t.index),r=t.multislider.sliders[n].value,o=t.multislider.sliders[s].value,l=n;l<s;l++){t.multislider.sliders[l].value=h.interp((l-n)/i,r,o);var u=t.multislider.sliders[l].value;t.multislider.values[l]=u,t.multislider.update(l,u)}}t.multislider.interpolation={index:t.index,value:t.value}}}),this.move=function(){},this.element.addEventListener(\"mousemove\",function(e){t.multislider.interacting&&(t.offset||(t.offset=a.findPosition(t.element)),t.mouse=a.locateMouse(e,t.offset),t.slide(),t.multislider.values[t.index]=t.value)}),this.release=function(){t.multislider.interacting=!1,t.multislider.interpolation=!1},this.element.addEventListener(\"mouseup\",function(){t.multislider.interacting&&(t.up(),t.multislider.interpolation=!1,t.multislider.values[t.index]=t.value)}),this.element.addEventListener(\"mouseout\",function(){t.multislider.interacting&&(t.up(),t.multislider.values[t.index]=t.value)})),this.customStyle()}return r(e,t),n(e,{customStyle:{value:function(){this.bar.setAttribute(\"x\",0),this.bar.setAttribute(\"transform\",\"translate(0,0)\"),this.bar.setAttribute(\"rx\",0),this.bar.setAttribute(\"ry\",0),this.bar.setAttribute(\"width\",this.width),this.bar.setAttribute(\"height\",this.height),this.fillbar.setAttribute(\"x\",0),this.fillbar.setAttribute(\"transform\",\"translate(0,0)\"),this.fillbar.setAttribute(\"rx\",0),this.fillbar.setAttribute(\"ry\",0),this.fillbar.setAttribute(\"width\",this.width),this.fillbar.setAttribute(\"height\",this.height)}}}),e}(u),d=function(t){function e(){o(this,e);var t=[\"value\"],i={size:[200,100],numberOfSliders:5,min:0,max:1,step:0,values:[.7,.7,.7,.7,.7]};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this._numberOfSliders=this.settings.numberOfSliders,this.values=this.settings.values,this.sliders=[],this.interacting=!1,this.init()}return r(e,t),n(e,{buildFrame:{value:function(){this.element=document.createElement(\"div\"),this.parent.appendChild(this.element)}},buildInterface:{value:function(){var t=this.settings.min,e=this.settings.max,i=this.settings.step;this.sliders.length&&(t=this.sliders[0].min,e=this.sliders[0].max,i=this.sliders[0].step),this.sliders=[];for(var n=0;n<this._numberOfSliders;n++){var s=document.createElement(\"span\"),r=new f(s,{scale:[t,e],step:i,mode:\"absolute\",orientation:\"vertical\",value:this.values[n],hasKnob:!1,component:!0},this.update.bind(this,n));r.multislider=this,r.index=n,c.exists&&(r.bar.index=n,r.fillbar.index=n,r.preClick=r.preMove=r.preRelease=function(){},r.click=r.move=r.release=function(){},r.preTouch=r.preTouchMove=r.preTouchRelease=function(){},r.touch=r.touchMove=r.touchRelease=function(){}),this.sliders.push(r),this.element.appendChild(s)}c.exists&&this.addTouchListeners()}},colorInterface:{value:function(){for(var t=0;t<this.sliders.length;t++)this.sliders[t].colors=this.colors,this.sliders[t].colorInterface()}},sizeInterface:{value:function(){for(var t=this.width/this.sliders.length,e=this.height,i=0;i<this.sliders.length;i++)this.sliders[i].resize(t,e),this.sliders[i].customStyle()}},update:{value:function(t,e){this.emit(\"change\",{index:t,value:e})}},addTouchListeners:{value:function(){var t=this;this.preClick=this.preMove=this.preRelease=function(){},this.click=this.move=this.release=function(){},this.preTouch=this.preTouchMove=this.preTouchRelease=function(){},this.touch=this.touchMove=this.touchRelease=function(){},this.currentElement=!1,this.element.addEventListener(\"touchstart\",function(e){var i=document.elementFromPoint(e.targetTouches[0].clientX,e.targetTouches[0].clientY),n=t.sliders[i.index];n.offset||(n.offset=a.findPosition(n.element)),n.mouse=a.locateMouse(e,n.offset),n.down(),t.currentElement=i.index,e.preventDefault(),e.stopPropagation()}),this.element.addEventListener(\"touchmove\",function(e){var i=document.elementFromPoint(e.targetTouches[0].clientX,e.targetTouches[0].clientY),n=t.sliders[i.index];if(n.offset||(n.offset=a.findPosition(n.element)),n.mouse=a.locateMouse(e,n.offset),i.index!==t.currentElement){if(t.currentElement>=0){t.sliders[t.currentElement].up()}n.down()}else n.slide();t.currentElement=i.index,e.preventDefault(),e.stopPropagation()}),this.element.addEventListener(\"touchend\",function(e){t.sliders[t.currentElement].up(),t.interacting=!1,t.currentElement=!1,e.preventDefault(),e.stopPropagation()})}},numberOfSliders:{get:function(){return this.sliders.length},set:function(t){t!==this.sliders.length&&(this.sliders.forEach(function(t){t.destroy()}),this.empty(),this._numberOfSliders=t,this.buildInterface())}},min:{get:function(){return this.sliders[0].min},set:function(t){this.sliders.forEach(function(e){e.min=t})}},max:{get:function(){return this.sliders[0].max},set:function(t){this.sliders.forEach(function(e){e.max=t})}},step:{get:function(){return this.sliders[0].step},set:function(t){this.sliders.forEach(function(e){e.step=t})}},setSlider:{value:function(t,e){this.sliders[t].value=e,this.emit(\"change\",{index:t,value:e})}},setAllSliders:{value:function(t){var e=this;this.values=t,this.sliders.forEach(function(i,n){i.value=t[n%t.length],e.emit(\"change\",{index:n,value:i.value})})}}}),e}(l);t.exports=d},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(4),h=i(6),l=i(11),u=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),c=function(t){function e(t,i,n){o(this,e),s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,t,i,n),this.orientation=this.settings.orientation,this.hasKnob=this.settings.hasKnob,this._value=new l(this.settings.scale[0],this.settings.scale[1],this.settings.step,this.settings.value),this.init(),this.position=new u.Handle(this.settings.mode,this.orientation,[0,this.width],[this.height,0]),this.position.value=this._value.normalized,this.value=this._value.value,this.emit(\"change\",this.value)}return r(e,t),n(e,{buildInterface:{value:function(){this.bar=a.create(\"rect\"),this.fillbar=a.create(\"rect\"),this.knob=a.create(\"circle\"),this.element.appendChild(this.bar),this.element.appendChild(this.fillbar),this.element.appendChild(this.knob),this.sizeInterface()}},sizeInterface:{value:function(){this.settings.orientation||(this.width<this.height?this.orientation=\"vertical\":this.orientation=\"horizontal\");var t=void 0,e=void 0,i=void 0,n=void 0,s=void 0,r=void 0;this.knobData={level:0,r:0},\"vertical\"===this.orientation?(this.thickness=this.width/2,t=this.width/2,e=0,i=this.thickness,n=this.height,this.knobData.r=.8*this.thickness,this.knobData.level=n-this.normalized*n,s=\"translate(\"+-1*this.thickness/2+\",0)\",r=i/2):(this.thickness=this.height/2,t=0,e=this.height/2,i=this.width,n=this.thickness,this.knobData.r=.8*this.thickness,this.knobData.level=this.normalized*i,s=\"translate(0,\"+-1*this.thickness/2+\")\",r=n/2),this.bar.setAttribute(\"x\",t),this.bar.setAttribute(\"y\",e),this.bar.setAttribute(\"transform\",s),this.bar.setAttribute(\"rx\",r),this.bar.setAttribute(\"ry\",r),this.bar.setAttribute(\"width\",i),this.bar.setAttribute(\"height\",n),\"vertical\"===this.orientation?(this.fillbar.setAttribute(\"x\",t),this.fillbar.setAttribute(\"y\",this.knobData.level),this.fillbar.setAttribute(\"width\",i),this.fillbar.setAttribute(\"height\",n-this.knobData.level)):(this.fillbar.setAttribute(\"x\",0),this.fillbar.setAttribute(\"y\",e),this.fillbar.setAttribute(\"width\",this.knobData.level),this.fillbar.setAttribute(\"height\",n)),this.fillbar.setAttribute(\"transform\",s),this.fillbar.setAttribute(\"rx\",r),this.fillbar.setAttribute(\"ry\",r),\"vertical\"===this.orientation?(this.knob.setAttribute(\"cx\",t),this.knob.setAttribute(\"cy\",this.knobData.level)):(this.knob.setAttribute(\"cx\",this.knobData.level),this.knob.setAttribute(\"cy\",e)),this.knob.setAttribute(\"r\",this.knobData.r),this.position&&this.position.resize([0,this.width],[this.height,0])}},colorInterface:{value:function(){this.bar.setAttribute(\"fill\",this.colors.fill),this.fillbar.setAttribute(\"fill\",this.colors.accent),this.knob.setAttribute(\"fill\",this.colors.accent),this.hasKnob||this.knob.setAttribute(\"fill\",\"none\")}},render:{value:function(){this.clicked||(this.knobData.r=.75*this.thickness),this.knob.setAttribute(\"r\",this.knobData.r),\"vertical\"===this.orientation?(this.knobData.level=this._value.normalized*this.height,this.knob.setAttribute(\"cy\",this.height-this.knobData.level),this.fillbar.setAttribute(\"y\",this.height-this.knobData.level),this.fillbar.setAttribute(\"height\",this.knobData.level)):(this.knobData.level=this._value.normalized*this.width,this.knob.setAttribute(\"cx\",this.knobData.level),this.fillbar.setAttribute(\"x\",0),this.fillbar.setAttribute(\"width\",this.knobData.level))}},down:{value:function(){this.clicked=!0,this.knobData.r=.9*this.thickness,this.position.anchor=this.mouse,this.slide()}},slide:{value:function(){this.clicked&&(this.position.update(this.mouse),this.value=this._value.updateNormal(this.position.value),this.emit(\"change\",this.value))}},up:{value:function(){this.clicked=!1,this.render()}},normalized:{get:function(){return this._value.normalized}},value:{get:function(){return this._value.value},set:function(t){this._value.update(t),this.position.value=this._value.normalized,this.render()}},min:{get:function(){return this._value.min},set:function(t){this._value.min=t}},max:{get:function(){return this._value.max},set:function(t){this._value.max=t}},step:{get:function(){return this._value.step},set:function(t){this._value.step=t}},mode:{get:function(){return this.position.mode},set:function(t){this.position.mode=t}}}),e}(h);t.exports=c},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(4),h=i(5),l=i(6),u=i(11),c=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),f=function(t){function e(){o(this,e);var t=[\"scale\",\"value\"],i={size:[120,20],orientation:\"horizontal\",mode:\"relative\",scale:[-1,1],step:0,value:0,hasKnob:!0};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.orientation=this.settings.orientation,this.mode=this.settings.mode,this.hasKnob=this.settings.hasKnob,this.step=this.settings.step,this._value=new u(this.settings.scale[0],this.settings.scale[1],this.settings.step,this.settings.value),this.init(),this.position=new c.Handle(this.mode,this.orientation,[0,this.width],[this.height,0]),this.position.value=this._value.normalized,this.value=this._value.value,this.emit(\"change\",this.value)}return r(e,t),n(e,{buildInterface:{value:function(){this.bar=a.create(\"rect\"),this.knob=a.create(\"circle\"),this.element.appendChild(this.bar),this.element.appendChild(this.knob)}},sizeInterface:{value:function(){this.position&&this.position.resize([0,this.width],[this.height,0]),this.width<this.height?this.orientation=\"vertical\":this.orientation=\"horizontal\";var t=void 0,e=void 0,i=void 0,n=void 0,s=void 0,r=void 0;this.knobData={level:0,r:0},\"vertical\"===this.orientation?(this.thickness=this.width/2,t=this.width/2,e=0,i=this.thickness,n=this.height,this.knobData.r=.8*this.thickness,this.knobData.level=n-this.knobData.r-this.normalized*(n-2*this.knobData.r),s=\"translate(\"+-1*this.thickness/2+\",0)\",r=i/2):(this.thickness=this.height/2,t=0,e=this.height/2,i=this.width,n=this.thickness,this.knobData.r=.8*this.thickness,this.knobData.level=this.normalized*(i-2*this.knobData.r)+this.knobData.r,s=\"translate(0,\"+-1*this.thickness/2+\")\",r=n/2),this.bar.setAttribute(\"x\",t),this.bar.setAttribute(\"y\",e),this.bar.setAttribute(\"transform\",s),this.bar.setAttribute(\"rx\",r),this.bar.setAttribute(\"ry\",r),this.bar.setAttribute(\"width\",i),this.bar.setAttribute(\"height\",n),\"vertical\"===this.orientation?(this.knob.setAttribute(\"cx\",t),this.knob.setAttribute(\"cy\",this.knobData.level)):(this.knob.setAttribute(\"cx\",this.knobData.level),this.knob.setAttribute(\"cy\",e)),this.knob.setAttribute(\"r\",this.knobData.r)}},colorInterface:{value:function(){this.bar.setAttribute(\"fill\",this.colors.fill),this.knob.setAttribute(\"fill\",this.colors.accent),this.hasKnob||this.knob.setAttribute(\"fill\",\"transparent\")}},render:{value:function(){this.clicked||(this.knobData.r=.75*this.thickness),this.knob.setAttribute(\"r\",this.knobData.r),\"vertical\"===this.orientation?(this.knobData.level=this.knobData.r+this._value.normalized*(this.height-2*this.knobData.r),this.knob.setAttribute(\"cy\",this.height-this.knobData.level)):(this.knobData.level=this._value.normalized*(this.width-2*this.knobData.r)+this.knobData.r,this.knob.setAttribute(\"cx\",this.knobData.level))}},click:{value:function(){this.knobData.r=.9*this.thickness,this.position.anchor=this.mouse,this.move()}},move:{value:function(){this.clicked&&(this.position.update(this.mouse),this.value=this._value.updateNormal(this.position.value),this.emit(\"change\",{value:this.value,L:Math.pow(h.scale(this.value,-1,1,1,0),2),R:Math.pow(h.scale(this.value,-1,1,0,1),2)}))}},release:{value:function(){this.render()}},value:{get:function(){return this._value.value},set:function(t){this._value.update(t),this.position.value=this._value.normalized,this.emit(\"change\",{value:this.value,L:Math.pow(h.scale(this.value,-1,1,1,0),2),R:Math.pow(h.scale(this.value,-1,1,0,1),2)}),this.render()}},normalized:{get:function(){return this._value.normalized}}}),e}(l);t.exports=f},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(5),h=i(4),l=i(6),u=function(t,e){this.x=t.x,this.y=t.y,this.envelope=e,this.element=h.create(\"circle\"),this.element.setAttribute(\"fill\",this.envelope.colors.accent),this.envelope.element.appendChild(this.element),this.resize=function(){var t=2+~~(Math.min(this.envelope.width,this.envelope.height)/50);this.element.setAttribute(\"r\",t)},this.move=function(t,e){if(this.x=t||0===t?t:this.x,this.y=e||0===e?e:this.y,this.envelope.nodes.indexOf(this)>=0){var i=this.envelope.nodes.indexOf(this)-1,n=this.envelope.nodes.indexOf(this)+1,s=this.envelope.nodes[i],r=this.envelope.nodes[n],o=i>=0?s.x:0,a=n<this.envelope.nodes.length?r.x:1;this.x<o&&(this.x=o),this.x>a&&(this.x=a)}this.location=this.getCoordinates(),this.element.setAttribute(\"cx\",this.location.x),this.element.setAttribute(\"cy\",this.location.y)},this.getCoordinates=function(){return{x:this.x*this.envelope.width,y:(1-this.y)*this.envelope.height}},this.move(this.x,this.y,!0),this.resize(),this.destroy=function(){this.envelope.element.removeChild(this.element),this.envelope.nodes.splice(this.envelope.nodes.indexOf(this),1)}},c=function(t){function e(){o(this,e);var t=[\"value\"],i={size:[300,150],points:[{x:.1,y:.4},{x:.35,y:.6},{x:.65,y:.2},{x:.9,y:.4}]};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.points=this.settings.points,this.nodes=[],this.selected=!1,this.init()}return r(e,t),n(e,{buildInterface:{value:function(){var t=this;this.points.forEach(function(e){var i=new u(e,t);t.nodes.push(i)}),this.sortPoints(),this.line=h.create(\"polyline\"),this.line.setAttribute(\"stroke-width\",2),this.line.setAttribute(\"fill\",\"none\"),this.element.appendChild(this.line),this.fill=h.create(\"polyline\"),this.fill.setAttribute(\"fill-opacity\",\"0.2\"),this.element.appendChild(this.fill)}},sizeInterface:{value:function(){for(var t=0;t<this.nodes.length;t++)this.nodes[t].resize(),this.nodes[t].move();this.render()}},colorInterface:{value:function(){var t=this;this.element.style.backgroundColor=this.colors.fill,this.line.setAttribute(\"stroke\",this.colors.accent),this.fill.setAttribute(\"fill\",this.colors.accent),this.nodes.forEach(function(e){e.element.setAttribute(\"fill\",t.colors.accent)})}},render:{value:function(){this.calculatePath()}},calculatePoints:{value:function(){var t=this;this.points=[],this.nodes.forEach(function(e){t.points.push({x:e.x,y:e.y})})}},calculatePath:{value:function(){var t=\"0 \"+this.nodes[0].location.y+\", \";this.nodes.forEach(function(e){t+=e.location.x+\" \"+e.location.y+\", \"}),t+=this.width+\" \"+this.nodes[this.nodes.length-1].location.y,this.line.setAttribute(\"points\",t),t+=\", \"+this.width+\" \"+this.height+\", \",t+=\"0 \"+this.height,this.fill.setAttribute(\"points\",t)}},click:{value:function(){this.hasMoved=!1,this.selected=this.findNearestNode(),this.nodes[this.selected].move(this.mouse.x/this.width,1-this.mouse.y/this.height),this.scaleNode(this.selected),this.calculatePoints(),this.emit(\"change\",this.points),this.render()}},move:{value:function(){this.clicked&&(this.mouse.x=a.clip(this.mouse.x,0,this.width),this.hasMoved=!0,this.nodes[this.selected].move(this.mouse.x/this.width,1-this.mouse.y/this.height),this.scaleNode(this.selected),this.calculatePoints(),this.emit(\"change\",this.points),this.render())}},release:{value:function(){this.hasMoved||this.nodes[this.selected].destroy(),this.calculatePoints(),this.emit(\"change\",this.points),this.render(),this.selected=null}},findNearestNode:{value:function(){for(var t=null,e=1e4,i=this.mouse.x/this.width,n=1-this.mouse.y/this.height,s=this.nodes,r=0;r<s.length;r++){var o=Math.sqrt(Math.pow(s[r].x-i,2)+Math.pow(s[r].y-n,2));o<e&&(e=o,t=r,i>s[r].x)}return e>.07&&(t=this.getIndexFromX(this.mouse.x/this.width),this.nodes.splice(t,0,new u({x:this.mouse.x/this.width,y:1-this.mouse.y/this.height},this)),this.hasMoved=!0),t}},getIndexFromX:{value:function(t){var e=this,i=0;return this.nodes.forEach(function(n,s){e.nodes[s].x<=t&&(i=s+1)}),i}},scaleNode:{value:function(t){var e=a.clip(this.nodes[t].x,0,1),i=a.clip(this.nodes[t].y,0,1);this.nodes[t].move(e,i)}},sortPoints:{value:function(){this.nodes.sort(function(t,e){return t.x>e.x})}},addPoint:{value:function(t,e){var i=this.nodes.length;this.sortPoints();for(var n=0;n<this.nodes.length;n++)if(t<this.nodes[n].x){i=n;break}this.nodes.splice(i,0,new u({x:t,y:e},this)),this.scaleNode(i),this.calculatePoints(),this.emit(\"change\",this.points),this.render()}},scan:{value:function(t){var e=this.getIndexFromX(t),i=e-1;i<0&&(i=0),e>=this.nodes.length&&(e=this.nodes.length-1);var n=this.nodes[i],s=this.nodes[e],r=a.scale(t,n.x,s.x,0,1),o=a.interp(r,n.y,s.y);return this.emit(\"scan\",o),o}},movePoint:{value:function(t,e,i){this.nodes[t].move(e,i),this.scaleNode(t),this.calculatePoints(),this.emit(\"change\",this.points),this.render()}},adjustPoint:{value:function(t,e,i){this.nodes[t].move(this.nodes[t].x+e,this.nodes[t].y+i),this.scaleNode(t),this.calculatePoints(),this.emit(\"change\",this.points),this.render()}},destroyPoint:{value:function(t){this.nodes[t].destroy(),this.calculatePoints(),this.emit(\"change\",this.points),this.render()}},setPoints:{value:function(t){for(var e=this;this.nodes.length;)this.nodes[0].destroy();t.forEach(function(t){e.addPoint(t.x,t.y)}),this.calculatePoints(),this.emit(\"change\",this.points),this.render()}}}),e}(l);t.exports=c},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(7),h=i(6),l=i(1).context,u=function(t){function e(){o(this,e);var t=[\"scale\",\"value\"],i={size:[300,150]};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.context=l(),this.analyser=this.context.createAnalyser(),this.analyser.fftSize=2048,this.bufferLength=this.analyser.frequencyBinCount,this.dataArray=new Uint8Array(this.bufferLength),this.active=!0,this.source=!1,this.init()}return r(e,t),n(e,{buildFrame:{value:function(){this.canvas=new a.SmartCanvas(this.parent),this.element=this.canvas.element}},sizeInterface:{value:function(){this.canvas.resize(this.width,this.height)}},colorInterface:{value:function(){this.canvas.element.style.backgroundColor=this.colors.fill}},render:{value:function(){if(this.active&&requestAnimationFrame(this.render.bind(this)),this.analyser.getByteFrequencyData(this.dataArray),this.canvas.context.fillStyle=this.colors.fill,this.canvas.context.fillRect(0,0,this.canvas.element.width,this.canvas.element.height),this.source&&this.dataArray)for(var t=this.canvas.element.width/this.bufferLength,e=void 0,i=0,n=this.canvas.element.width/50,s=0;s<this.bufferLength;s+=n)e=Math.max.apply(null,this.dataArray.subarray(s,s+n)),e/=255,e*=this.canvas.element.height,this.canvas.context.fillStyle=this.colors.accent,this.canvas.context.fillRect(i,this.canvas.element.height-e,t*n,e),i+=t*n}},connect:{value:function(t){this.source&&this.disconnect(),this.source=t,this.source.connect(this.analyser),this.render()}},disconnect:{value:function(){this.source.disconnect(this.analyser),this.source=null}},click:{value:function(){this.active=!this.active,this.render()}},customDestroy:{value:function(){this.active=!1}}}),e}(h);t.exports=u},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(7),h=i(5),l=i(6),u=i(1).context,c=function(t){function e(){o(this,e);var t=[\"scale\",\"value\"],i={size:[30,100]};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.context=u(),this.channels=2,this.splitter=this.context.createChannelSplitter(this.channels),this.analysers=[];for(var n=0;n<this.channels;n++){var r=this.context.createAnalyser();this.splitter.connect(r,n),r.fftSize=1024,r.smoothingTimeConstant=1,this.analysers.push(r)}this.bufferLength=this.analysers[0].frequencyBinCount,this.dataArray=new Float32Array(this.bufferLength),this.active=!0,this.db=-1/0,this.init(),this.meterWidth=this.canvas.element.width/this.channels,this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.canvas=new a.SmartCanvas(this.parent),this.element=this.canvas.element}},sizeInterface:{value:function(){this.canvas.resize(this.width,this.height)}},colorInterface:{value:function(){this.canvas.element.style.backgroundColor=this.colors.fill}},render:{value:function(){this.active&&requestAnimationFrame(this.render.bind(this)),this.canvas.context.fillStyle=this.colors.fill,this.canvas.context.fillRect(0,0,this.canvas.element.width,this.canvas.element.height);for(var t=0;t<this.analysers.length;t++){if(this.source){this.analysers[t].getFloatTimeDomainData(this.dataArray);for(var e=0,i=0;i<this.dataArray.length;i++)e+=this.dataArray[i]*this.dataArray[i];e=Math.sqrt(e/this.dataArray.length),this.db=20*Math.log10(e)}else this.db>-200&&this.db!==-1/0?this.db-=1:this.db=-1/0;if(this.db>-70){var n=h.normalize(this.db,-70,5),s=n*n,r=h.scale(s,0,1,this.element.height,0);this.canvas.context.fillStyle=this.colors.accent,this.canvas.context.fillRect(this.meterWidth*t,r,this.meterWidth,this.canvas.element.height-r)}}}},connect:{value:function(t,e){this.source&&this.disconnect(),e?this.channels=e:t.channelCount?this.channels=t.channelCount:this.channels=2,this.meterWidth=this.canvas.element.width/this.channels,this.source=t,this.source.connect(this.splitter)}},disconnect:{value:function(){this.source.disconnect(this.splitter),this.source=!1,this.meterWidth=this.canvas.element.width/this.channels}},click:{value:function(){this.active=!this.active,this.render()}},customDestroy:{value:function(){this.active=!1}}}),e}(l);t.exports=c},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function t(e,i,n){var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,n)}if(\"value\"in s&&s.writable)return s.value;var o=s.get;if(void 0!==o)return o.call(n)},r=function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},a=i(7),h=i(6),l=i(1).context,u=function(t){function e(){o(this,e);var t=[\"scale\",\"value\"],i={size:[300,150]};s(Object.getPrototypeOf(e.prototype),\"constructor\",this).call(this,arguments,t,i),this.context=l(),this.analyser=this.context.createAnalyser(),this.analyser.fftSize=2048,this.bufferLength=this.analyser.frequencyBinCount,this.dataArray=new Uint8Array(this.bufferLength),this.analyser.getByteTimeDomainData(this.dataArray),this.active=!0,this.source=!1,this.init(),this.render()}return r(e,t),n(e,{buildFrame:{value:function(){this.canvas=new a.SmartCanvas(this.parent),this.element=this.canvas.element}},sizeInterface:{value:function(){this.canvas.resize(this.width,this.height)}},colorInterface:{value:function(){this.canvas.element.style.backgroundColor=this.colors.fill}},render:{value:function(){if(this.active&&requestAnimationFrame(this.render.bind(this)),this.analyser.getByteTimeDomainData(this.dataArray),this.canvas.context.fillStyle=this.colors.fill,this.canvas.context.fillRect(0,0,this.canvas.element.width,this.canvas.element.height),this.canvas.context.lineWidth=~~(this.height/100+2),this.canvas.context.strokeStyle=this.colors.accent,this.canvas.context.beginPath(),this.source)for(var t=1*this.canvas.element.width/this.bufferLength,e=0,i=0;i<this.bufferLength;i++){var n=this.dataArray[i]/128,s=n*this.canvas.element.height/2;0===i?this.canvas.context.moveTo(e,s):this.canvas.context.lineTo(e,s),e+=t}else this.canvas.context.moveTo(0,this.canvas.element.height/2),this.canvas.context.lineTo(this.canvas.element.width,this.canvas.element.height/2);this.canvas.context.stroke()}},connect:{value:function(t){this.source&&this.disconnect(),this.source=t,this.source.connect(this.analyser),this.render()}},disconnect:{value:function(){this.source&&(this.source.disconnect(this.analyser),this.source=null)}},click:{value:function(){this.active=!this.active,this.render()}},customDestroy:{value:function(){this.active=!1}}}),e}(h);t.exports=u},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},r=function(t){return t&&t.__esModule?t:{default:t}}(i(39)),o=function(t){return t&&t.__esModule?t.default:t}(i(7)),a=i(1).colors,h=function(){function t(e,i){s(this,t),this.meta={},this.meta.target=e,this.meta.parent=o.parseElement(e),this.meta.colors={},i?(this.meta.attribute=i.attribute||\"nexus-ui\",this.meta.title=i.name||!1,this.meta.open=i.open||!1):(this.meta.attribute=\"nexus-ui\",this.meta.title=!1,this.meta.open=!1);var n=a();this.meta.colors.accent=n.accent,this.meta.colors.fill=n.fill,this.meta.colors.light=n.light,this.meta.colors.dark=n.dark,this.meta.colors.mediumLight=n.mediumLight,this.meta.colors.mediumDark=n.mediumDark,this.buildInterface(),this.colorInterface()}return n(t,{buildInterface:{value:function(){var t=this;for(this.meta.parent.style.boxSizing=\"border-box\",this.meta.parent.style.userSelect=\"none\",this.meta.parent.style.mozUserSelect=\"none\",this.meta.parent.style.webkitUserSelect=\"none\",this.meta.contents=document.createElement(\"div\");this.meta.parent.childNodes.length>0;)this.meta.contents.appendChild(this.meta.parent.childNodes[0]);this.meta.contents.style.padding=\"0px\",this.meta.contents.style.boxSizing=\"border-box\",this.meta.title&&(this.meta.titleBar=document.createElement(\"div\"),this.meta.titleBar.innerHTML=this.meta.title,this.meta.titleBar.style.fontFamily=\"arial\",this.meta.titleBar.style.position=\"relative\",this.meta.titleBar.style.color=\"#888\",this.meta.titleBar.style.padding=\"7px\",this.meta.titleBar.style.fontSize=\"12px\",this.meta.button=document.createElement(\"div\"),this.meta.button.style.position=\"absolute\",this.meta.button.style.top=\"5px\",this.meta.button.style.right=\"5px\",this.meta.button.innerHTML=\"-\",this.meta.button.style.padding=\"0px 5px 2px\",this.meta.button.style.lineHeight=\"12px\",this.meta.button.style.fontSize=\"15px\",this.meta.button.style.cursor=\"pointer\",this.meta.button.addEventListener(\"mouseover\",function(){t.meta.button.style.backgroundColor=t.meta.colors.mediumDark}),this.meta.button.addEventListener(\"mouseleave\",function(){t.meta.button.style.backgroundColor=t.meta.colors.mediumLight}),this.meta.button.addEventListener(\"click\",function(){t.meta.open?t.hide():t.show()}),this.meta.titleBar.appendChild(this.meta.button),this.meta.parent.appendChild(this.meta.titleBar)),this.meta.parent.appendChild(this.meta.contents);var e=r.section(this.meta.target,this.meta.attribute);for(var i in e)this[i]=e[i]}},colorInterface:{value:function(){this.meta.title&&(this.meta.button.style.backgroundColor=this.meta.colors.mediumLight,this.meta.button.style.border=\"solid 0px \"+this.meta.colors.fill,this.meta.parent.style.border=\"solid 1px \"+this.meta.colors.mediumLight,this.meta.parent.style.backgroundColor=this.meta.colors.light,this.meta.titleBar.style.backgroundColor=this.meta.colors.fill)}},show:{value:function(){this.meta.contents.style.display=\"block\",this.meta.open=!0}},hide:{value:function(){this.meta.contents.style.display=\"none\",this.meta.open=!1}},colorize:{value:function(t,e){for(var i in this)this[i].colorize&&this[i].colorize(t,e);this.meta.colors[t]=e,this.colorInterface()}},empty:{value:function(){for(var t in this)this[t].destroy&&this[t].destroy()}}}),t}();t.exports=h},function(t,e,i){\"use strict\";var n=function(t){return t&&t.__esModule?t.default:t};Object.defineProperty(e,\"__esModule\",{value:!0});var s=n(i(7)),r=n(i(2)),o=function(t,e){var i=t.type;return e[i]?e[i]++:e[i]=1,i+e[i]},a=function(t,e,i){i=i||{};for(var n=0;n<t.attributes.length;n++){var s=t.attributes[n];i[s.nodeName]=s.nodeValue}e=e[0].toUpperCase()+e.slice(1);var o=new r[e](t,i);return o.id=t.id,o},h=function(t,e){e=e||\"nexus-ui\";for(var i={},n=s.parseElement(t),h={},l=n.getElementsByTagName(\"*\"),u=[],c=0;c<l.length;c++)u.push(l[c]);for(var c=0;c<u.length;c++){var f=u[c].getAttribute(e);if(f){var d=!1;for(var v in r)f.toLowerCase()===v.toLowerCase()&&(d=v);console.log(d);var p=a(u[c],d);if(p.id)h[p.id]=p;else{h[o(p,i)]=p}}}return h},l=function(t,e,i){var n=document.createElement(\"div\");return i=i||{},e=e?s.parseElement(e):document.body,e.appendChild(n),i.target=n,i.size&&(n.style.width=i.size[0]+\"px\",n.style.height=i.size[1]+\"px\"),a(n,t,i)};e.element=a,e.section=h,e.add=l},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},r=function(t){return t&&t.__esModule?t.default:t}(i(5)),o=function(){function t(){s(this,t),this.scale=[],this.mode={output:\"frequency\",input:\"step\"},this.etmajor=[261.62558,293.664764,329.627563,349.228241,391.995422,440,493.883301,523.25116],this.root=r.mtof(60),this.createScale(0,2,4,5,7,9,11)}return n(t,{note:{value:function(t,e){return\"frequency\"===this.mode.output?this.frequency(t,e):\"ratio\"===this.mode.output?this.ratio(t,e):\"MIDI\"===this.mode.output?this.MIDI(t,e):this.frequency(t,e)}},frequency:{value:function(t,e){\"midi\"!==this.mode.input&&\"MIDI\"!==this.mode.input||(this.stepIn+=60);var i=Math.floor(t/this.scale.length);e&&(i+=e);for(var n=t%this.scale.length;n<0;)n+=this.scale.length;var s=this.scale[n],r=this.root*s;return r*=Math.pow(2,i),r=Math.floor(1e11*r)/1e11}},ratio:{value:function(t,e){\"midi\"!==this.mode.input&&\"MIDI\"!==this.mode.input||(this.stepIn+=60);var i=Math.floor(t/this.scale.length);e&&(i+=e);var n=t%this.scale.length,s=Math.pow(2,i)*this.scale[n];return s=Math.floor(1e11*s)/1e11,s}},MIDI:{value:function(t,e){var i=this.frequency(t,e),n=69+12*Math.log(i/440)/Math.log(2);return n=Math.floor(1e9*n)/1e9}},createScale:{value:function(){for(var t=[],e=0;e<arguments.length;e++)t.push(r.mtof(60+arguments[e]));this.loadScaleFromFrequencies(t)}},createJIScale:{value:function(){this.scale=[];for(var t=0;t<arguments.length;t++)this.scale.push(arguments[t])}},loadScaleFromFrequencies:{value:function(t){this.scale=[];for(var e=0;e<t.length-1;e++)this.scale.push(t[e]/t[0])}},loadScale:{value:function(t){var e=this.scales[t].frequencies;this.loadScaleFromFrequencies(e)}},search:{value:function(t){var e=[];for(var i in this.scales)-1!==i.toLowerCase().indexOf(t.toLowerCase())&&e.push(i);return e}},chord:{value:function(t){for(var e=[],i=0;i<t.length;i++)e.push(this.note(t[i]));return e}}}),t}();t.exports=o},function(t,e){\"use strict\";var i=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),n=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},s=function(){function t(){for(var e=arguments.length,i=Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];var r=void 0===arguments[0]?3:arguments[0];n(this,t),r<0&&(r=1),this.length=r,this.onVals=i,this.array=new Array(r).fill(0),i.length>0&&this.on.apply(this,i)}return i(t,{select:{value:function(t){return this.array.fill(0),this.array[t]=1,this.array}},flip:{value:function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];var n=this.array;return e.length>0?e.forEach(function(t){t>n.length-1?console.warn(\"Warning: AnonRadio[\"+t+\"] does not exist\"):n[t]=n[t]?0:1}):n.forEach(function(t,e,i){i[e]=t?0:1}),n}},on:{value:function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];var n=this.array;return e.length>0?e.forEach(function(t){t>n.length-1?console.warn(\"Warning: AnonRadio[\"+t+\"] exceeds size of object\"):(1===n[t]&&console.warn(\"Warning: AnonRadio[\"+t+\"] was already on.\"),n[t]=1)}):n.fill(1),n}},off:{value:function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];var n=this.array;return e.length>0?e.forEach(function(t){n[t]=0}):n.fill(0),n}}}),t}();t.exports=s},function(t,e,i){var n=i(43);t.exports=n,\"undefined\"!=typeof window&&(window.WAAClock=n)},function(t,e,i){(function(e){var i={toleranceLate:.1,toleranceEarly:.001},n=function(t,e,i){this.clock=t,this.func=i,this._cleared=!1,this.toleranceLate=t.toleranceLate,this.toleranceEarly=t.toleranceEarly,this._latestTime=null,this._earliestTime=null,this.deadline=null,this.repeatTime=null,this.schedule(e)};n.prototype.clear=function(){return this.clock._removeEvent(this),this._cleared=!0,this},n.prototype.repeat=function(t){if(0===t)throw new Error(\"delay cannot be 0\");return this.repeatTime=t,this.clock._hasEvent(this)||this.schedule(this.deadline+this.repeatTime),this},n.prototype.tolerance=function(t){return\"number\"==typeof t.late&&(this.toleranceLate=t.late),\"number\"==typeof t.early&&(this.toleranceEarly=t.early),this._refreshEarlyLateDates(),this.clock._hasEvent(this)&&(this.clock._removeEvent(this),this.clock._insertEvent(this)),this},n.prototype.isRepeated=function(){return null!==this.repeatTime},n.prototype.schedule=function(t){this._cleared=!1,this.deadline=t,this._refreshEarlyLateDates(),this.clock.context.currentTime>=this._earliestTime?this._execute():this.clock._hasEvent(this)?(this.clock._removeEvent(this),this.clock._insertEvent(this)):this.clock._insertEvent(this)},n.prototype.timeStretch=function(t,e){this.isRepeated()&&(this.repeatTime=this.repeatTime*e);var i=t+e*(this.deadline-t);if(this.isRepeated())for(;this.clock.context.currentTime>=i-this.toleranceEarly;)i+=this.repeatTime;this.schedule(i)},n.prototype._execute=function(){!1!==this.clock._started&&(this.clock._removeEvent(this),this.clock.context.currentTime<this._latestTime?this.func(this):(this.onexpired&&this.onexpired(this),console.warn(\"event expired\")),this.clock._hasEvent(this)||!this.isRepeated()||this._cleared||this.schedule(this.deadline+this.repeatTime))},n.prototype._refreshEarlyLateDates=function(){this._latestTime=this.deadline+this.toleranceLate,this._earliestTime=this.deadline-this.toleranceEarly};var s=t.exports=function(t,e){e=e||{},this.tickMethod=e.tickMethod||\"ScriptProcessorNode\",this.toleranceEarly=e.toleranceEarly||i.toleranceEarly,this.toleranceLate=e.toleranceLate||i.toleranceLate,this.context=t,this._events=[],this._started=!1};s.prototype.setTimeout=function(t,e){return this._createEvent(t,this._absTime(e))},s.prototype.callbackAtTime=function(t,e){return this._createEvent(t,e)},s.prototype.timeStretch=function(t,e,i){return e.forEach(function(e){e.timeStretch(t,i)}),e},s.prototype.start=function(){if(!1===this._started){var t=this;if(this._started=!0,this._events=[],\"ScriptProcessorNode\"===this.tickMethod){this._clockNode=this.context.createScriptProcessor(256,1,1),this._clockNode.connect(this.context.destination),this._clockNode.onaudioprocess=function(){e.nextTick(function(){t._tick()})}}else if(\"manual\"!==this.tickMethod)throw new Error(\"invalid tickMethod \"+this.tickMethod)}},s.prototype.stop=function(){!0===this._started&&(this._started=!1,this._clockNode.disconnect())},s.prototype._tick=function(){for(var t=this._events.shift();t&&t._earliestTime<=this.context.currentTime;)t._execute(),t=this._events.shift();t&&this._events.unshift(t)},s.prototype._createEvent=function(t,e){return new n(this,e,t)},s.prototype._insertEvent=function(t){this._events.splice(this._indexByTime(t._earliestTime),0,t)},s.prototype._removeEvent=function(t){var e=this._events.indexOf(t);-1!==e&&this._events.splice(e,1)},s.prototype._hasEvent=function(t){return-1!==this._events.indexOf(t)},s.prototype._indexByTime=function(t){for(var e,i=0,n=this._events.length;i<n;)e=Math.floor((i+n)/2),this._events[e]._earliestTime<t?i=e+1:n=e;return i},s.prototype._absTime=function(t){return t+this.context.currentTime},s.prototype._relTime=function(t){return t-this.context.currentTime}}).call(e,i(44))},function(t,e){function i(){throw new Error(\"setTimeout has not been defined\")}function n(){throw new Error(\"clearTimeout has not been defined\")}function s(t){if(u===setTimeout)return setTimeout(t,0);if((u===i||!u)&&setTimeout)return u=setTimeout,setTimeout(t,0);try{return u(t,0)}catch(e){try{return u.call(null,t,0)}catch(e){return u.call(this,t,0)}}}function r(t){if(c===clearTimeout)return clearTimeout(t);if((c===n||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(t);try{return c(t)}catch(e){try{return c.call(null,t)}catch(e){return c.call(this,t)}}}function o(){p&&d&&(p=!1,d.length?v=d.concat(v):m=-1,v.length&&a())}function a(){if(!p){var t=s(o);p=!0;for(var e=v.length;e;){for(d=v,v=[];++m<e;)d&&d[m].run();m=-1,e=v.length}d=null,p=!1,r(t)}}function h(t,e){this.fun=t,this.array=e}function l(){}var u,c,f=t.exports={};!function(){try{u=\"function\"==typeof setTimeout?setTimeout:i}catch(t){u=i}try{c=\"function\"==typeof clearTimeout?clearTimeout:n}catch(t){c=n}}();var d,v=[],p=!1,m=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];v.push(new h(t,e)),1!==v.length||p||s(a)},h.prototype.run=function(){this.fun.apply(null,this.array)},f.title=\"browser\",f.browser=!0,f.env={},f.argv=[],f.version=\"\",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(t){return[]},f.binding=function(t){throw new Error(\"process.binding is not supported\")},f.cwd=function(){return\"/\"},f.chdir=function(t){throw new Error(\"process.chdir is not supported\")},f.umask=function(){return 0}},function(t,e,i){\"use strict\";var n=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")},r=i(1).clock,o=function(){function t(e,i,n){s(this,t),this.rate=e,this.on=n,this.clock=r(),this.pattern=[1],this.index=0,this.event=i||function(){},this.on&&this.start()}return n(t,{_event:{value:function(t){this.event(t),this.index++}},stop:{value:function(){this.on=!1,this.interval.clear()}},start:{value:function(){this.on=!0,this.interval=this.clock.callbackAtTime(this._event.bind(this),this.clock.context.currentTime).repeat(this.rate/1e3).tolerance({early:.1,late:1})}},ms:{value:function(t){if(this.on){var e=t/this.rate;this.rate=t,this.clock.timeStretch(this.clock.context.currentTime,[this.interval],e)}else this.rate=t}}}),t}();t.exports=o}])})},function(t,e,i){\"use strict\";function n(t){if(t.altKey||t.ctrlKey||t.metaKey)return void t.stopPropagation();if(document.activeElement instanceof HTMLInputElement&&t.keyCode in o)return void t.stopPropagation();if(t.keyCode in r){var e=r[t.keyCode];t.shiftKey&&(e+=a.length),e-=7,h(e)}}function s(t){h=t}Object.defineProperty(e,\"__esModule\",{value:!0});var r={},o={},a=\"zxcvbnmasdfghjklqwertyuiop\",h=function(){};a.toUpperCase().split(\"\").map(function(t,e){r[t.charCodeAt(0)]=e}),\"1234567890\".split(\"\").map(function(t,e){r[t.charCodeAt(0)]=e+a.length,o[t.charCodeAt(0)]=!0}),window.addEventListener(\"keydown\",n,!0),e.default={listen:s}},function(t,e,i){\"use strict\";function n(t){return t[Math.floor(Math.random()*t.length)]}function s(t){return Math.floor(Math.random()*t)}function r(t,e){return t-e*Math.floor(t/e)}function o(t,e,i){return(t-e)/(i-e)}function a(t){t=t.slice(0);for(var e=t.length;e>0;e--){var i=s(e),n=t[e-1];t[e-1]=t[i],t[i]=n}return t}function h(t){if(_){var e=document.createElement(\"div\"),i=document.createElement(\"div\");i.innerHTML=\"Tap to start - please unmute your phone\",Object.assign(e.style,{position:\"absolute\",width:\"100%\",height:\"100%\",zIndex:\"10000\",top:\"0px\",left:\"0px\",backgroundColor:\"rgba(0, 0, 0, 0.8)\"}),Object.assign(i.style,{position:\"absolute\",left:\"50%\",top:\"50%\",padding:\"20px\",backgroundColor:\"#7F33ED\",color:\"white\",fontFamily:\"monospace\",borderRadius:\"3px\",transform:\"translate3D(-50%,-50%,0)\",textAlign:\"center\",lineHeight:\"1.5\"}),e.appendChild(i),document.body.appendChild(e),StartAudioContext.setContext(Tone.context),StartAudioContext.on(i),StartAudioContext.onStarted(function(i){e.remove(),t()})}else t()}function l(t){for(var e=atob(t.split(\",\")[1]),i=t.split(\",\")[0].split(\":\")[1].split(\";\")[0],n=new ArrayBuffer(e.length),s=new Uint8Array(n),r=0;r<e.length;r++)s[r]=e.charCodeAt(r);return new Blob([n],{type:i})}function u(t){return 69+12*Math.log2(t/440)}function c(t){return 440*Math.pow(2,(t-69)/12)}function f(t){return function(e){E.isMobile?t():e.press&&t()}}function d(t,e,i,n){var s=document.querySelector(e+\" + .val\"),r=function(t){s.innerHTML=i?parseInt(t):t.toFixed(2),n&&n(t)};t.on(\"change\",r),s.innerHTML=i?parseInt(t.value):t.value.toFixed(2),t.update=r}function v(t,e,i,n){var s=t.active,r=document.querySelector(e+\" + .val\"),o=function(e){-1===e?e=t.active=s:s=e,r.innerHTML=i[e][1],n&&n(e)};t.on(\"change\",o),o(t.active),t.update=o}function p(t,e,i){Object.keys(e).forEach(function(i){var n=e[i],s=document.createElement(\"option\");s.innerHTML=n.name,s.value=i,t.appendChild(s)}),t.addEventListener(\"input\",function(t){i(t.target.value)})}function m(t,e,i,n,s,r){var o=document.createElement(\"div\");o.classList.add(\"block\");var a=document.createElement(\"div\");a.setAttribute(\"id\",e);var h=document.createElement(\"span\");h.classList.add(\"val\");var l=document.createElement(\"label\");l.innerHTML=i,o.appendChild(l),o.appendChild(a),o.appendChild(h),t.appendChild(o),n.size=[200,24];var u=new y.default.Slider(\"#\"+e,n);return d(u,\"#\"+e,s,r),u}function b(t,e,i){var n=document.createElement(\"div\");n.classList.add(\"stat\");var s=document.createElement(\"div\");s.classList.add(\"key\");var r=document.createElement(\"div\");r.classList.add(\"val\"),n.appendChild(s),n.appendChild(r),t.appendChild(n),s.innerHTML=e,r.innerHTML=i();var o=void 0;return function(){var t=i();o!==t&&(r.innerText=o=t)}}Object.defineProperty(e,\"__esModule\",{value:!0}),e.Statistic=e.Slider=e.build_options=e.update_radio_value_on_change=e.update_value_on_change=e.dataURItoBlob=e.tap=e.mtof=e.ftom=e.requestAudioContext=e.browser=e.randint=e.shuffle=e.choice=e.norm=e.mod=void 0;var g=i(0),y=function(t){return t&&t.__esModule?t:{default:t}}(g),x=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i),w=navigator.userAgent.match(/iPad/i),k=navigator.userAgent.match(/Android/i),_=x||w||k,A=!_;document.body.classList.add(_?\"mobile\":\"desktop\");var E={isIphone:x,isIpad:w,isMobile:_,isDesktop:A};e.mod=r,e.norm=o,e.choice=n,e.shuffle=a,e.randint=s,e.browser=E,e.requestAudioContext=h,e.ftom=u,e.mtof=c,e.tap=f,e.dataURItoBlob=l,e.update_value_on_change=d,e.update_radio_value_on_change=v,e.build_options=p,e.Slider=m,e.Statistic=b},function(t,e,i){\"use strict\";function n(t){return t&&t.__esModule?t:{default:t}}function s(){if(J=setTimeout(s,L.Rate.value),!W){Q+=1;var t=L.T.value;(0,T.shuffle)(V).forEach(function(e){if(e.J>1)return void(e.J-=1);var i=_(e);1===e.J&&(q[e.y][e.x]||(e.J=0,q[e.y][e.x]=e,e.log.push(\"left jail\"))),e.team===z?a(e,i):(r(e,i),Z.update(e,i,t))}),Z.id===D.SIM_GENOCIDE&&(V=V.filter(function(t){return!t.dead})),v()}}function r(t,e){t.CAv=o(e),t.G=t.H*(1-L.L.value),t.P=1-Math.exp(-L.k.value*t.CAv),t.NetR=t.R*t.P*Math.pow(L.J.value,L.alpha.value),t.GN=t.G-t.NetR}function o(t){var e=0,i=1;return t.forEach(function(t){t.team!==S&&(t.team===z?e+=1:i+=1)}),e/i}function a(t,e){e.some(function(t){return!(t.team===z||!t.active)&&(h(t),!0)}),f(t,e)}function h(t){t.J=(0,T.randint)(L.J.value),t.active=!1,q[t.y][t.x]=null,t.log.push(\"sent to jail\")}function l(t,e){t.dead=!0,t.Age=0,q[t.y][t.x]=null,t.log.push(e)}function u(t,e){e.some(function(e){if(e.team===S){var i=e.y,n=e.x;return q[i][n]=c(i,n,t),t.log.push(\"gave birth\"),!0}return!1})}function c(t,e,i){if(!(V.length>=L.Size.value*L.Size.value)){var n={id:U++,team:i?i.team:(0,T.randint)(Z.teams)+1,H:i?i.H:Math.random(),R:Math.random(),J:0,Age:(0,T.randint)(L.MaxAge.value)+1,active:!1,G:0,CAv:0,P:0,NetR:0,GN:0,log:[],y:t,x:e};return V.push(n),n}}function f(t,e){t.dead||t.J||e.some(function(e){if(e.team===S){var i=e.y,n=e.x;return q[t.y][t.x]=null,q[i][n]=t,t.y=i,t.x=n,!0}return!1})}function d(t){var e=void 0,i=void 0,n=void 0,s=void 0;return\"GN\"===G?(e=t[G],i=t.active?0:180,n=1-e,s=1-e):(e=t[G],i=t.active?0:100,n=1,s=1-2*e),\"hsl(\"+[0|i,(100*n|0)+\"%\",(100*s|0)+\"%\"].join(\",\")+\")\"}function v(){var t=L.Size.value;I.clearRect(0,0,(t+1)*Y*2,t*Y),x(function(e,i){var n=q[e][i];n?n.team===z?(I.fillStyle=\"#000000\",I.fillRect((i+t+1)*Y,e*Y,Y-B,Y-B),I.fillRect(i*Y,e*Y,Y-B,Y-B)):(I.save(),n===K&&(I.strokeStyle=\"#000\",I.strokeRect((i+t+1)*Y,e*Y,Y,Y),I.strokeRect(i*Y,e*Y,Y,Y)),I.fillStyle=d(n),I.fillRect((i+t+1)*Y,e*Y,Y-B,Y-B),I.fillStyle=Z.color(n),I.fillRect(i*Y,e*Y,Y-B,Y-B),I.save()):(I.fillStyle=\"#ffffff\",I.fillRect((i+t+1)*Y,e*Y,Y-B,Y-B),I.fillRect(i*Y,e*Y,Y-B,Y-B))}),H.forEach(function(t){return t()}),K.dead&&p()}function p(){var t=void 0;do{t=(0,T.choice)(V)}while(t.dead||t.team===z);K=t}function m(){V=[],q=[],U=0,Q=0;var t=L.Pop.value,e=L.Cops.value;q=x(function(e,i){return Math.random()<t?c(e,i):null});for(var i=0,n=V.length*e;i<n;i++)V[(0,T.randint)(V.length)].team=z;p(V),$={old_age:0,in_jail:0,murder:0}}function b(){w(),g()}function g(){clearTimeout(J),m(),s()}function y(){(W=!W)||(clearTimeout(J),s())}function x(t){for(var e=[],i=L.Size.value,n=0;n<i;n++){e[n]=[];for(var s=0;s<i;s++)e[n][s]=t(n,s,0)}return e}function w(){L.Size&&(C.width=(L.Size.value+1)*Y*2,C.height=L.Size.value*Y)}function k(t,e){var i=L.Size.value;return t=(0,T.mod)(t,i),e=(0,T.mod)(e,i),q[t][e]||{y:t,x:e,team:S}}function _(t){var e=t.y,i=t.x;return(0,T.shuffle)(F.map(function(t){return k(e+t[0],i+t[1])}))}function A(t){Z=N[t],console.log(Z.name),m()}function E(t){G=t,console.log(\"viewing\",t+\":\",X[t].name)}function P(t){return t?\"Yes\":\"No\"}var O=i(0),M=(n(O),i(1)),T=(n(M),i(2)),C=document.querySelector(\"canvas\"),I=C.getContext(\"2d\"),L=window.nx={},z=0,S=-1,D={SIM_REBELLION:0,SIM_GENOCIDE:1},j=[\"#000000\",\"#008000\",\"#000080\",\"#008080\",\"#00ff80\",\"#0080ff\"],R=[\"#000000\",\"#800000\",\"#800080\",\"#808080\",\"#80ff80\",\"#8080ff\"],F=[[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]],N={rebellion:{id:D.SIM_REBELLION,name:\"Civil Violence Model I: Generalized Rebellion Against Central Authority\",teams:1,update:function(t,e,i){if(!(t.J>0)){var n=t.GN>i;n&&!t.active?t.log.push(\"went active\"):!n&&t.active&&t.log.push(\"went inactive\"),t.active=n,f(t,e)}},color:function(t){return t.active?R[t.team]:j[t.team]}},genocide:{id:D.SIM_GENOCIDE,name:\"Civil Violence Model II: Inter-Group Violence\",teams:2,update:function(t,e,i){if(!t.dead){if(t.Age--<=0)return void(t.J>0?(l(t,\"died in jail\"),$.in_jail+=1):(l(t,\"died of old age\"),$.old_age+=1));t.GN>i&&e.some(function(e){return e.team!==S&&e.team!==z&&e.team!==t.team&&(l(e,\"died of murder\"),t.active=!0,t.log.push(\"killed someone\"),$.murder+=1,!0)}),Math.random()<L.Rep.value&&u(t,e),f(t,e)}},color:function(t){return j[t.team]}}},X={G:{value:\"G\",name:\"Grievance\"},CAv:{value:\"CAv\",name:\"Cop-to-Active ratio\"},P:{value:\"P\",name:\"Arrest probability\"},NetR:{value:\"NetR\",name:\"Net risk of being arrested\"},GN:{value:\"GN\",name:\"Distance from threshold\"}},Y=10,B=1,V=[],q=[],H=[],Z=N.rebellion,G=\"G\",W=!1,J=void 0,U=0,K=void 0,Q=0,$={};!function(){(0,T.build_options)(document.querySelector(\"#sim\"),N,A),(0,T.build_options)(document.querySelector(\"#view\"),X,E);var t=document.querySelector(\"#options\");L.Size=(0,T.Slider)(t,\"world_size\",\"World size\",{min:10,max:200,step:1,value:40},!0,b),L.Rate=(0,T.Slider)(t,\"rate\",\"Frame rate\",{min:10,max:1e3,step:10,value:200},!0,m),L.L=(0,T.Slider)(t,\"governmental_legitimacy\",\"Governmental legitimacy\",{min:0,max:1,step:.01,value:.9},!1),L.T=(0,T.Slider)(t,\"activation_threshold\",\"Grievance threshold\",{min:0,max:1,step:.01,value:.1},!1),L.Rep=(0,T.Slider)(t,\"birth_rate\",\"Birth rate\",{min:0,max:1,step:.001,value:.05},!1),L.MaxAge=(0,T.Slider)(t,\"max_age\",\"Max age\",{min:0,max:1e3,step:1,value:200},!0),L.J=(0,T.Slider)(t,\"max_jail_term\",\"Maximum jail term\",{min:1,max:100,step:1,value:30},!0),L.alpha=(0,T.Slider)(t,\"jail_deterrent\",\"Jail deterrent\",{min:0,max:2,step:.01,value:0},!1),L.k=(0,T.Slider)(t,\"arrest_constant\",\"Arrest probability constant\",{min:1,max:10,step:.01,value:2.3},!1),L.Pop=(0,T.Slider)(t,\"population_density\",\"Population density\",{min:0,max:1,step:.01,value:.7},!1,g),L.Cops=(0,T.Slider)(t,\"cop_density\",\"Cop density\",{min:0,max:.1,step:.002,value:.05},!1,g);var e=document.querySelector(\"#stats\"),i=document.querySelector(\"#log\");H=[(0,T.Statistic)(e,\"Time\",function(){return Q}),(0,T.Statistic)(e,\"Agents\",function(){return V.length}),(0,T.Statistic)(e,\"Cops\",function(){return V.filter(function(t){return t.team===z}).length}),(0,T.Statistic)(e,\"Team #1\",function(){return V.filter(function(t){return 1===t.team}).length}),(0,T.Statistic)(e,\"Team #2\",function(){return V.filter(function(t){return 2===t.team}).length}),(0,T.Statistic)(e,\"Quiescent\",function(){return V.filter(function(t){return!t.active}).length}),(0,T.Statistic)(e,\"Active\",function(){return V.filter(function(t){return t.active}).length}),(0,T.Statistic)(e,\"Jailed\",function(){return V.filter(function(t){return t.J>0}).length}),(0,T.Statistic)(e,\"Died of old age\",function(){return $.old_age}),(0,T.Statistic)(e,\"Died in jail\",function(){return $.in_jail}),(0,T.Statistic)(e,\"Murder rate\",function(){return $.murder}),(0,T.Statistic)(e,\"~ ~ ~\",function(){return\"\"}),(0,T.Statistic)(e,\"Selected Agent #\",function(){return K&&K.id}),(0,T.Statistic)(e,\"Position\",function(){return K&&K.x+\",\"+K.y}),(0,T.Statistic)(e,\"Hardship\",function(){return K&&K.H.toFixed(2)}),(0,T.Statistic)(e,\"Risk tolerance\",function(){return K&&K.R.toFixed(2)}),(0,T.Statistic)(e,\"Grievance\",function(){return K&&K.G.toFixed(2)}),(0,T.Statistic)(e,\"Score\",function(){return K&&K.GN.toFixed(2)}),(0,T.Statistic)(e,\"Cop / Active ratio\",function(){return K&&K.CAv.toFixed(2)}),(0,T.Statistic)(e,\"Arrest probability\",function(){return K&&K.P.toFixed(2)}),(0,T.Statistic)(e,\"Net risk\",function(){return K&&K.NetR.toFixed(2)}),(0,T.Statistic)(e,\"Active\",function(){return K&&P(K.active)}),(0,T.Statistic)(e,\"Age\",function(){return K&&K.Age}),(0,T.Statistic)(e,\"In Jail?\",function(){return K&&P(K.J)}),(0,T.Statistic)(e,\"Dead?\",function(){return K&&P(K.dead)}),(0,T.Statistic)(e,\"Jail term\",function(){return K&&(K.J?K.J:\"\")}),(0,T.Statistic)(i,\"Log\",function(){return K&&K.log.join(\"\\n\")})],document.querySelector(\"button#restart\").addEventListener(\"click\",g),document.querySelector(\"button#pause\").addEventListener(\"click\",y),document.querySelector(\"button#observe\").addEventListener(\"click\",function(){p()}),document.querySelector(\".loading\").classList.remove(\"loading\"),w(),g()}()}]);\n\n\n// WEBPACK FOOTER //\n// ./bundle.js"],"mappings":"AAAA","sourceRoot":""} \ No newline at end of file
diff --git a/client/index.js b/client/index.js
new file mode 100644
index 0000000..644b1ea
--- /dev/null
+++ b/client/index.js
@@ -0,0 +1,511 @@
+import Nexus from 'nexusui'
+import keys from './lib/keys'
+import {
+ requestAudioContext,
+ choice, shuffle, mod, randint, norm, dataURItoBlob,
+ update_value_on_change, update_radio_value_on_change, build_options,
+ Slider, Statistic
+} from './lib/util'
+
+const canvas = document.querySelector('canvas')
+const ctx = canvas.getContext('2d')
+const nx = window.nx = {}
+
+const COP_TEAM = 0, EMPTY_CELL = -1
+const types = { SIM_REBELLION: 0, SIM_GENOCIDE: 1 }
+
+const inactive_colors = [
+ '#000000', // cops
+ '#008000', // team 1
+ '#000080', // team 2
+ '#008080', // team 3
+ '#00ff80', // team 4
+ '#0080ff', // team 5
+]
+const active_colors = [
+ '#000000',
+ '#800000', // team 1
+ '#800080', // team 2
+ '#808080', // team 3
+ '#80ff80', // team 4
+ '#8080ff', // team 5
+]
+
+const neighbor_idxs = [
+ [-1, -1],
+ [-1, 0],
+ [-1, 1],
+ [0, -1],
+ [0, 1],
+ [1, -1],
+ [1, 0],
+ [1, 1],
+]
+const simulations = {
+ rebellion: {
+ id: types.SIM_REBELLION,
+ name: 'Civil Violence Model I: Generalized Rebellion Against Central Authority',
+ teams: 1,
+ update: (agent, N, T) => {
+ if (agent.J > 0) return
+ const is_active = agent.GN > T
+ if (is_active && !agent.active) {
+ agent.log.push('went active')
+ } else if (!is_active && agent.active) {
+ agent.log.push('went inactive')
+ }
+ agent.active = is_active
+ move(agent, N)
+ },
+ color: (agent) => {
+ return agent.active ? active_colors[agent.team] : inactive_colors[agent.team]
+ },
+ },
+ genocide: {
+ id: types.SIM_GENOCIDE,
+ name: 'Civil Violence Model II: Inter-Group Violence',
+ teams: 2,
+ update: (agent, N, T) => {
+ if (agent.dead) return
+ if (agent.Age-- <= 0) {
+ if (agent.J > 0) {
+ kill(agent, 'died in jail')
+ died.in_jail += 1
+ } else {
+ kill(agent, 'died of old age')
+ died.old_age += 1
+ }
+ return
+ }
+ agent.GN > T && N.some(n => {
+ if (n.team !== EMPTY_CELL && n.team !== COP_TEAM && n.team !== agent.team) {
+ kill(n, 'died of murder')
+ agent.active = true
+ agent.log.push('killed someone')
+ died.murder += 1
+ return true
+ }
+ return false
+ })
+ if (Math.random() < nx.Rep.value) {
+ birth(agent, N)
+ }
+ move(agent, N)
+ },
+ color: (agent) => {
+ return inactive_colors[agent.team]
+ },
+ }
+}
+const views = {
+ G: {
+ value: 'G',
+ name: 'Grievance',
+ },
+ CAv: {
+ value: 'CAv',
+ name: 'Cop-to-Active ratio'
+ },
+ P: {
+ value: 'P',
+ name: 'Arrest probability',
+ },
+ NetR: {
+ value: 'NetR',
+ name: 'Net risk of being arrested',
+ },
+ GN: {
+ value: 'GN',
+ name: 'Distance from threshold',
+ }
+}
+
+const Px = 10
+const Margin = 1
+
+let agents = []
+let board = []
+let stats = []
+let sim = simulations.rebellion
+let view = 'G'
+let paused = false
+let stepTimeout
+let agent_id = 0
+let selected_agent
+let time = 0
+let died = {}
+
+function step(){
+ stepTimeout = setTimeout(step, nx.Rate.value)
+ if (paused) return
+ time += 1
+ const T = nx.T.value
+ shuffle(agents).forEach(agent => {
+ if (agent.J > 1) {
+ agent.J -= 1
+ return
+ }
+ const N = neighbors(agent)
+ if (agent.J === 1) {
+ // check to see if we can get out of jail (if our previous square was free)
+ if (!board[agent.y][agent.x]) {
+ agent.J = 0
+ board[agent.y][agent.x] = agent
+ agent.log.push('left jail')
+ }
+ }
+ if (agent.team === COP_TEAM) {
+ update_cop(agent, N)
+ } else {
+ calculate_net_risk(agent, N)
+ sim.update(agent, N, T)
+ }
+ })
+ if (sim.id === types.SIM_GENOCIDE) {
+ agents = agents.filter(agent => !agent.dead)
+ }
+ draw()
+}
+function calculate_net_risk(agent, N) {
+ agent.CAv = get_cav(N)
+ // grievance equals hardship times illegitimacy
+ agent.G = agent.H * (1 - nx.L.value)
+ // arrest probability is logarithmically proportional to number of cops/active nearby
+ agent.P = 1 - Math.exp(-nx.k.value * agent.CAv)
+ // net risk of being arrested equals agent's risk aversion times arrest probability
+ agent.NetR = agent.R * agent.P * Math.pow(nx.J.value, nx.alpha.value)
+ // if G - NetR is above the threshold, go active
+ agent.GN = agent.G - agent.NetR
+}
+function get_cav(N){
+ let C = 0, A = 1
+ N.forEach(n => {
+ if (n.team === EMPTY_CELL) return
+ if (n.team === COP_TEAM) {
+ C += 1
+ } else {
+ A += 1
+ }
+ })
+ return C / A
+}
+
+function update_cop(agent, N){
+ N.some(n => {
+ if (n.team !== COP_TEAM && n.active) {
+ jail(n)
+ return true
+ }
+ return false
+ })
+ move(agent, N)
+}
+function jail(agent){
+ agent.J = randint(nx.J.value)
+ agent.active = false
+ board[agent.y][agent.x] = null
+ agent.log.push('sent to jail')
+}
+function kill(agent, cause_of_death){
+ agent.dead = true
+ agent.Age = 0
+ board[agent.y][agent.x] = null
+ agent.log.push(cause_of_death)
+}
+function birth(agent, N){
+ N.some(n => {
+ if (n.team === EMPTY_CELL) {
+ let { y, x } = n
+ board[y][x] = add_agent(y, x, agent)
+ agent.log.push('gave birth')
+ return true
+ }
+ return false
+ })
+}
+function add_agent(y, x, a){
+ if (agents.length >= nx.Size.value * nx.Size.value) return
+ const agent = {
+ id: agent_id++,
+ team: a ? a.team : randint(sim.teams) + 1,
+ H: a ? a.H : Math.random(),
+ R: Math.random(),
+ J: 0,
+ Age: randint(nx.MaxAge.value) + 1,
+ active: false,
+ G: 0, CAv: 0, P: 0, NetR: 0, GN: 0,
+ log: [],
+ y, x,
+ }
+ agents.push(agent)
+ return agent
+}
+function move(agent, N){
+ if (agent.dead || agent.J) return
+ N.some(n => {
+ if (n.team === EMPTY_CELL) {
+ let { y, x } = n
+ board[agent.y][agent.x] = null
+ board[y][x] = agent
+ agent.y = y
+ agent.x = x
+ return true
+ }
+ return false
+ })
+}
+function view_color(agent){
+ let x, H, S, L
+ if (view === 'GN') {
+ x = agent[view]
+ H = agent.active ? 0 : 180
+ S = 1-x
+ L = 1-x
+ }
+ else {
+ x = agent[view]
+ H = agent.active ? 0 : 100
+ S = 1
+ L = 1-x * 2
+ }
+ const color = 'hsl(' + [
+ ((H)|0),
+ ((S * 100)|0) + '%',
+ ((L * 100)|0) + '%',
+ ].join(',') + ')'
+ return color
+}
+function draw(){
+ const Size = nx.Size.value
+ ctx.clearRect(0, 0, (Size + 1) * Px * 2, Size * Px)
+ stride((y, x) => {
+ const agent = board[y][x]
+ if (! agent) {
+ ctx.fillStyle = '#ffffff'
+ ctx.fillRect((x + Size + 1) * Px, y * Px, Px - Margin, Px - Margin)
+ ctx.fillRect(x * Px, y * Px, Px - Margin, Px - Margin)
+ } else if (agent.team === COP_TEAM) {
+ ctx.fillStyle = '#000000'
+ ctx.fillRect((x + Size + 1) * Px, y * Px, Px - Margin, Px - Margin)
+ ctx.fillRect(x * Px, y * Px, Px - Margin, Px - Margin)
+ } else {
+ ctx.save()
+ if (agent === selected_agent) {
+ ctx.strokeStyle = '#000'
+ ctx.strokeRect((x + Size + 1) * Px, y * Px, Px, Px)
+ ctx.strokeRect(x * Px, y * Px, Px, Px)
+ }
+ ctx.fillStyle = view_color(agent)
+ ctx.fillRect((x + Size + 1) * Px, y * Px, Px - Margin, Px - Margin)
+ ctx.fillStyle = sim.color(agent)
+ ctx.fillRect(x * Px, y * Px, Px - Margin, Px - Margin)
+ ctx.save()
+ }
+ })
+ stats.forEach(stat => stat())
+ if (selected_agent.dead) {
+ observe_random_agent()
+ }
+}
+function observe_random_agent(){
+ let agent
+ do {
+ agent = choice(agents)
+ } while (agent.dead || agent.team === COP_TEAM)
+ selected_agent = agent
+}
+function reset(){
+ agents = []
+ board = []
+ agent_id = 0
+ time = 0
+ const Pop = nx.Pop.value
+ const Cops = nx.Cops.value
+ board = stride((y, x) => {
+ if (Math.random() < Pop) {
+ return add_agent(y, x)
+ }
+ return null
+ })
+ for (let i = 0, len = agents.length * Cops; i < len; i++) {
+ agents[randint(agents.length)].team = COP_TEAM
+ }
+ observe_random_agent(agents)
+ died = { old_age: 0, in_jail: 0, murder: 0 }
+}
+function restart(){
+ rescale()
+ play()
+}
+function play(){
+ clearTimeout(stepTimeout)
+ reset()
+ step()
+}
+function pause(){
+ paused = !paused
+ if (!paused) {
+ clearTimeout(stepTimeout)
+ step()
+ }
+}
+function stride(fn){
+ let A = []
+ let Size = nx.Size.value
+ let i = 0
+ for (let y = 0; y < Size; y++) {
+ A[y] = []
+ for (let x = 0; x < Size; x++) {
+ A[y][x] = fn(y, x, i)
+ }
+ }
+ return A
+}
+function rescale(){
+ if (! nx.Size) return
+ canvas.width = (nx.Size.value + 1) * Px * 2
+ canvas.height = nx.Size.value * Px
+}
+function get(y, x){
+ const Size = nx.Size.value
+ y = mod(y, Size)
+ x = mod(x, Size)
+ return board[y][x] || { y, x, team: EMPTY_CELL }
+}
+function neighbors(agent){
+ const { y, x } = agent
+ return shuffle(neighbor_idxs.map(pair => get(y + pair[0], x + pair[1])))
+}
+function pick_simulation(new_sim){
+ sim = simulations[new_sim]
+ // console.log(new_sim, sim)
+ console.log(sim.name)
+ reset()
+}
+function pick_view(new_view){
+ view = new_view
+ console.log('viewing', new_view + ':', views[new_view].name)
+}
+
+function build() {
+ build_options(document.querySelector('#sim'), simulations, pick_simulation)
+ build_options(document.querySelector('#view'), views, pick_view)
+
+ const parent = document.querySelector('#options')
+
+ nx.Size = Slider(parent, 'world_size', 'World size', {
+ min: 10,
+ max: 200,
+ step: 1,
+ value: 40,
+ }, true, restart)
+ nx.Rate = Slider(parent, 'rate', 'Frame rate', {
+ min: 10,
+ max: 1000,
+ step: 10,
+ value: 200,
+ }, true, reset)
+ nx.L = Slider(parent, 'governmental_legitimacy', 'Governmental legitimacy', {
+ min: 0,
+ max: 1,
+ step: 0.01,
+ value: 0.9,
+ }, false)
+ nx.T = Slider(parent, 'activation_threshold', 'Grievance threshold', {
+ min: 0,
+ max: 1,
+ step: 0.01,
+ value: 0.1,
+ }, false)
+ nx.Rep = Slider(parent, 'birth_rate', 'Birth rate', {
+ min: 0,
+ max: 1,
+ step: 0.001,
+ value: 0.05,
+ }, false)
+ nx.MaxAge = Slider(parent, 'max_age', 'Max age', {
+ min: 0,
+ max: 1000,
+ step: 1,
+ value: 200,
+ }, true)
+ nx.J = Slider(parent, 'max_jail_term', 'Maximum jail term', {
+ min: 1,
+ max: 100,
+ step: 1,
+ value: 30,
+ }, true)
+ nx.alpha = Slider(parent, 'jail_deterrent', 'Jail deterrent', {
+ min: 0,
+ max: 2,
+ step: 0.01,
+ value: 0,
+ }, false)
+ nx.k = Slider(parent, 'arrest_constant', 'Arrest probability constant', {
+ min: 1,
+ max: 10,
+ step: 0.01,
+ value: 2.3,
+ }, false)
+ nx.Pop = Slider(parent, 'population_density', 'Population density', {
+ min: 0,
+ max: 1,
+ step: 0.01,
+ value: 0.7
+ }, false, play)
+ nx.Cops = Slider(parent, 'cop_density', 'Cop density', {
+ min: 0,
+ max: 0.1,
+ step: 0.002,
+ value: 0.05
+ }, false, play)
+
+ const stats_el = document.querySelector('#stats')
+ const log_el = document.querySelector('#log')
+ stats = [
+ Statistic(stats_el, 'Time', () => time),
+ Statistic(stats_el, 'Agents', () => agents.length),
+ Statistic(stats_el, 'Cops', () => agents.filter(a => a.team === COP_TEAM).length),
+ Statistic(stats_el, 'Team #1', () => agents.filter(a => a.team === 1).length),
+ Statistic(stats_el, 'Team #2', () => agents.filter(a => a.team === 2).length),
+ Statistic(stats_el, 'Quiescent', () => agents.filter(a => !a.active).length),
+ Statistic(stats_el, 'Active', () => agents.filter(a => a.active).length),
+ Statistic(stats_el, 'Jailed', () => agents.filter(a => a.J > 0).length),
+ Statistic(stats_el, 'Died of old age', () => died.old_age),
+ Statistic(stats_el, 'Died in jail', () => died.in_jail),
+ Statistic(stats_el, 'Murder rate', () => died.murder),
+ Statistic(stats_el, '~ ~ ~', () => ''),
+ Statistic(stats_el, 'Selected Agent #', () => selected_agent && selected_agent.id),
+ Statistic(stats_el, 'Position', () => selected_agent && (selected_agent.x + ',' + selected_agent.y)),
+ Statistic(stats_el, 'Hardship', () => selected_agent && selected_agent.H.toFixed(2)),
+ Statistic(stats_el, 'Risk tolerance', () => selected_agent && selected_agent.R.toFixed(2)),
+ Statistic(stats_el, 'Grievance', () => selected_agent && selected_agent.G.toFixed(2)),
+ Statistic(stats_el, 'Score', () => selected_agent && selected_agent.GN.toFixed(2)),
+ Statistic(stats_el, 'Cop / Active ratio', () => selected_agent && selected_agent.CAv.toFixed(2)),
+ Statistic(stats_el, 'Arrest probability', () => selected_agent && selected_agent.P.toFixed(2)),
+ Statistic(stats_el, 'Net risk', () => selected_agent && selected_agent.NetR.toFixed(2)),
+ Statistic(stats_el, 'Active', () => selected_agent && yesno(selected_agent.active)),
+ Statistic(stats_el, 'Age', () => selected_agent && selected_agent.Age),
+ Statistic(stats_el, 'In Jail?', () => selected_agent && yesno(selected_agent.J)),
+ Statistic(stats_el, 'Dead?', () => selected_agent && yesno(selected_agent.dead)),
+ Statistic(stats_el, 'Jail term', () => selected_agent && (selected_agent.J ? selected_agent.J : '')),
+ Statistic(log_el, 'Log', () => selected_agent && (selected_agent.log.join('\n'))),
+ ]
+
+ const restart_button = document.querySelector('button#restart')
+ restart_button.addEventListener('click', play)
+
+ const pause_button = document.querySelector('button#pause')
+ pause_button.addEventListener('click', pause)
+
+ const observe_button = document.querySelector('button#observe')
+ observe_button.addEventListener('click', () => {
+ observe_random_agent()
+ })
+
+ document.querySelector('.loading').classList.remove('loading')
+ rescale()
+ play()
+}
+function yesno(x) { return x ? 'Yes' : 'No' }
+build()
diff --git a/client/lib/color.js b/client/lib/color.js
new file mode 100644
index 0000000..4c71cc1
--- /dev/null
+++ b/client/lib/color.js
@@ -0,0 +1,31 @@
+
+const palettes = [
+ [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5], [1.0, 1.0, 1.0], [0.00, 0.33, 0.67]],
+ [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5], [1.0, 1.0, 1.0], [0.00, 0.10, 0.20]],
+ [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5], [1.0, 1.0, 1.0], [0.30, 0.20, 0.20]],
+ [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5], [1.0, 1.0, 0.5], [0.80, 0.90, 0.30]],
+ [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5], [1.0, 0.7, 0.4], [0.00, 0.15, 0.20]],
+ [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5], [2.0, 1.0, 0.0], [0.50, 0.20, 0.25]],
+ [[0.8, 0.5, 0.4], [0.2, 0.4, 0.2], [2.0, 1.0, 1.0], [0.00, 0.25, 0.25]],
+]
+
+let palette = palettes[1]
+
+function channel (t, a, b, c, d, add, mul) {
+ return a + b * Math.cos(2 * Math.PI * (c * t + d)) * mul + add
+}
+
+function color (t, add=0, mul=1) {
+ let a, b, c, d
+ const rgb = []
+ for (var i = 0; i < 3; i++) {
+ a = palette[0][i]
+ b = palette[1][i]
+ c = palette[2][i]
+ d = palette[3][i]
+ rgb[i] = Math.round(channel(t, a, b, c, d, add, mul) * 255)
+ }
+ return 'rgb(' + rgb + ')'
+}
+
+export default color
diff --git a/client/lib/intonation.js b/client/lib/intonation.js
new file mode 100644
index 0000000..e5465af
--- /dev/null
+++ b/client/lib/intonation.js
@@ -0,0 +1,162 @@
+module.exports = (function(){
+ var Intonation = function(opt){
+ opt = this.opt = Object.assign({
+ name: "",
+ root: 440,
+ octave: 0,
+ interval: 2,
+ tet: 0,
+ intervals: null,
+ }, opt || {})
+ this.generate()
+ }
+ Intonation.prototype.generate = function(opt){
+ opt = Object.assign(this.opt, opt || {})
+ if (opt.scl) {
+ this.generate_scl()
+ }
+ else if (opt.tet) {
+ this.generate_tet()
+ }
+ else if (opt.intervals) {
+ this.generate_intervals()
+ }
+ }
+ Intonation.prototype.generate_intervals = function(){
+ var root = this.opt.root
+ var interval_list = this.opt.intervals
+ if (typeof interval_list == "string") {
+ interval_list = interval_list.split(" ")
+ }
+ this.name = this.opt.name || "interval list"
+ this.intervals = interval_list
+ this.interval = this.opt.interval = parseInterval.call(this, interval_list.pop() )
+ this.scale = interval_list.map( parseIntervalString.bind(this) ).filter(function(v){
+ return !! v
+ })
+ }
+ Intonation.prototype.generate_tet = function(){
+ var scale = this.scale = []
+ var root = this.opt.root
+ var tet = this.opt.tet
+ var interval = this.interval = this.opt.interval
+ var ratio = Math.pow( interval, 1/tet )
+ var n = root
+ scale.push(n)
+ for (var i = 0; i < tet-1; i++) {
+ n *= ratio
+ scale.push(n)
+ }
+ this.name = this.opt.name || tet + "-tone equal temperament"
+ this.intervals = null
+ }
+ Intonation.prototype.generate_scl = function(){
+ var root = this.opt.root
+ var scl = this.parse_scl( this.opt.scl )
+ this.intervals = scl.notes
+ this.interval = scl.notes.pop()
+ this.name = this.opt.name || scl.description
+ this.scale = scl.notes.map(function(v){
+ return v * root
+ })
+ }
+ Intonation.prototype.parse_scl = function(s){
+ var scl = {}
+ scl.comments = []
+ scl.notes = []
+ s.trim().split("\n").forEach(function(line){
+ // Lines beginning with an exclamation mark are regarded as comments
+ // and are to be ignored.
+ if ( line.indexOf("!") !== -1 ) {
+ scl.comments.push(line)
+ }
+ // The first (non comment) line contains a short description of the scale.
+ // If there is no description, there should be an empty line. (nb: which is falsey)
+ else if ( ! ('description' in scl) ) {
+ scl.description = line
+ }
+ // The second line contains the number of notes.
+ // The first note of 1/1 or 0.0 cents is implicit and not in the files.
+ else if ( ! scl.notes.length) {
+ scl.notes.push(1)
+ }
+ else {
+ // If the value contains a period, it is a cents value, otherwise a ratio.
+ var note = line.replace(/^[^-\.0-9]+/,"").replace(/[^-\/\.0-9]+$/,"")
+ if ( note.indexOf(".") !== -1 ) {
+ note = Math.pow( 2, (parseFloat(note) / 1200) )
+ }
+ else {
+ note = parseInterval(note)
+ }
+ if (note) {
+ scl.notes.push(note)
+ }
+ }
+ })
+ return scl
+ }
+ Intonation.prototype.index = function(i, octave){
+ octave = octave || this.opt.octave
+ var f = this.scale[ mod(i, this.scale.length)|0 ]
+ var pow = Math.floor(norm(i, 0, this.scale.length)) + octave
+ f *= Math.pow(this.interval, pow)
+ return f
+ }
+ Intonation.prototype.range = function(min, max){
+ var a = []
+ for (var i = min; i < max; i++) {
+ a.push( this.index(i) )
+ }
+ return a
+ }
+ Intonation.prototype.set_root = function(f){
+ this.opt.root = f
+ this.generate()
+ }
+ Intonation.prototype.quantize_frequency = function(f){
+ if (f == 0) return 0
+ var scale_f = f
+ var pow = 0
+ var interval = this.interval
+ var scale = this.scale
+ while (scale_f < root) {
+ scale_f *= interval
+ pow -= 1
+ }
+ while (scale_f > root * interval) {
+ scale_f /= interval
+ pow += 1
+ }
+ for (var i = 0; i < scale.length; i++) {
+ if (scale_f > scale[i]) continue
+ scale_f = scale[i]
+ break
+ }
+ scale_f *= Math.pow(2, pow)
+ return scale_f
+ }
+ Intonation.prototype.quantize_index = function(i){
+ return mod(index-1, this.scale.length)|0
+ }
+ var parseInterval = Intonation.prototype.parse_interval = function (s) {
+ if (typeof s == "number") return s
+ if (! s.indexOf("/") == -1) return parseInt(s)
+ var pp = s.split("/")
+ var num = parseInt(pp[0])
+ var den = parseInt(pp[1])
+ if (isNaN(num)) return 1
+ if (isNaN(den) || den == 0) return num
+ if (num == den) return 1
+ return num / den
+ }
+ var parseIntervalString = Intonation.prototype.parse_interval_string = function(s){
+ if (s.indexOf("/") !== -1) return parseInterval(s) * this.opt.root // intervals
+ if (s.indexOf("f") !== -1) return parseFloat(s) // pure frequencies
+ return parseFloat(s)
+ }
+ function norm(n,a,b){ return (n-a) / (b-a) }
+ function mod(n,m){ return n-(m * Math.floor(n/m)) }
+
+ return Intonation
+})()
diff --git a/client/lib/kalimba.js b/client/lib/kalimba.js
new file mode 100644
index 0000000..60a50a9
--- /dev/null
+++ b/client/lib/kalimba.js
@@ -0,0 +1,47 @@
+import Tone from 'tone'
+import { choice } from './util'
+
+const player_count = 2
+
+const compressor = new Tone.Compressor(-30, 3).toMaster()
+
+const samples = [
+ { root: 226, fn: 'samples/380737__cabled-mess__sansula-01-a-raw.mp3', },
+ { root: 267, fn: 'samples/380736__cabled-mess__sansula-02-c-raw.mp3', },
+ { root: 340, fn: 'samples/380735__cabled-mess__sansula-03-e-raw.mp3', },
+ { root: 452, fn: 'samples/380733__cabled-mess__sansula-06-a-02-raw.mp3', },
+// { root: 507, fn: 'samples/380734__cabled-mess__sansula-07-b-h-raw.mp3', },
+// { root: 535, fn: 'samples/380731__cabled-mess__sansula-08-c-raw.mp3', },
+// { root: 671, fn: 'samples/380732__cabled-mess__sansula-09-e-raw.mp3', },
+]
+
+samples.forEach((sample) => {
+ sample.players = []
+ sample.index = -1
+ for (let i = 0; i < player_count; i++) {
+ let fn = sample.fn
+ if (window.location.href.match(/asdf.us/)) {
+ fn = '//asdf.us/kalimba/' + fn
+ }
+ let player = new Tone.Player({
+ url: fn,
+ retrigger: true,
+ playbackRate: 1,
+ })
+ player.connect(compressor)
+ sample.players.push(player)
+ }
+})
+
+function play (freq) {
+ const best = { sample: choice(samples) }
+ best.sample.index = (best.sample.index + 1) % player_count
+
+ const player = best.sample.players[ best.sample.index ]
+ player.playbackRate = freq / best.sample.root
+ console.log(player)
+ player.start()
+}
+
+export default { play }
+
diff --git a/client/lib/keys.js b/client/lib/keys.js
new file mode 100644
index 0000000..c9e51ac
--- /dev/null
+++ b/client/lib/keys.js
@@ -0,0 +1,39 @@
+const keys = {}
+const key_numbers = {}
+const letters = "zxcvbnmasdfghjklqwertyuiop"
+const numbers = "1234567890"
+
+let callback = function(){}
+
+letters.toUpperCase().split("").map(function(k,i){
+ keys[k.charCodeAt(0)] = i
+})
+
+numbers.split("").map(function(k,i){
+ keys[k.charCodeAt(0)] = i+letters.length
+ key_numbers[k.charCodeAt(0)] = true
+})
+
+window.addEventListener("keydown", keydown, true)
+function keydown (e) {
+ if (e.altKey || e.ctrlKey || e.metaKey) {
+ e.stopPropagation()
+ return
+ }
+ if (document.activeElement instanceof HTMLInputElement &&
+ (e.keyCode in key_numbers)) {
+ e.stopPropagation()
+ return
+ }
+ if (! (e.keyCode in keys)) return
+ var index = keys[e.keyCode]
+ if (e.shiftKey) index += letters.length
+ index -= 7
+ callback(index)
+}
+
+function listen (fn) {
+ callback = fn
+}
+
+export default { listen } \ No newline at end of file
diff --git a/client/lib/scales.js b/client/lib/scales.js
new file mode 100644
index 0000000..d85fe08
--- /dev/null
+++ b/client/lib/scales.js
@@ -0,0 +1,299 @@
+import Intonation from './intonation'
+
+const meantone = `! meanquar.scl
+!
+1/4-comma meantone scale. Pietro Aaron's temperament (1523)
+ 12
+!
+ 76.04900
+ 193.15686
+ 310.26471
+ 5/4
+ 503.42157
+ 579.47057
+ 696.57843
+ 25/16
+ 889.73529
+ 1006.84314
+ 1082.89214
+ 2/1
+`
+
+const shares = `! shares.scl
+!
+A scale based on shares of wealth
+!
+1.
+5.
+15.
+32.
+52.
+78.
+116.
+182.
+521.
+1000.
+`
+
+const shares_sum = `! shares_sum.scl
+!
+A scale based on summing shares of wealth
+!
+1
+6.0
+21.0
+53.0
+105.0
+183.0
+299.0
+481.0
+1002.0
+2/1
+`
+
+const mavila = `! mavila12.scl
+!
+A 12-note mavila scale (for warping meantone-based music), 5-limit TOP
+ 12
+!
+-30.99719
+ 163.50770
+ 358.01258
+ 327.01540
+ 521.52028
+ 490.52310
+ 685.02798
+ 654.03080
+ 848.53568
+ 1043.04057
+ 1012.04338
+ 1206.54826
+`
+
+const carlos_alpha = `! carlos_alpha.scl
+!
+Wendy Carlos' Alpha scale with perfect fifth divided in nine
+ 18
+!
+ 78.00000
+ 156.00000
+ 234.00000
+ 312.00000
+ 390.00000
+ 468.00000
+ 546.00000
+ 624.00000
+ 702.00000
+ 780.00000
+ 858.00000
+ 936.00000
+ 1014.00000
+ 1092.00000
+ 1170.00000
+ 1248.00000
+ 1326.00000
+ 1404.00000
+`
+
+const lamonte = `! young-lm_piano.scl
+!
+LaMonte Young's Well-Tempered Piano
+12
+!
+567/512
+9/8
+147/128
+21/16
+1323/1024
+189/128
+3/2
+49/32
+7/4
+441/256
+63/32
+2/1
+`
+
+const colundi = `! colundi.scl
+!
+Colundi scale
+10
+!
+9/8
+171/140
+137/112
+43/35
+3/2
+421/280
+213/140
+263/150
+66/35
+2/1
+`
+
+const liu_major = `! liu_major.scl
+!
+Linus Liu's Major Scale, see his 1978 book, "Intonation Theory"
+ 7
+!
+ 10/9
+ 100/81
+ 4/3
+ 3/2
+ 5/3
+ 50/27
+ 2/1
+`
+const liu_pentatonic = `! liu_pent.scl
+!
+Linus Liu's "pentatonic scale"
+ 7
+!
+ 9/8
+ 81/64
+ 27/20
+ 3/2
+ 27/16
+ 243/128
+ 81/40
+`
+
+const liu_minor = `! LIU_MINor.scl
+!
+Linus Liu's Harmonic Minor
+ 7
+!
+ 10/9
+ 6/5
+ 4/3
+ 40/27
+ 8/5
+ 50/27
+ 2/1
+`
+
+const liu_melodic_minor = `! liu_mel.scl
+!
+Linus Liu's Melodic Minor, use 5 and 7 descending and 6 and 8 ascending
+ 9
+!
+ 10/9
+ 6/5
+ 4/3
+ 3/2
+ 81/50
+ 5/3
+ 9/5
+ 50/27
+ 2/1
+`
+
+const scales = [
+ {
+ intervals: '1/1 9/8 5/4 4/3 3/2 5/3 15/8 2/1',
+ name: "harmonic scale",
+ },
+ {
+ root: 450,
+ intervals: '1/1 9/8 5/4 4/3 3/2 5/3 15/8 2/1',
+ name: "harmonic scale @ 450",
+ },
+ {
+ tet: 5,
+ },
+ {
+ tet: 12,
+ },
+ {
+ tet: 17,
+ },
+ {
+ intervals: '1/1 81/80 33/32 21/20 16/15 12/11 11/10 10/9 9/8 8/7 7/6 32/27 6/5 11/9 5/4 14/11 9/7 21/16 4/3 27/20 11/8 7/5 10/7 16/11 40/27 3/2 32/21 14/9 11/7 8/5 18/11 5/3 27/16 12/7 7/4 16/9 9/5 20/11 11/6 15/8 40/21 64/33 160/81 2/1',
+ name: "harry partch scale",
+ },
+ {
+ scl: lamonte,
+ },
+ {
+ scl: meantone,
+ },
+ {
+ scl: mavila,
+ },
+ {
+ scl: carlos_alpha,
+ },
+ {
+ scl: colundi,
+ },
+ {
+ scl: shares,
+ },
+ {
+ scl: shares_sum,
+ },
+ {
+ scl: liu_major,
+ },
+ {
+ scl: liu_minor,
+ },
+ {
+ scl: liu_melodic_minor,
+ },
+ {
+ scl: liu_pentatonic,
+ }
+].map( (opt) => new Intonation(opt) )
+
+let scale = scales[0]
+let handleChange = function(){}
+
+function build () {
+ scales.forEach( (scale, i) => {
+ scale.heading = document.createElement('div')
+ scale.heading.innerHTML = scale.name
+ scale.heading.classList.add('heading')
+ scale.heading.addEventListener('click', function(){
+ pick(i)
+ })
+ scale_list.appendChild(scale.heading)
+ })
+ pick(0)
+}
+function build_options(el) {
+ scales.forEach( (scale, i) => {
+ const option = document.createElement('option')
+ option.innerHTML = scale.name
+ option.value = i
+ el.appendChild(option)
+ })
+ el.addEventListener('input', function(e){
+ pick(e.target.value)
+ })
+ pick(0)
+}
+
+function pick (i) {
+ if (scale) {
+ scale.heading && scale.heading.classList.remove('selected')
+ }
+ scale = scales[i]
+ scale.heading && scale.heading.classList.add('selected')
+ handleChange(scale)
+}
+
+function current () {
+ return scale
+}
+
+function onChange (fn) {
+ handleChange = fn
+}
+
+function names () {
+ return scales.map( scale => scale.name )
+}
+
+
+export default { scales, current, build, build_options, pick, names, onChange }
diff --git a/client/lib/startAudioContext.js b/client/lib/startAudioContext.js
new file mode 100644
index 0000000..f3a9793
--- /dev/null
+++ b/client/lib/startAudioContext.js
@@ -0,0 +1,181 @@
+/**
+ * StartAudioContext.js
+ * @author Yotam Mann
+ * @license http://opensource.org/licenses/MIT MIT License
+ * @copyright 2016 Yotam Mann
+ */
+(function (root, factory) {
+ if (typeof define === "function" && define.amd) {
+ define([], factory);
+ } else if (typeof module === 'object' && module.exports) {
+ module.exports = factory();
+ } else {
+ root.StartAudioContext = factory();
+ }
+}(this, function () {
+
+ /**
+ * The StartAudioContext object
+ */
+ var StartAudioContext = {
+ /**
+ * The audio context passed in by the user
+ * @type {AudioContext}
+ */
+ context : null,
+ /**
+ * The TapListeners bound to the elements
+ * @type {Array}
+ * @private
+ */
+ _tapListeners : [],
+ /**
+ * Callbacks to invoke when the audio context is started
+ * @type {Array}
+ * @private
+ */
+ _onStarted : [],
+ };
+
+
+ /**
+ * Set the context
+ * @param {AudioContext} ctx
+ * @returns {StartAudioContext}
+ */
+ StartAudioContext.setContext = function(ctx){
+ StartAudioContext.context = ctx;
+ return StartAudioContext;
+ };
+
+ /**
+ * Add a tap listener to the audio context
+ * @param {Array|Element|String|jQuery} element
+ * @returns {StartAudioContext}
+ */
+ StartAudioContext.on = function(element){
+ if (Array.isArray(element) || (NodeList && element instanceof NodeList)){
+ for (var i = 0; i < element.length; i++){
+ StartAudioContext.on(element[i]);
+ }
+ } else if (typeof element === "string"){
+ StartAudioContext.on(document.querySelectorAll(element));
+ } else if (element.jquery && typeof element.toArray === "function"){
+ StartAudioContext.on(element.toArray());
+ } else if (Element && element instanceof Element){
+ //if it's an element, create a TapListener
+ var tap = new TapListener(element, onTap);
+ StartAudioContext._tapListeners.push(tap);
+ }
+ return StartAudioContext;
+ };
+
+ /**
+ * Bind a callback to when the audio context is started.
+ * @param {Function} cb
+ * @return {StartAudioContext}
+ */
+ StartAudioContext.onStarted = function(cb){
+ //if it's already started, invoke the callback
+ if (StartAudioContext.isStarted()){
+ cb();
+ } else {
+ StartAudioContext._onStarted.push(cb);
+ }
+ return StartAudioContext;
+ };
+
+ /**
+ * returns true if the context is started
+ * @return {Boolean}
+ */
+ StartAudioContext.isStarted = function(){
+ return (StartAudioContext.context !== null && StartAudioContext.context.state === "running");
+ };
+
+ /**
+ * @class Listens for non-dragging tap ends on the given element
+ * @param {Element} element
+ * @internal
+ */
+ var TapListener = function(element){
+
+ this._dragged = false;
+
+ this._element = element;
+
+ this._bindedMove = this._moved.bind(this);
+ this._bindedEnd = this._ended.bind(this);
+
+ element.addEventListener("touchmove", this._bindedMove);
+ element.addEventListener("touchend", this._bindedEnd);
+ element.addEventListener("mouseup", this._bindedEnd);
+ };
+
+ /**
+ * drag move event
+ */
+ TapListener.prototype._moved = function(e){
+ this._dragged = true;
+ };
+
+ /**
+ * tap ended listener
+ */
+ TapListener.prototype._ended = function(e){
+ if (!this._dragged){
+ onTap();
+ }
+ this._dragged = false;
+ };
+
+ /**
+ * remove all the bound events
+ */
+ TapListener.prototype.dispose = function(){
+ this._element.removeEventListener("touchmove", this._bindedMove);
+ this._element.removeEventListener("touchend", this._bindedEnd);
+ this._element.removeEventListener("mouseup", this._bindedEnd);
+ this._bindedMove = null;
+ this._bindedEnd = null;
+ this._element = null;
+ };
+
+ /**
+ * Invoked the first time of the elements is tapped.
+ * Creates a silent oscillator when a non-dragging touchend
+ * event has been triggered.
+ */
+ function onTap(){
+ //start the audio context with a silent oscillator
+ if (StartAudioContext.context && !StartAudioContext.isStarted()){
+ var osc = StartAudioContext.context.createOscillator();
+ var silent = StartAudioContext.context.createGain();
+ silent.gain.value = 0;
+ osc.connect(silent);
+ silent.connect(StartAudioContext.context.destination);
+ var now = StartAudioContext.context.currentTime;
+ osc.start(now);
+ osc.stop(now+0.5);
+ }
+
+ //dispose all the tap listeners
+ if (StartAudioContext._tapListeners){
+ for (var i = 0; i < StartAudioContext._tapListeners.length; i++){
+ StartAudioContext._tapListeners[i].dispose();
+ }
+ StartAudioContext._tapListeners = null;
+ }
+ //the onstarted callbacks
+ if (StartAudioContext._onStarted){
+ for (var j = 0; j < StartAudioContext._onStarted.length; j++){
+ StartAudioContext._onStarted[j]();
+ }
+ StartAudioContext._onStarted = null;
+ }
+ }
+
+ return StartAudioContext;
+}));
+
+
diff --git a/client/lib/util.js b/client/lib/util.js
new file mode 100644
index 0000000..35a537d
--- /dev/null
+++ b/client/lib/util.js
@@ -0,0 +1,198 @@
+import Nexus from 'nexusui'
+// import Tone from 'tone'
+// import StartAudioContext from './startAudioContext'
+
+const isIphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))
+const isIpad = (navigator.userAgent.match(/iPad/i))
+const isAndroid = (navigator.userAgent.match(/Android/i))
+const isMobile = isIphone || isIpad || isAndroid
+const isDesktop = ! isMobile
+
+document.body.classList.add(isMobile ? 'mobile' : 'desktop')
+
+const browser = { isIphone, isIpad, isMobile, isDesktop }
+
+function choice (a){ return a[ Math.floor(Math.random() * a.length) ] }
+function randint (n) { return Math.floor(Math.random() * n) }
+function mod(n,m){ return n-(m * Math.floor(n/m)) }
+function norm(n, min, max){ return (n - min) / (max - min) }
+function shuffle(a){
+ a = a.slice(0)
+ for (var i = a.length; i > 0; i--){
+ var r = randint(i)
+ var swap = a[i-1]
+ a[i-1] = a[r]
+ a[r] = swap
+ }
+ return a
+}
+function shuffleInPlace(a){
+ for (var i = a.length; i > 0; i--){
+ var r = randint(i)
+ var swap = a[i-1]
+ a[i-1] = a[r]
+ a[r] = swap
+ }
+ return a
+}
+function requestAudioContext (fn) {
+ if (isMobile) {
+ const container = document.createElement('div')
+ const button = document.createElement('div')
+ button.innerHTML = 'Tap to start - please unmute your phone'
+ Object.assign(container.style, {
+ position: 'absolute',
+ width: '100%',
+ height: '100%',
+ zIndex: '10000',
+ top: '0px',
+ left: '0px',
+ backgroundColor: 'rgba(0, 0, 0, 0.8)',
+ })
+ Object.assign(button.style, {
+ position: 'absolute',
+ left: '50%',
+ top: '50%',
+ padding: '20px',
+ backgroundColor: '#7F33ED',
+ color: 'white',
+ fontFamily: 'monospace',
+ borderRadius: '3px',
+ transform: 'translate3D(-50%,-50%,0)',
+ textAlign: 'center',
+ lineHeight: '1.5',
+ })
+ container.appendChild(button)
+ document.body.appendChild(container)
+ StartAudioContext.setContext(Tone.context)
+ StartAudioContext.on(button)
+ StartAudioContext.onStarted(_ => {
+ container.remove()
+ fn()
+ })
+ } else {
+ fn()
+ }
+}
+
+function dataURItoBlob(dataURI) {
+ // convert base64 to raw binary data held in a string
+ // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
+ var byteString = atob(dataURI.split(',')[1]);
+
+ // separate out the mime component
+ var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]
+
+ // write the bytes of the string to an ArrayBuffer
+ var ab = new ArrayBuffer(byteString.length);
+
+ // create a view into the buffer
+ var ia = new Uint8Array(ab);
+
+ // set the bytes of the buffer to the correct values
+ for (var i = 0; i < byteString.length; i++) {
+ ia[i] = byteString.charCodeAt(i);
+ }
+
+ // write the ArrayBuffer to a blob, and you're done
+ var blob = new Blob([ab], {type: mimeString});
+ return blob;
+
+}
+function ftom(f) {
+ // return (Math.log(f) - Math.log(261.626)) / Math.log(2) + 4.0
+ return 69 + 12 * Math.log2(f / 440)
+}
+function mtof(m) {
+ return 440 * Math.pow(2, (m - 69) / 12)
+}
+function tap (fn) {
+ return (e) => {
+ if (browser.isMobile) fn()
+ else if (e.press) fn()
+ }
+}
+
+function update_value_on_change(el, id, is_int, fn) {
+ const label = document.querySelector(id + ' + .val')
+ const update = v => {
+ label.innerHTML = is_int ? parseInt(v) : v.toFixed(2)
+ fn && fn(v)
+ }
+ el.on('change', update)
+ label.innerHTML = is_int ? parseInt(el.value) : el.value.toFixed(2)
+ el.update = update
+}
+function update_radio_value_on_change(el, id, values, fn) {
+ let old_v = el.active
+ const label = document.querySelector(id + ' + .val')
+ const update = v => {
+ if (v === -1) {
+ v = el.active = old_v
+ } else {
+ old_v = v
+ }
+ label.innerHTML = values[v][1]
+ fn && fn(v)
+ }
+ el.on('change', update)
+ update(el.active)
+ el.update = update
+}
+function build_options(el, lists, fn) {
+ Object.keys(lists).forEach(key => {
+ const list = lists[key]
+ const option = document.createElement('option')
+ option.innerHTML = list.name
+ option.value = key
+ el.appendChild(option)
+ })
+ el.addEventListener('input', function(e){
+ fn(e.target.value)
+ })
+}
+function Slider(parent, tag, title, options, is_int, fn){
+ const block = document.createElement('div')
+ block.classList.add('block')
+ const el = document.createElement('div')
+ el.setAttribute('id', tag)
+ const val = document.createElement('span')
+ val.classList.add('val')
+ const label = document.createElement('label')
+ label.innerHTML = title
+ block.appendChild(label)
+ block.appendChild(el)
+ block.appendChild(val)
+ parent.appendChild(block)
+ options.size = [200, 24]
+ const nx = new Nexus.Slider('#' + tag, options)
+ update_value_on_change(nx, '#' + tag, is_int, fn)
+ return nx
+}
+function Statistic(parent, label, fn){
+ const block = document.createElement('div')
+ block.classList.add('stat')
+ const key = document.createElement('div')
+ key.classList.add('key')
+ const val = document.createElement('div')
+ val.classList.add('val')
+ block.appendChild(key)
+ block.appendChild(val)
+ parent.appendChild(block)
+ key.innerHTML = label
+ val.innerHTML = fn()
+ let old_v
+ return () => {
+ const v = fn()
+ if (old_v === v) return
+ val.innerText = old_v = v
+ }
+}
+
+export {
+ mod, norm, choice, shuffle, randint,
+ browser, requestAudioContext, ftom, mtof, tap, dataURItoBlob,
+ update_value_on_change, update_radio_value_on_change, build_options,
+ Slider, Statistic,
+ }
+
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..ee85962
--- /dev/null
+++ b/index.html
@@ -0,0 +1,180 @@
+<html>
+<head>
+<title>Civic Violence</title>
+<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
+<style>
+body {
+ font-family: Helvetica, sans-serif;
+ font-weight: 300;
+ font-size: 13px;
+ transition: background-color 100ms;
+ background-color: #f8fdff;
+}
+div {
+ display: inline-block;
+}
+h2 {
+ margin: 10px 0;
+}
+h3 {
+ font-weight: 300;
+ margin-top: 20px;
+}
+#dataset_name {
+ text-transform: capitalize;
+}
+.desktop body {
+ user-select: none;
+}
+.top {
+ display: block;
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+.tools {
+ padding: 50px 100px;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+.corner {
+ position: absolute;
+ bottom: 0;
+ margin: 10px;
+ padding: 10px;
+ background: white;
+ display: flex;
+}
+.corner.left {
+ left: 0;
+}
+.corner.right {
+ right: 0;
+}
+body {
+ transition: 0.1s;
+}
+.loading {
+ opacity: 0;
+}
+.row {
+ display: flex;
+ flex-direction: row;
+}
+.column {
+ display: flex;
+ flex-direction: column;
+}
+.block {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ margin-right: 10px;
+}
+.block > label {
+ font-weight: normal;
+ width: 180px;
+}
+.block > span {
+ display: block;
+}
+.block > .val {
+ margin-left: 10px;
+}
+.radio {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ margin-top: 20px;
+ margin-bottom: 20px;
+}
+.radio > span {
+ margin-left: 10px;
+}
+.buttons {
+ margin: 10px 0 10px 0;
+}
+select {
+ font-size: 12px;
+ margin-bottom: 10px;
+}
+.ends {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ flex-direction: row;
+ width: 400px;
+}
+#stats {
+ display: flex;
+ flex-direction: column;
+}
+#stats .stat {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+}
+#stats .key {
+ font-weight: normal;
+}
+#stats .val {
+ width: 40px;
+ white-space: pre;
+}
+canvas {
+ width: calc(100vh - 200px);
+ height: calc(50vh - 100px);
+}
+#log .key {
+ display: none;
+}
+#log .val {
+ margin-left: 10px;
+ margin-top: 40px;
+}
+</style>
+</head>
+<body class='loading'>
+<div>
+<div class='tools'>
+ <div class='row'>
+ <canvas id="canvas"></canvas>
+ </div>
+
+ <div class='row'>
+ <div class='ends'>
+ <h2>Civic Violence</h2>
+ <div class='buttons'>
+ <button id="restart">Restart</button>
+ <button id="pause">Pause</button>
+ <button id="observe">Observe Random Agent</button>
+ </div>
+ </div>
+ </div>
+
+ <div class='row'>
+ <div class='column'>
+ <div>
+ <select id="sim"></select>
+ </div>
+ <div class='column' id="options"></div>
+ </div>
+ <div class='column'>
+ <select id="view"></select>
+ <div id="stats"></div>
+ </div>
+ <div class='column'>
+ <div id="log"></div>
+ </div>
+</div>
+<div class="corner left">
+</div>
+<div class="corner right">
+</div>
+</body>
+<script>
+ var s = document.createElement('script');
+ s.setAttribute('src','bundle.js?' + Date.now());
+ document.body.appendChild(s)
+</script>
+</html>
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..5851769
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,3716 @@
+{
+ "name": "inequality",
+ "version": "1.0.0",
+ "lockfileVersion": 1,
+ "requires": true,
+ "dependencies": {
+ "acorn": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.0.3.tgz",
+ "integrity": "sha1-xGDfCEkUY/AozLguqzcwvwEIez0=",
+ "dev": true
+ },
+ "acorn-dynamic-import": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz",
+ "integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=",
+ "dev": true,
+ "requires": {
+ "acorn": "^4.0.3"
+ },
+ "dependencies": {
+ "acorn": {
+ "version": "4.0.11",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.11.tgz",
+ "integrity": "sha1-7c2jvZN+dVZBDULtWGD2c5nHlMA=",
+ "dev": true
+ }
+ }
+ },
+ "ajv": {
+ "version": "4.11.7",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.7.tgz",
+ "integrity": "sha1-hlWl2G0IJJhcxHGh2RP7Zymg7Eg=",
+ "dev": true,
+ "requires": {
+ "co": "^4.6.0",
+ "json-stable-stringify": "^1.0.1"
+ }
+ },
+ "ajv-keywords": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz",
+ "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=",
+ "dev": true
+ },
+ "align-text": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
+ "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
+ "dev": true,
+ "requires": {
+ "kind-of": "^3.0.2",
+ "longest": "^1.0.1",
+ "repeat-string": "^1.5.2"
+ }
+ },
+ "ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true
+ },
+ "anymatch": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz",
+ "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==",
+ "dev": true,
+ "requires": {
+ "micromatch": "^2.1.5",
+ "normalize-path": "^2.0.0"
+ }
+ },
+ "arr-diff": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
+ "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
+ "dev": true,
+ "requires": {
+ "arr-flatten": "^1.0.1"
+ }
+ },
+ "arr-flatten": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
+ "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
+ "dev": true
+ },
+ "array-unique": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
+ "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=",
+ "dev": true
+ },
+ "asn1.js": {
+ "version": "4.9.1",
+ "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.1.tgz",
+ "integrity": "sha1-SLokC0WpKA6UdImQull9IWYX/UA=",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.0.0",
+ "inherits": "^2.0.1",
+ "minimalistic-assert": "^1.0.0"
+ }
+ },
+ "assert": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz",
+ "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=",
+ "dev": true,
+ "requires": {
+ "util": "0.10.3"
+ }
+ },
+ "async": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/async/-/async-2.3.0.tgz",
+ "integrity": "sha1-EBPRBRBH3TIP4k5JTVxm7K9hR9k=",
+ "dev": true,
+ "requires": {
+ "lodash": "^4.14.0"
+ }
+ },
+ "async-each": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz",
+ "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=",
+ "dev": true
+ },
+ "babel-code-frame": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
+ "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
+ "dev": true,
+ "requires": {
+ "chalk": "^1.1.3",
+ "esutils": "^2.0.2",
+ "js-tokens": "^3.0.2"
+ }
+ },
+ "babel-core": {
+ "version": "6.26.3",
+ "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz",
+ "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==",
+ "dev": true,
+ "requires": {
+ "babel-code-frame": "^6.26.0",
+ "babel-generator": "^6.26.0",
+ "babel-helpers": "^6.24.1",
+ "babel-messages": "^6.23.0",
+ "babel-register": "^6.26.0",
+ "babel-runtime": "^6.26.0",
+ "babel-template": "^6.26.0",
+ "babel-traverse": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "babylon": "^6.18.0",
+ "convert-source-map": "^1.5.1",
+ "debug": "^2.6.9",
+ "json5": "^0.5.1",
+ "lodash": "^4.17.4",
+ "minimatch": "^3.0.4",
+ "path-is-absolute": "^1.0.1",
+ "private": "^0.1.8",
+ "slash": "^1.0.0",
+ "source-map": "^0.5.7"
+ },
+ "dependencies": {
+ "babel-runtime": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "dev": true,
+ "requires": {
+ "core-js": "^2.4.0",
+ "regenerator-runtime": "^0.11.0"
+ }
+ },
+ "babel-types": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz",
+ "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.4",
+ "to-fast-properties": "^1.0.3"
+ }
+ },
+ "minimatch": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
+ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+ "dev": true,
+ "requires": {
+ "brace-expansion": "^1.1.7"
+ }
+ },
+ "private": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
+ "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==",
+ "dev": true
+ },
+ "regenerator-runtime": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
+ "dev": true
+ },
+ "source-map": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
+ "dev": true
+ },
+ "to-fast-properties": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
+ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "dev": true
+ }
+ }
+ },
+ "babel-generator": {
+ "version": "6.26.1",
+ "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz",
+ "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==",
+ "dev": true,
+ "requires": {
+ "babel-messages": "^6.23.0",
+ "babel-runtime": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "detect-indent": "^4.0.0",
+ "jsesc": "^1.3.0",
+ "lodash": "^4.17.4",
+ "source-map": "^0.5.7",
+ "trim-right": "^1.0.1"
+ },
+ "dependencies": {
+ "babel-runtime": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "dev": true,
+ "requires": {
+ "core-js": "^2.4.0",
+ "regenerator-runtime": "^0.11.0"
+ }
+ },
+ "babel-types": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz",
+ "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.4",
+ "to-fast-properties": "^1.0.3"
+ }
+ },
+ "regenerator-runtime": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
+ "dev": true
+ },
+ "source-map": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
+ "dev": true
+ },
+ "to-fast-properties": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
+ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "dev": true
+ }
+ }
+ },
+ "babel-helper-builder-binary-assignment-operator-visitor": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz",
+ "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=",
+ "dev": true,
+ "requires": {
+ "babel-helper-explode-assignable-expression": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-call-delegate": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz",
+ "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=",
+ "dev": true,
+ "requires": {
+ "babel-helper-hoist-variables": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-define-map": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz",
+ "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=",
+ "dev": true,
+ "requires": {
+ "babel-helper-function-name": "^6.24.1",
+ "babel-runtime": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "lodash": "^4.17.4"
+ },
+ "dependencies": {
+ "babel-runtime": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "dev": true,
+ "requires": {
+ "core-js": "^2.4.0",
+ "regenerator-runtime": "^0.11.0"
+ }
+ },
+ "babel-types": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz",
+ "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.4",
+ "to-fast-properties": "^1.0.3"
+ }
+ },
+ "regenerator-runtime": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
+ "dev": true
+ },
+ "to-fast-properties": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
+ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "dev": true
+ }
+ }
+ },
+ "babel-helper-explode-assignable-expression": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz",
+ "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-function-name": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz",
+ "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=",
+ "dev": true,
+ "requires": {
+ "babel-helper-get-function-arity": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-get-function-arity": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz",
+ "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-hoist-variables": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz",
+ "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-optimise-call-expression": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz",
+ "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-regex": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz",
+ "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "lodash": "^4.17.4"
+ },
+ "dependencies": {
+ "babel-runtime": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "dev": true,
+ "requires": {
+ "core-js": "^2.4.0",
+ "regenerator-runtime": "^0.11.0"
+ }
+ },
+ "babel-types": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz",
+ "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.4",
+ "to-fast-properties": "^1.0.3"
+ }
+ },
+ "regenerator-runtime": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
+ "dev": true
+ },
+ "to-fast-properties": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
+ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "dev": true
+ }
+ }
+ },
+ "babel-helper-remap-async-to-generator": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz",
+ "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=",
+ "dev": true,
+ "requires": {
+ "babel-helper-function-name": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-replace-supers": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz",
+ "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=",
+ "dev": true,
+ "requires": {
+ "babel-helper-optimise-call-expression": "^6.24.1",
+ "babel-messages": "^6.23.0",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helpers": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz",
+ "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
+ "babel-loader": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.0.0.tgz",
+ "integrity": "sha1-LkOma+4f/0RwUz0EAsikUy+vuvc=",
+ "dev": true,
+ "requires": {
+ "find-cache-dir": "^0.1.1",
+ "loader-utils": "^1.0.2",
+ "mkdirp": "^0.5.1"
+ }
+ },
+ "babel-messages": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz",
+ "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-check-es2015-constants": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz",
+ "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-syntax-async-functions": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz",
+ "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=",
+ "dev": true
+ },
+ "babel-plugin-syntax-exponentiation-operator": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz",
+ "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=",
+ "dev": true
+ },
+ "babel-plugin-syntax-trailing-function-commas": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz",
+ "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=",
+ "dev": true
+ },
+ "babel-plugin-transform-async-to-generator": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz",
+ "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=",
+ "dev": true,
+ "requires": {
+ "babel-helper-remap-async-to-generator": "^6.24.1",
+ "babel-plugin-syntax-async-functions": "^6.8.0",
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-arrow-functions": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz",
+ "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-block-scoped-functions": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz",
+ "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-block-scoping": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz",
+ "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "babel-template": "^6.26.0",
+ "babel-traverse": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "lodash": "^4.17.4"
+ },
+ "dependencies": {
+ "babel-runtime": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "dev": true,
+ "requires": {
+ "core-js": "^2.4.0",
+ "regenerator-runtime": "^0.11.0"
+ }
+ },
+ "babel-types": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz",
+ "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.4",
+ "to-fast-properties": "^1.0.3"
+ }
+ },
+ "regenerator-runtime": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
+ "dev": true
+ },
+ "to-fast-properties": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
+ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "dev": true
+ }
+ }
+ },
+ "babel-plugin-transform-es2015-classes": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz",
+ "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=",
+ "dev": true,
+ "requires": {
+ "babel-helper-define-map": "^6.24.1",
+ "babel-helper-function-name": "^6.24.1",
+ "babel-helper-optimise-call-expression": "^6.24.1",
+ "babel-helper-replace-supers": "^6.24.1",
+ "babel-messages": "^6.23.0",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-computed-properties": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz",
+ "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-destructuring": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz",
+ "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-duplicate-keys": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz",
+ "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-for-of": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz",
+ "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-function-name": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz",
+ "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=",
+ "dev": true,
+ "requires": {
+ "babel-helper-function-name": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-literals": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz",
+ "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-modules-amd": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz",
+ "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-modules-commonjs": {
+ "version": "6.26.2",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz",
+ "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-strict-mode": "^6.24.1",
+ "babel-runtime": "^6.26.0",
+ "babel-template": "^6.26.0",
+ "babel-types": "^6.26.0"
+ },
+ "dependencies": {
+ "babel-runtime": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "dev": true,
+ "requires": {
+ "core-js": "^2.4.0",
+ "regenerator-runtime": "^0.11.0"
+ }
+ },
+ "babel-types": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz",
+ "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.4",
+ "to-fast-properties": "^1.0.3"
+ }
+ },
+ "regenerator-runtime": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
+ "dev": true
+ },
+ "to-fast-properties": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
+ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "dev": true
+ }
+ }
+ },
+ "babel-plugin-transform-es2015-modules-systemjs": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz",
+ "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=",
+ "dev": true,
+ "requires": {
+ "babel-helper-hoist-variables": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-modules-umd": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz",
+ "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-es2015-modules-amd": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-object-super": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz",
+ "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=",
+ "dev": true,
+ "requires": {
+ "babel-helper-replace-supers": "^6.24.1",
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-parameters": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz",
+ "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=",
+ "dev": true,
+ "requires": {
+ "babel-helper-call-delegate": "^6.24.1",
+ "babel-helper-get-function-arity": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-shorthand-properties": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz",
+ "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-spread": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz",
+ "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-sticky-regex": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz",
+ "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=",
+ "dev": true,
+ "requires": {
+ "babel-helper-regex": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-template-literals": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz",
+ "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-typeof-symbol": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz",
+ "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-unicode-regex": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz",
+ "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=",
+ "dev": true,
+ "requires": {
+ "babel-helper-regex": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "regexpu-core": "^2.0.0"
+ }
+ },
+ "babel-plugin-transform-exponentiation-operator": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz",
+ "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=",
+ "dev": true,
+ "requires": {
+ "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1",
+ "babel-plugin-syntax-exponentiation-operator": "^6.8.0",
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-regenerator": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.24.1.tgz",
+ "integrity": "sha1-uNowWtQ8PJm0hI5P5AN7dw0jxBg=",
+ "dev": true,
+ "requires": {
+ "regenerator-transform": "0.9.11"
+ }
+ },
+ "babel-plugin-transform-strict-mode": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz",
+ "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-preset-env": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz",
+ "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==",
+ "dev": true,
+ "requires": {
+ "babel-plugin-check-es2015-constants": "^6.22.0",
+ "babel-plugin-syntax-trailing-function-commas": "^6.22.0",
+ "babel-plugin-transform-async-to-generator": "^6.22.0",
+ "babel-plugin-transform-es2015-arrow-functions": "^6.22.0",
+ "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0",
+ "babel-plugin-transform-es2015-block-scoping": "^6.23.0",
+ "babel-plugin-transform-es2015-classes": "^6.23.0",
+ "babel-plugin-transform-es2015-computed-properties": "^6.22.0",
+ "babel-plugin-transform-es2015-destructuring": "^6.23.0",
+ "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0",
+ "babel-plugin-transform-es2015-for-of": "^6.23.0",
+ "babel-plugin-transform-es2015-function-name": "^6.22.0",
+ "babel-plugin-transform-es2015-literals": "^6.22.0",
+ "babel-plugin-transform-es2015-modules-amd": "^6.22.0",
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0",
+ "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0",
+ "babel-plugin-transform-es2015-modules-umd": "^6.23.0",
+ "babel-plugin-transform-es2015-object-super": "^6.22.0",
+ "babel-plugin-transform-es2015-parameters": "^6.23.0",
+ "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0",
+ "babel-plugin-transform-es2015-spread": "^6.22.0",
+ "babel-plugin-transform-es2015-sticky-regex": "^6.22.0",
+ "babel-plugin-transform-es2015-template-literals": "^6.22.0",
+ "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0",
+ "babel-plugin-transform-es2015-unicode-regex": "^6.22.0",
+ "babel-plugin-transform-exponentiation-operator": "^6.22.0",
+ "babel-plugin-transform-regenerator": "^6.22.0",
+ "browserslist": "^3.2.6",
+ "invariant": "^2.2.2",
+ "semver": "^5.3.0"
+ }
+ },
+ "babel-preset-es2015": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz",
+ "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-check-es2015-constants": "^6.22.0",
+ "babel-plugin-transform-es2015-arrow-functions": "^6.22.0",
+ "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0",
+ "babel-plugin-transform-es2015-block-scoping": "^6.24.1",
+ "babel-plugin-transform-es2015-classes": "^6.24.1",
+ "babel-plugin-transform-es2015-computed-properties": "^6.24.1",
+ "babel-plugin-transform-es2015-destructuring": "^6.22.0",
+ "babel-plugin-transform-es2015-duplicate-keys": "^6.24.1",
+ "babel-plugin-transform-es2015-for-of": "^6.22.0",
+ "babel-plugin-transform-es2015-function-name": "^6.24.1",
+ "babel-plugin-transform-es2015-literals": "^6.22.0",
+ "babel-plugin-transform-es2015-modules-amd": "^6.24.1",
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1",
+ "babel-plugin-transform-es2015-modules-systemjs": "^6.24.1",
+ "babel-plugin-transform-es2015-modules-umd": "^6.24.1",
+ "babel-plugin-transform-es2015-object-super": "^6.24.1",
+ "babel-plugin-transform-es2015-parameters": "^6.24.1",
+ "babel-plugin-transform-es2015-shorthand-properties": "^6.24.1",
+ "babel-plugin-transform-es2015-spread": "^6.22.0",
+ "babel-plugin-transform-es2015-sticky-regex": "^6.24.1",
+ "babel-plugin-transform-es2015-template-literals": "^6.22.0",
+ "babel-plugin-transform-es2015-typeof-symbol": "^6.22.0",
+ "babel-plugin-transform-es2015-unicode-regex": "^6.24.1",
+ "babel-plugin-transform-regenerator": "^6.24.1"
+ }
+ },
+ "babel-register": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz",
+ "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=",
+ "dev": true,
+ "requires": {
+ "babel-core": "^6.26.0",
+ "babel-runtime": "^6.26.0",
+ "core-js": "^2.5.0",
+ "home-or-tmp": "^2.0.0",
+ "lodash": "^4.17.4",
+ "mkdirp": "^0.5.1",
+ "source-map-support": "^0.4.15"
+ },
+ "dependencies": {
+ "babel-runtime": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "dev": true,
+ "requires": {
+ "core-js": "^2.4.0",
+ "regenerator-runtime": "^0.11.0"
+ }
+ },
+ "core-js": {
+ "version": "2.5.7",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz",
+ "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==",
+ "dev": true
+ },
+ "regenerator-runtime": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
+ "dev": true
+ }
+ }
+ },
+ "babel-runtime": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz",
+ "integrity": "sha1-CpSJ8UTecO+zzkMArM2zKeL8VDs=",
+ "dev": true,
+ "requires": {
+ "core-js": "^2.4.0",
+ "regenerator-runtime": "^0.10.0"
+ }
+ },
+ "babel-template": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz",
+ "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "babel-traverse": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "babylon": "^6.18.0",
+ "lodash": "^4.17.4"
+ },
+ "dependencies": {
+ "babel-runtime": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "dev": true,
+ "requires": {
+ "core-js": "^2.4.0",
+ "regenerator-runtime": "^0.11.0"
+ }
+ },
+ "babel-types": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz",
+ "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.4",
+ "to-fast-properties": "^1.0.3"
+ }
+ },
+ "regenerator-runtime": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
+ "dev": true
+ },
+ "to-fast-properties": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
+ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "dev": true
+ }
+ }
+ },
+ "babel-traverse": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz",
+ "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=",
+ "dev": true,
+ "requires": {
+ "babel-code-frame": "^6.26.0",
+ "babel-messages": "^6.23.0",
+ "babel-runtime": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "babylon": "^6.18.0",
+ "debug": "^2.6.8",
+ "globals": "^9.18.0",
+ "invariant": "^2.2.2",
+ "lodash": "^4.17.4"
+ },
+ "dependencies": {
+ "babel-runtime": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "dev": true,
+ "requires": {
+ "core-js": "^2.4.0",
+ "regenerator-runtime": "^0.11.0"
+ }
+ },
+ "babel-types": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz",
+ "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.4",
+ "to-fast-properties": "^1.0.3"
+ }
+ },
+ "regenerator-runtime": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
+ "dev": true
+ },
+ "to-fast-properties": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
+ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "dev": true
+ }
+ }
+ },
+ "babel-types": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.24.1.tgz",
+ "integrity": "sha1-oTaHncFbNga9oNkMH8dDBML/CXU=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "esutils": "^2.0.2",
+ "lodash": "^4.2.0",
+ "to-fast-properties": "^1.0.1"
+ }
+ },
+ "babylon": {
+ "version": "6.18.0",
+ "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz",
+ "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==",
+ "dev": true
+ },
+ "balanced-match": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz",
+ "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=",
+ "dev": true
+ },
+ "base64-js": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz",
+ "integrity": "sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE=",
+ "dev": true
+ },
+ "big.js": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.1.3.tgz",
+ "integrity": "sha1-TK2iGTZS6zyp7I5VyQFWacmAaXg=",
+ "dev": true
+ },
+ "binary-extensions": {
+ "version": "1.11.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz",
+ "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=",
+ "dev": true
+ },
+ "bn.js": {
+ "version": "4.11.6",
+ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz",
+ "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=",
+ "dev": true
+ },
+ "brace-expansion": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz",
+ "integrity": "sha1-Pv/DxQ4ABTH7cg6v+A8K6O8jz1k=",
+ "dev": true,
+ "requires": {
+ "balanced-match": "^0.4.1",
+ "concat-map": "0.0.1"
+ }
+ },
+ "braces": {
+ "version": "1.8.5",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
+ "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=",
+ "dev": true,
+ "requires": {
+ "expand-range": "^1.8.1",
+ "preserve": "^0.2.0",
+ "repeat-element": "^1.1.2"
+ }
+ },
+ "brorand": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
+ "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
+ "dev": true
+ },
+ "browserify-aes": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz",
+ "integrity": "sha1-Xncl297x/Vkw1OurSFZ85FHEigo=",
+ "dev": true,
+ "requires": {
+ "buffer-xor": "^1.0.2",
+ "cipher-base": "^1.0.0",
+ "create-hash": "^1.1.0",
+ "evp_bytestokey": "^1.0.0",
+ "inherits": "^2.0.1"
+ }
+ },
+ "browserify-cipher": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz",
+ "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=",
+ "dev": true,
+ "requires": {
+ "browserify-aes": "^1.0.4",
+ "browserify-des": "^1.0.0",
+ "evp_bytestokey": "^1.0.0"
+ }
+ },
+ "browserify-des": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz",
+ "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=",
+ "dev": true,
+ "requires": {
+ "cipher-base": "^1.0.1",
+ "des.js": "^1.0.0",
+ "inherits": "^2.0.1"
+ }
+ },
+ "browserify-rsa": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz",
+ "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.1.0",
+ "randombytes": "^2.0.1"
+ }
+ },
+ "browserify-sign": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz",
+ "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.1.1",
+ "browserify-rsa": "^4.0.0",
+ "create-hash": "^1.1.0",
+ "create-hmac": "^1.1.2",
+ "elliptic": "^6.0.0",
+ "inherits": "^2.0.1",
+ "parse-asn1": "^5.0.0"
+ }
+ },
+ "browserify-zlib": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz",
+ "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=",
+ "dev": true,
+ "requires": {
+ "pako": "~0.2.0"
+ }
+ },
+ "browserslist": {
+ "version": "3.2.8",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz",
+ "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==",
+ "dev": true,
+ "requires": {
+ "caniuse-lite": "^1.0.30000844",
+ "electron-to-chromium": "^1.3.47"
+ }
+ },
+ "buffer": {
+ "version": "4.9.1",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz",
+ "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=",
+ "dev": true,
+ "requires": {
+ "base64-js": "^1.0.2",
+ "ieee754": "^1.1.4",
+ "isarray": "^1.0.0"
+ }
+ },
+ "buffer-shims": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz",
+ "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=",
+ "dev": true
+ },
+ "buffer-xor": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz",
+ "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=",
+ "dev": true
+ },
+ "builtin-modules": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
+ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
+ "dev": true
+ },
+ "builtin-status-codes": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz",
+ "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=",
+ "dev": true
+ },
+ "camelcase": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
+ "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=",
+ "dev": true
+ },
+ "caniuse-lite": {
+ "version": "1.0.30000874",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000874.tgz",
+ "integrity": "sha512-29nr1EPiHwrJTAHHsEmTt2h+55L8j2GNFdAcYPlRy2NX6iFz7ZZiepVI7kP/QqlnHLq3KvfWpbmGa0d063U09w==",
+ "dev": true
+ },
+ "center-align": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz",
+ "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=",
+ "dev": true,
+ "requires": {
+ "align-text": "^0.1.3",
+ "lazy-cache": "^1.0.3"
+ }
+ },
+ "chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ }
+ },
+ "chokidar": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz",
+ "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=",
+ "dev": true,
+ "requires": {
+ "anymatch": "^1.3.0",
+ "async-each": "^1.0.0",
+ "fsevents": "^1.0.0",
+ "glob-parent": "^2.0.0",
+ "inherits": "^2.0.1",
+ "is-binary-path": "^1.0.0",
+ "is-glob": "^2.0.0",
+ "path-is-absolute": "^1.0.0",
+ "readdirp": "^2.0.0"
+ }
+ },
+ "cipher-base": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.3.tgz",
+ "integrity": "sha1-7qvxlEGc6QDaMBjCB9IS8qbfCgc=",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.1"
+ }
+ },
+ "cliui": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz",
+ "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=",
+ "dev": true,
+ "requires": {
+ "center-align": "^0.1.1",
+ "right-align": "^0.1.1",
+ "wordwrap": "0.0.2"
+ }
+ },
+ "co": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
+ "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
+ "dev": true
+ },
+ "code-point-at": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
+ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
+ "dev": true
+ },
+ "commondir": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
+ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
+ "dev": true
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "dev": true
+ },
+ "console-browserify": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz",
+ "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=",
+ "dev": true,
+ "requires": {
+ "date-now": "^0.1.4"
+ }
+ },
+ "constants-browserify": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz",
+ "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=",
+ "dev": true
+ },
+ "convert-source-map": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz",
+ "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=",
+ "dev": true
+ },
+ "core-js": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz",
+ "integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=",
+ "dev": true
+ },
+ "core-util-is": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
+ "dev": true
+ },
+ "create-ecdh": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz",
+ "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.1.0",
+ "elliptic": "^6.0.0"
+ }
+ },
+ "create-hash": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz",
+ "integrity": "sha1-USEAYte7dHn2xlu0GpIgix1hq60=",
+ "dev": true,
+ "requires": {
+ "cipher-base": "^1.0.1",
+ "inherits": "^2.0.1",
+ "ripemd160": "^1.0.0",
+ "sha.js": "^2.3.6"
+ }
+ },
+ "create-hmac": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.4.tgz",
+ "integrity": "sha1-0/tLolPriz9W456i+8uK90e9MXA=",
+ "dev": true,
+ "requires": {
+ "create-hash": "^1.1.0",
+ "inherits": "^2.0.1"
+ }
+ },
+ "crypto-browserify": {
+ "version": "3.11.0",
+ "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.0.tgz",
+ "integrity": "sha1-NlKgkGq5sqfgw85mpAjpV6JIVSI=",
+ "dev": true,
+ "requires": {
+ "browserify-cipher": "^1.0.0",
+ "browserify-sign": "^4.0.0",
+ "create-ecdh": "^4.0.0",
+ "create-hash": "^1.1.0",
+ "create-hmac": "^1.1.0",
+ "diffie-hellman": "^5.0.0",
+ "inherits": "^2.0.1",
+ "pbkdf2": "^3.0.3",
+ "public-encrypt": "^4.0.0",
+ "randombytes": "^2.0.0"
+ }
+ },
+ "csv": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/csv/-/csv-3.1.0.tgz",
+ "integrity": "sha512-SfnePMkhjljB7ehvubZESGjgrnM7V/gBe5ubZWKxeKwgmTl/HtVCdfSaGRgH/i/vG7qJaSLMpP0krNbAuunRBg==",
+ "requires": {
+ "csv-generate": "^2.0.2",
+ "csv-parse": "^2.4.0",
+ "csv-stringify": "^3.0.0",
+ "stream-transform": "^1.0.2"
+ }
+ },
+ "csv-generate": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/csv-generate/-/csv-generate-2.1.0.tgz",
+ "integrity": "sha512-avXXdQMta14DhePrX3yvzJHV5VEAhJQwBCwgqcZE7xyNTYGpxcUxmYvOSKQw+CisAjdpfn6/ZUNEJa2W6jDzNg=="
+ },
+ "csv-parse": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-2.5.0.tgz",
+ "integrity": "sha512-4OcjOJQByI0YDU5COYw9HAqjo8/MOLLmT9EKyMCXUzgvh30vS1SlMK+Ho84IH5exN44cSnrYecw/7Zpu2m4lkA=="
+ },
+ "csv-stringify": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-3.1.1.tgz",
+ "integrity": "sha512-Ni9r/BdQM2cGnWzwAP09zp12LVOAMHLJ86azNHGC7s4OUo2WidGfcM3QwYEjD8c4ELCL/a4AzfIsVCzroeys+g==",
+ "requires": {
+ "lodash.get": "~4.4.2"
+ }
+ },
+ "date-now": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz",
+ "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=",
+ "dev": true
+ },
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "decamelize": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
+ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
+ "dev": true
+ },
+ "des.js": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz",
+ "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.1",
+ "minimalistic-assert": "^1.0.0"
+ }
+ },
+ "detect-indent": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz",
+ "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=",
+ "dev": true,
+ "requires": {
+ "repeating": "^2.0.0"
+ }
+ },
+ "diffie-hellman": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz",
+ "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.1.0",
+ "miller-rabin": "^4.0.0",
+ "randombytes": "^2.0.0"
+ }
+ },
+ "domain-browser": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz",
+ "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=",
+ "dev": true
+ },
+ "electron-to-chromium": {
+ "version": "1.3.56",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.56.tgz",
+ "integrity": "sha512-h4FnvXgyfJaA1egXqCwfpecFu1k6U4sPqwvCeux2yEWbu+Avlsa9i07iB5M+M1M2iyfEUnuQDWYCkPCkfO5cpg==",
+ "dev": true
+ },
+ "elliptic": {
+ "version": "6.4.0",
+ "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",
+ "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.4.0",
+ "brorand": "^1.0.1",
+ "hash.js": "^1.0.0",
+ "hmac-drbg": "^1.0.0",
+ "inherits": "^2.0.1",
+ "minimalistic-assert": "^1.0.0",
+ "minimalistic-crypto-utils": "^1.0.0"
+ }
+ },
+ "emojis-list": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz",
+ "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=",
+ "dev": true
+ },
+ "enhanced-resolve": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.1.0.tgz",
+ "integrity": "sha1-n0tib1dyRe3PSyrYPYbhf09CHew=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "memory-fs": "^0.4.0",
+ "object-assign": "^4.0.1",
+ "tapable": "^0.2.5"
+ }
+ },
+ "errno": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz",
+ "integrity": "sha1-uJbiOp5ei6M4cfyZar02NfyaHH0=",
+ "dev": true,
+ "requires": {
+ "prr": "~0.0.0"
+ }
+ },
+ "error-ex": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz",
+ "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=",
+ "dev": true,
+ "requires": {
+ "is-arrayish": "^0.2.1"
+ }
+ },
+ "escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true
+ },
+ "esutils": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
+ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
+ "dev": true
+ },
+ "events": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",
+ "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=",
+ "dev": true
+ },
+ "evp_bytestokey": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz",
+ "integrity": "sha1-SXtmrZ/vZc18CKYYCCS6FHa2blM=",
+ "dev": true,
+ "requires": {
+ "create-hash": "^1.1.1"
+ }
+ },
+ "expand-brackets": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
+ "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=",
+ "dev": true,
+ "requires": {
+ "is-posix-bracket": "^0.1.0"
+ }
+ },
+ "expand-range": {
+ "version": "1.8.2",
+ "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
+ "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=",
+ "dev": true,
+ "requires": {
+ "fill-range": "^2.1.0"
+ }
+ },
+ "extglob": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
+ "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^1.0.0"
+ }
+ },
+ "file-saver": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-1.3.8.tgz",
+ "integrity": "sha512-spKHSBQIxxS81N/O21WmuXA2F6wppUCsutpzenOeZzOCCJ5gEfcbqJP983IrpLXzYmXnMUa6J03SubcNPdKrlg=="
+ },
+ "filename-regex": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz",
+ "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=",
+ "dev": true
+ },
+ "fill-range": {
+ "version": "2.2.4",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz",
+ "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==",
+ "dev": true,
+ "requires": {
+ "is-number": "^2.1.0",
+ "isobject": "^2.0.0",
+ "randomatic": "^3.0.0",
+ "repeat-element": "^1.1.2",
+ "repeat-string": "^1.5.2"
+ }
+ },
+ "find-cache-dir": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz",
+ "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=",
+ "dev": true,
+ "requires": {
+ "commondir": "^1.0.1",
+ "mkdirp": "^0.5.1",
+ "pkg-dir": "^1.0.0"
+ }
+ },
+ "find-up": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
+ "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
+ "dev": true,
+ "requires": {
+ "path-exists": "^2.0.0",
+ "pinkie-promise": "^2.0.0"
+ }
+ },
+ "for-in": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
+ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=",
+ "dev": true
+ },
+ "for-own": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz",
+ "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=",
+ "dev": true,
+ "requires": {
+ "for-in": "^1.0.1"
+ }
+ },
+ "fsevents": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz",
+ "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "nan": "^2.9.2",
+ "node-pre-gyp": "^0.10.0"
+ },
+ "dependencies": {
+ "abbrev": {
+ "version": "1.1.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "ansi-regex": {
+ "version": "2.1.1",
+ "bundled": true,
+ "dev": true
+ },
+ "aproba": {
+ "version": "1.2.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "are-we-there-yet": {
+ "version": "1.1.4",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "delegates": "^1.0.0",
+ "readable-stream": "^2.0.6"
+ }
+ },
+ "balanced-match": {
+ "version": "1.0.0",
+ "bundled": true,
+ "dev": true
+ },
+ "brace-expansion": {
+ "version": "1.1.11",
+ "bundled": true,
+ "dev": true,
+ "requires": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "chownr": {
+ "version": "1.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "code-point-at": {
+ "version": "1.1.0",
+ "bundled": true,
+ "dev": true
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "bundled": true,
+ "dev": true
+ },
+ "console-control-strings": {
+ "version": "1.1.0",
+ "bundled": true,
+ "dev": true
+ },
+ "core-util-is": {
+ "version": "1.0.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "debug": {
+ "version": "2.6.9",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "deep-extend": {
+ "version": "0.5.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "delegates": {
+ "version": "1.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "detect-libc": {
+ "version": "1.0.3",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "fs-minipass": {
+ "version": "1.2.5",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "minipass": "^2.2.1"
+ }
+ },
+ "fs.realpath": {
+ "version": "1.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "gauge": {
+ "version": "2.7.4",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "aproba": "^1.0.3",
+ "console-control-strings": "^1.0.0",
+ "has-unicode": "^2.0.0",
+ "object-assign": "^4.1.0",
+ "signal-exit": "^3.0.0",
+ "string-width": "^1.0.1",
+ "strip-ansi": "^3.0.1",
+ "wide-align": "^1.1.0"
+ }
+ },
+ "glob": {
+ "version": "7.1.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
+ "has-unicode": {
+ "version": "2.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "iconv-lite": {
+ "version": "0.4.21",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "safer-buffer": "^2.1.0"
+ }
+ },
+ "ignore-walk": {
+ "version": "3.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "minimatch": "^3.0.4"
+ }
+ },
+ "inflight": {
+ "version": "1.0.6",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "inherits": {
+ "version": "2.0.3",
+ "bundled": true,
+ "dev": true
+ },
+ "ini": {
+ "version": "1.3.5",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "1.0.0",
+ "bundled": true,
+ "dev": true,
+ "requires": {
+ "number-is-nan": "^1.0.0"
+ }
+ },
+ "isarray": {
+ "version": "1.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "minimatch": {
+ "version": "3.0.4",
+ "bundled": true,
+ "dev": true,
+ "requires": {
+ "brace-expansion": "^1.1.7"
+ }
+ },
+ "minimist": {
+ "version": "0.0.8",
+ "bundled": true,
+ "dev": true
+ },
+ "minipass": {
+ "version": "2.2.4",
+ "bundled": true,
+ "dev": true,
+ "requires": {
+ "safe-buffer": "^5.1.1",
+ "yallist": "^3.0.0"
+ }
+ },
+ "minizlib": {
+ "version": "1.1.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "minipass": "^2.2.1"
+ }
+ },
+ "mkdirp": {
+ "version": "0.5.1",
+ "bundled": true,
+ "dev": true,
+ "requires": {
+ "minimist": "0.0.8"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "needle": {
+ "version": "2.2.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "debug": "^2.1.2",
+ "iconv-lite": "^0.4.4",
+ "sax": "^1.2.4"
+ }
+ },
+ "node-pre-gyp": {
+ "version": "0.10.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "detect-libc": "^1.0.2",
+ "mkdirp": "^0.5.1",
+ "needle": "^2.2.0",
+ "nopt": "^4.0.1",
+ "npm-packlist": "^1.1.6",
+ "npmlog": "^4.0.2",
+ "rc": "^1.1.7",
+ "rimraf": "^2.6.1",
+ "semver": "^5.3.0",
+ "tar": "^4"
+ }
+ },
+ "nopt": {
+ "version": "4.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "abbrev": "1",
+ "osenv": "^0.1.4"
+ }
+ },
+ "npm-bundled": {
+ "version": "1.0.3",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "npm-packlist": {
+ "version": "1.1.10",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "ignore-walk": "^3.0.1",
+ "npm-bundled": "^1.0.1"
+ }
+ },
+ "npmlog": {
+ "version": "4.1.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "are-we-there-yet": "~1.1.2",
+ "console-control-strings": "~1.1.0",
+ "gauge": "~2.7.3",
+ "set-blocking": "~2.0.0"
+ }
+ },
+ "number-is-nan": {
+ "version": "1.0.1",
+ "bundled": true,
+ "dev": true
+ },
+ "object-assign": {
+ "version": "4.1.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "once": {
+ "version": "1.4.0",
+ "bundled": true,
+ "dev": true,
+ "requires": {
+ "wrappy": "1"
+ }
+ },
+ "os-homedir": {
+ "version": "1.0.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "os-tmpdir": {
+ "version": "1.0.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "osenv": {
+ "version": "0.1.5",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "os-homedir": "^1.0.0",
+ "os-tmpdir": "^1.0.0"
+ }
+ },
+ "path-is-absolute": {
+ "version": "1.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "process-nextick-args": {
+ "version": "2.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "rc": {
+ "version": "1.2.7",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "deep-extend": "^0.5.1",
+ "ini": "~1.3.0",
+ "minimist": "^1.2.0",
+ "strip-json-comments": "~2.0.1"
+ },
+ "dependencies": {
+ "minimist": {
+ "version": "1.2.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ }
+ }
+ },
+ "readable-stream": {
+ "version": "2.3.6",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "rimraf": {
+ "version": "2.6.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "glob": "^7.0.5"
+ }
+ },
+ "safe-buffer": {
+ "version": "5.1.1",
+ "bundled": true,
+ "dev": true
+ },
+ "safer-buffer": {
+ "version": "2.1.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "sax": {
+ "version": "1.2.4",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "semver": {
+ "version": "5.5.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "set-blocking": {
+ "version": "2.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "signal-exit": {
+ "version": "3.0.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "string-width": {
+ "version": "1.0.2",
+ "bundled": true,
+ "dev": true,
+ "requires": {
+ "code-point-at": "^1.0.0",
+ "is-fullwidth-code-point": "^1.0.0",
+ "strip-ansi": "^3.0.0"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "bundled": true,
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "strip-json-comments": {
+ "version": "2.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "tar": {
+ "version": "4.4.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "chownr": "^1.0.1",
+ "fs-minipass": "^1.2.5",
+ "minipass": "^2.2.4",
+ "minizlib": "^1.1.0",
+ "mkdirp": "^0.5.0",
+ "safe-buffer": "^5.1.1",
+ "yallist": "^3.0.2"
+ }
+ },
+ "util-deprecate": {
+ "version": "1.0.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "wide-align": {
+ "version": "1.1.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "string-width": "^1.0.2"
+ }
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "bundled": true,
+ "dev": true
+ },
+ "yallist": {
+ "version": "3.0.2",
+ "bundled": true,
+ "dev": true
+ }
+ }
+ },
+ "get-caller-file": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz",
+ "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=",
+ "dev": true
+ },
+ "glob-base": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz",
+ "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=",
+ "dev": true,
+ "requires": {
+ "glob-parent": "^2.0.0",
+ "is-glob": "^2.0.0"
+ }
+ },
+ "glob-parent": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
+ "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
+ "dev": true,
+ "requires": {
+ "is-glob": "^2.0.0"
+ }
+ },
+ "globals": {
+ "version": "9.18.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz",
+ "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==",
+ "dev": true
+ },
+ "graceful-fs": {
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
+ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
+ "dev": true
+ },
+ "has-ansi": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
+ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "has-flag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
+ "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=",
+ "dev": true
+ },
+ "hash.js": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",
+ "integrity": "sha1-EzL/ABVsCg/92CNgE9B7d6BFFXM=",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.1"
+ }
+ },
+ "hmac-drbg": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
+ "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=",
+ "dev": true,
+ "requires": {
+ "hash.js": "^1.0.3",
+ "minimalistic-assert": "^1.0.0",
+ "minimalistic-crypto-utils": "^1.0.1"
+ }
+ },
+ "home-or-tmp": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz",
+ "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=",
+ "dev": true,
+ "requires": {
+ "os-homedir": "^1.0.0",
+ "os-tmpdir": "^1.0.1"
+ }
+ },
+ "hosted-git-info": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.4.2.tgz",
+ "integrity": "sha1-AHa59GonBQbduq6lZJaJdGBhKmc=",
+ "dev": true
+ },
+ "https-browserify": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz",
+ "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=",
+ "dev": true
+ },
+ "ieee754": {
+ "version": "1.1.8",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz",
+ "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=",
+ "dev": true
+ },
+ "indexof": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz",
+ "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=",
+ "dev": true
+ },
+ "inherits": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
+ "dev": true
+ },
+ "interpret": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz",
+ "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=",
+ "dev": true
+ },
+ "invariant": {
+ "version": "2.2.4",
+ "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
+ "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==",
+ "dev": true,
+ "requires": {
+ "loose-envify": "^1.0.0"
+ }
+ },
+ "invert-kv": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
+ "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=",
+ "dev": true
+ },
+ "is-arrayish": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
+ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
+ "dev": true
+ },
+ "is-binary-path": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz",
+ "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=",
+ "dev": true,
+ "requires": {
+ "binary-extensions": "^1.0.0"
+ }
+ },
+ "is-buffer": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz",
+ "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=",
+ "dev": true
+ },
+ "is-builtin-module": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
+ "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
+ "dev": true,
+ "requires": {
+ "builtin-modules": "^1.0.0"
+ }
+ },
+ "is-dotfile": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz",
+ "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=",
+ "dev": true
+ },
+ "is-equal-shallow": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz",
+ "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=",
+ "dev": true,
+ "requires": {
+ "is-primitive": "^2.0.0"
+ }
+ },
+ "is-extendable": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+ "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=",
+ "dev": true
+ },
+ "is-extglob": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
+ "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
+ "dev": true
+ },
+ "is-finite": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
+ "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
+ "dev": true,
+ "requires": {
+ "number-is-nan": "^1.0.0"
+ }
+ },
+ "is-fullwidth-code-point": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
+ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
+ "dev": true,
+ "requires": {
+ "number-is-nan": "^1.0.0"
+ }
+ },
+ "is-glob": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
+ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^1.0.0"
+ }
+ },
+ "is-number": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz",
+ "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=",
+ "dev": true,
+ "requires": {
+ "kind-of": "^3.0.2"
+ }
+ },
+ "is-posix-bracket": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz",
+ "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=",
+ "dev": true
+ },
+ "is-primitive": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz",
+ "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=",
+ "dev": true
+ },
+ "is-utf8": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
+ "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
+ "dev": true
+ },
+ "isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
+ "dev": true
+ },
+ "isobject": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
+ "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
+ "dev": true,
+ "requires": {
+ "isarray": "1.0.0"
+ }
+ },
+ "js-tokens": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
+ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
+ "dev": true
+ },
+ "jsesc": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
+ "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
+ "dev": true
+ },
+ "json-loader": {
+ "version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.4.tgz",
+ "integrity": "sha1-i6oTZaYy9Yo8RtIBdfxgAsluN94=",
+ "dev": true
+ },
+ "json-stable-stringify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
+ "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=",
+ "dev": true,
+ "requires": {
+ "jsonify": "~0.0.0"
+ }
+ },
+ "json5": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
+ "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=",
+ "dev": true
+ },
+ "jsonify": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
+ "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=",
+ "dev": true
+ },
+ "kind-of": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.0.tgz",
+ "integrity": "sha1-tYq+TVwEStM3JqjBUltIz4kb/wc=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ },
+ "lazy-cache": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
+ "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=",
+ "dev": true
+ },
+ "lcid": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
+ "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
+ "dev": true,
+ "requires": {
+ "invert-kv": "^1.0.0"
+ }
+ },
+ "load-json-file": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
+ "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "parse-json": "^2.2.0",
+ "pify": "^2.0.0",
+ "pinkie-promise": "^2.0.0",
+ "strip-bom": "^2.0.0"
+ }
+ },
+ "loader-runner": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz",
+ "integrity": "sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=",
+ "dev": true
+ },
+ "loader-utils": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz",
+ "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=",
+ "dev": true,
+ "requires": {
+ "big.js": "^3.1.3",
+ "emojis-list": "^2.0.0",
+ "json5": "^0.5.0"
+ }
+ },
+ "lodash": {
+ "version": "4.17.10",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
+ "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
+ "dev": true
+ },
+ "lodash.get": {
+ "version": "4.4.2",
+ "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
+ "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk="
+ },
+ "longest": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
+ "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
+ "dev": true
+ },
+ "loose-envify": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
+ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
+ "dev": true,
+ "requires": {
+ "js-tokens": "^3.0.0 || ^4.0.0"
+ }
+ },
+ "math-random": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz",
+ "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=",
+ "dev": true
+ },
+ "memory-fs": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz",
+ "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=",
+ "dev": true,
+ "requires": {
+ "errno": "^0.1.3",
+ "readable-stream": "^2.0.1"
+ }
+ },
+ "micromatch": {
+ "version": "2.3.11",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
+ "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
+ "dev": true,
+ "requires": {
+ "arr-diff": "^2.0.0",
+ "array-unique": "^0.2.1",
+ "braces": "^1.8.2",
+ "expand-brackets": "^0.1.4",
+ "extglob": "^0.3.1",
+ "filename-regex": "^2.0.0",
+ "is-extglob": "^1.0.0",
+ "is-glob": "^2.0.1",
+ "kind-of": "^3.0.2",
+ "normalize-path": "^2.0.1",
+ "object.omit": "^2.0.0",
+ "parse-glob": "^3.0.4",
+ "regex-cache": "^0.4.2"
+ }
+ },
+ "midi-writer-js": {
+ "version": "1.5.2",
+ "resolved": "https://registry.npmjs.org/midi-writer-js/-/midi-writer-js-1.5.2.tgz",
+ "integrity": "sha512-EZsfEwucw9FDtqwaMW4bCs+tFC4fBuCkOWvseMPX8xYL8Vn9C+LZrc7579zllhw9C0BJiJDddSN+hhytfhlpRg==",
+ "requires": {
+ "tonal-midi": "^0.69.7"
+ }
+ },
+ "miller-rabin": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.0.tgz",
+ "integrity": "sha1-SmL7HUKTPAVYOYL0xxb2+55sbT0=",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.0.0",
+ "brorand": "^1.0.1"
+ }
+ },
+ "minimalistic-assert": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz",
+ "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=",
+ "dev": true
+ },
+ "minimalistic-crypto-utils": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
+ "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=",
+ "dev": true
+ },
+ "minimatch": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz",
+ "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=",
+ "dev": true,
+ "requires": {
+ "brace-expansion": "^1.0.0"
+ }
+ },
+ "minimist": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
+ "dev": true
+ },
+ "mkdirp": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
+ "dev": true,
+ "requires": {
+ "minimist": "0.0.8"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ },
+ "nan": {
+ "version": "2.10.0",
+ "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
+ "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==",
+ "dev": true,
+ "optional": true
+ },
+ "nexusui": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/nexusui/-/nexusui-2.0.7.tgz",
+ "integrity": "sha512-4kv0IGiBfuasAeXnrJdYw1g2mLLx0EkNR68NatrfTqjdWuLD+bu9YCexWogI2BGT9FBi+OHLIAQxhjdfLLHxaQ=="
+ },
+ "node-libs-browser": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.0.0.tgz",
+ "integrity": "sha1-o6WeyXAkmFtG6Vg3lkb5bEthZkY=",
+ "dev": true,
+ "requires": {
+ "assert": "^1.1.1",
+ "browserify-zlib": "^0.1.4",
+ "buffer": "^4.3.0",
+ "console-browserify": "^1.1.0",
+ "constants-browserify": "^1.0.0",
+ "crypto-browserify": "^3.11.0",
+ "domain-browser": "^1.1.1",
+ "events": "^1.0.0",
+ "https-browserify": "0.0.1",
+ "os-browserify": "^0.2.0",
+ "path-browserify": "0.0.0",
+ "process": "^0.11.0",
+ "punycode": "^1.2.4",
+ "querystring-es3": "^0.2.0",
+ "readable-stream": "^2.0.5",
+ "stream-browserify": "^2.0.1",
+ "stream-http": "^2.3.1",
+ "string_decoder": "^0.10.25",
+ "timers-browserify": "^2.0.2",
+ "tty-browserify": "0.0.0",
+ "url": "^0.11.0",
+ "util": "^0.10.3",
+ "vm-browserify": "0.0.4"
+ },
+ "dependencies": {
+ "string_decoder": {
+ "version": "0.10.31",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+ "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
+ "dev": true
+ }
+ }
+ },
+ "normalize-package-data": {
+ "version": "2.3.8",
+ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.8.tgz",
+ "integrity": "sha1-2Bntoqne29H/pWPqQHHZNngilbs=",
+ "dev": true,
+ "requires": {
+ "hosted-git-info": "^2.1.4",
+ "is-builtin-module": "^1.0.0",
+ "semver": "2 || 3 || 4 || 5",
+ "validate-npm-package-license": "^3.0.1"
+ }
+ },
+ "normalize-path": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
+ "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
+ "dev": true,
+ "requires": {
+ "remove-trailing-separator": "^1.0.1"
+ }
+ },
+ "note-parser": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/note-parser/-/note-parser-2.0.1.tgz",
+ "integrity": "sha1-JDj9V6RolLQCs6IHF5hmASnI+8E="
+ },
+ "number-is-nan": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
+ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
+ "dev": true
+ },
+ "object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
+ "dev": true
+ },
+ "object.omit": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz",
+ "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=",
+ "dev": true,
+ "requires": {
+ "for-own": "^0.1.4",
+ "is-extendable": "^0.1.1"
+ }
+ },
+ "os-browserify": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz",
+ "integrity": "sha1-Y/xMzuXS13Y9Jrv4YBB45sLgBE8=",
+ "dev": true
+ },
+ "os-homedir": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
+ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
+ "dev": true
+ },
+ "os-locale": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
+ "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
+ "dev": true,
+ "requires": {
+ "lcid": "^1.0.0"
+ }
+ },
+ "os-tmpdir": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
+ "dev": true
+ },
+ "pako": {
+ "version": "0.2.9",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz",
+ "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=",
+ "dev": true
+ },
+ "parse-asn1": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz",
+ "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=",
+ "dev": true,
+ "requires": {
+ "asn1.js": "^4.0.0",
+ "browserify-aes": "^1.0.0",
+ "create-hash": "^1.1.0",
+ "evp_bytestokey": "^1.0.0",
+ "pbkdf2": "^3.0.3"
+ }
+ },
+ "parse-glob": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz",
+ "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=",
+ "dev": true,
+ "requires": {
+ "glob-base": "^0.3.0",
+ "is-dotfile": "^1.0.0",
+ "is-extglob": "^1.0.0",
+ "is-glob": "^2.0.0"
+ }
+ },
+ "parse-json": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
+ "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
+ "dev": true,
+ "requires": {
+ "error-ex": "^1.2.0"
+ }
+ },
+ "path-browserify": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz",
+ "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=",
+ "dev": true
+ },
+ "path-exists": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
+ "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
+ "dev": true,
+ "requires": {
+ "pinkie-promise": "^2.0.0"
+ }
+ },
+ "path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "dev": true
+ },
+ "path-type": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
+ "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "pify": "^2.0.0",
+ "pinkie-promise": "^2.0.0"
+ }
+ },
+ "pbkdf2": {
+ "version": "3.0.9",
+ "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.9.tgz",
+ "integrity": "sha1-8sSyWmAAWLPDdzwIbDfbvuH/5pM=",
+ "dev": true,
+ "requires": {
+ "create-hmac": "^1.1.2"
+ }
+ },
+ "pify": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+ "dev": true
+ },
+ "pinkie": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
+ "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
+ "dev": true
+ },
+ "pinkie-promise": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
+ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
+ "dev": true,
+ "requires": {
+ "pinkie": "^2.0.0"
+ }
+ },
+ "pkg-dir": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz",
+ "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=",
+ "dev": true,
+ "requires": {
+ "find-up": "^1.0.0"
+ }
+ },
+ "preserve": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz",
+ "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=",
+ "dev": true
+ },
+ "private": {
+ "version": "0.1.7",
+ "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz",
+ "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=",
+ "dev": true
+ },
+ "process": {
+ "version": "0.11.9",
+ "resolved": "https://registry.npmjs.org/process/-/process-0.11.9.tgz",
+ "integrity": "sha1-e9WtIapiU+fahoImTx4R0RwDGME=",
+ "dev": true
+ },
+ "process-nextick-args": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
+ "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=",
+ "dev": true
+ },
+ "prr": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz",
+ "integrity": "sha1-GoS4WQgyVQFBGFPQCB7j+obikmo=",
+ "dev": true
+ },
+ "public-encrypt": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz",
+ "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=",
+ "dev": true,
+ "requires": {
+ "bn.js": "^4.1.0",
+ "browserify-rsa": "^4.0.0",
+ "create-hash": "^1.1.0",
+ "parse-asn1": "^5.0.0",
+ "randombytes": "^2.0.1"
+ }
+ },
+ "punycode": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
+ "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
+ "dev": true
+ },
+ "querystring": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
+ "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=",
+ "dev": true
+ },
+ "querystring-es3": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz",
+ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=",
+ "dev": true
+ },
+ "randomatic": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.0.tgz",
+ "integrity": "sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ==",
+ "dev": true,
+ "requires": {
+ "is-number": "^4.0.0",
+ "kind-of": "^6.0.0",
+ "math-random": "^1.0.1"
+ },
+ "dependencies": {
+ "is-number": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz",
+ "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==",
+ "dev": true
+ },
+ "kind-of": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
+ "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
+ "dev": true
+ }
+ }
+ },
+ "randombytes": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz",
+ "integrity": "sha1-Z0yZdgkBw8QRJ3GjHlIdw0nMCew=",
+ "dev": true
+ },
+ "read-pkg": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
+ "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
+ "dev": true,
+ "requires": {
+ "load-json-file": "^1.0.0",
+ "normalize-package-data": "^2.3.2",
+ "path-type": "^1.0.0"
+ }
+ },
+ "read-pkg-up": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
+ "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
+ "dev": true,
+ "requires": {
+ "find-up": "^1.0.0",
+ "read-pkg": "^1.0.0"
+ }
+ },
+ "readable-stream": {
+ "version": "2.2.9",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.9.tgz",
+ "integrity": "sha1-z3jsb0ptHrQ9JkiMrJfwQudLf8g=",
+ "dev": true,
+ "requires": {
+ "buffer-shims": "~1.0.0",
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.1",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~1.0.6",
+ "string_decoder": "~1.0.0",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "readdirp": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz",
+ "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "minimatch": "^3.0.2",
+ "readable-stream": "^2.0.2",
+ "set-immediate-shim": "^1.0.1"
+ }
+ },
+ "regenerate": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.2.tgz",
+ "integrity": "sha1-0ZQcZ7rUN+G+dkM63Vs4X5WxkmA=",
+ "dev": true
+ },
+ "regenerator-runtime": {
+ "version": "0.10.3",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz",
+ "integrity": "sha1-jENnqQS1HqYqkIrDEL+Z/5CoKj4=",
+ "dev": true
+ },
+ "regenerator-transform": {
+ "version": "0.9.11",
+ "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.9.11.tgz",
+ "integrity": "sha1-On0GdSDLe3F2dp61/4aGkb7+EoM=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.18.0",
+ "babel-types": "^6.19.0",
+ "private": "^0.1.6"
+ }
+ },
+ "regex-cache": {
+ "version": "0.4.4",
+ "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz",
+ "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==",
+ "dev": true,
+ "requires": {
+ "is-equal-shallow": "^0.1.3"
+ }
+ },
+ "regexpu-core": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz",
+ "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=",
+ "dev": true,
+ "requires": {
+ "regenerate": "^1.2.1",
+ "regjsgen": "^0.2.0",
+ "regjsparser": "^0.1.4"
+ }
+ },
+ "regjsgen": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
+ "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=",
+ "dev": true
+ },
+ "regjsparser": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz",
+ "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=",
+ "dev": true,
+ "requires": {
+ "jsesc": "~0.5.0"
+ },
+ "dependencies": {
+ "jsesc": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
+ "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
+ "dev": true
+ }
+ }
+ },
+ "remove-trailing-separator": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
+ "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=",
+ "dev": true
+ },
+ "repeat-element": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz",
+ "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=",
+ "dev": true
+ },
+ "repeat-string": {
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
+ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
+ "dev": true
+ },
+ "repeating": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz",
+ "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=",
+ "dev": true,
+ "requires": {
+ "is-finite": "^1.0.0"
+ }
+ },
+ "require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
+ "dev": true
+ },
+ "require-main-filename": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
+ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=",
+ "dev": true
+ },
+ "right-align": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
+ "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=",
+ "dev": true,
+ "requires": {
+ "align-text": "^0.1.1"
+ }
+ },
+ "ripemd160": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-1.0.1.tgz",
+ "integrity": "sha1-k6S71JQrxXS2mo+lfHHeEOzKfW4=",
+ "dev": true
+ },
+ "semver": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
+ "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=",
+ "dev": true
+ },
+ "set-blocking": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
+ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
+ "dev": true
+ },
+ "set-immediate-shim": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz",
+ "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=",
+ "dev": true
+ },
+ "setimmediate": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
+ "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=",
+ "dev": true
+ },
+ "sha.js": {
+ "version": "2.4.8",
+ "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz",
+ "integrity": "sha1-NwaMLEdra69ALRSknGf1l5IfY08=",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.1"
+ }
+ },
+ "slash": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
+ "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=",
+ "dev": true
+ },
+ "source-list-map": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-1.1.1.tgz",
+ "integrity": "sha1-GjOsIQyhRNHlYfkG68yrVmn/TLQ=",
+ "dev": true
+ },
+ "source-map": {
+ "version": "0.5.6",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz",
+ "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=",
+ "dev": true
+ },
+ "source-map-support": {
+ "version": "0.4.18",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz",
+ "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==",
+ "dev": true,
+ "requires": {
+ "source-map": "^0.5.6"
+ }
+ },
+ "spdx-correct": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz",
+ "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=",
+ "dev": true,
+ "requires": {
+ "spdx-license-ids": "^1.0.2"
+ }
+ },
+ "spdx-expression-parse": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz",
+ "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=",
+ "dev": true
+ },
+ "spdx-license-ids": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz",
+ "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=",
+ "dev": true
+ },
+ "stream-browserify": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz",
+ "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=",
+ "dev": true,
+ "requires": {
+ "inherits": "~2.0.1",
+ "readable-stream": "^2.0.2"
+ }
+ },
+ "stream-http": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.0.tgz",
+ "integrity": "sha1-zsH047SUvEqBtFGAiXD4sgtO1fY=",
+ "dev": true,
+ "requires": {
+ "builtin-status-codes": "^3.0.0",
+ "inherits": "^2.0.1",
+ "readable-stream": "^2.2.6",
+ "to-arraybuffer": "^1.0.0",
+ "xtend": "^4.0.0"
+ }
+ },
+ "stream-transform": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/stream-transform/-/stream-transform-1.0.2.tgz",
+ "integrity": "sha512-LNcZSF01PZ+bM0OqwPY7UHPiKoxSmLGHAcqakvh01DCU98ONEslLORdyBPdmTqjTpZSfCiaYLV4sci9y5M47oA=="
+ },
+ "string-width": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+ "dev": true,
+ "requires": {
+ "code-point-at": "^1.0.0",
+ "is-fullwidth-code-point": "^1.0.0",
+ "strip-ansi": "^3.0.0"
+ }
+ },
+ "string_decoder": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.0.tgz",
+ "integrity": "sha1-8G9BFXtmTYYGn4S9vcmw2KsoFmc=",
+ "dev": true,
+ "requires": {
+ "buffer-shims": "~1.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "strip-bom": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
+ "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
+ "dev": true,
+ "requires": {
+ "is-utf8": "^0.2.0"
+ }
+ },
+ "supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true
+ },
+ "tapable": {
+ "version": "0.2.6",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.6.tgz",
+ "integrity": "sha1-IGvo4YiGC1FEJTdebxrom/sB/Y0=",
+ "dev": true
+ },
+ "timers-browserify": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.2.tgz",
+ "integrity": "sha1-q0iDz1l9zVCvIRNJoA+8pWrIa4Y=",
+ "dev": true,
+ "requires": {
+ "setimmediate": "^1.0.4"
+ }
+ },
+ "to-arraybuffer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz",
+ "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=",
+ "dev": true
+ },
+ "to-fast-properties": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.2.tgz",
+ "integrity": "sha1-8/XAw7pymafvmUJ+RGMyV63kMyA=",
+ "dev": true
+ },
+ "tonal-midi": {
+ "version": "0.69.7",
+ "resolved": "https://registry.npmjs.org/tonal-midi/-/tonal-midi-0.69.7.tgz",
+ "integrity": "sha1-51Tsk/Pb2yim051CRXwzrSRf+kc=",
+ "requires": {
+ "note-parser": "^2.0.1"
+ }
+ },
+ "tone": {
+ "version": "0.12.80",
+ "resolved": "https://registry.npmjs.org/tone/-/tone-0.12.80.tgz",
+ "integrity": "sha512-xCriTn1may1ZzfYYwxXW8pNj0W1XScc21ZLSd/itoTa3s0vMO1LlN23UYvHwUduL45xuY+Rw/e87LmqP3mW43Q=="
+ },
+ "trim-right": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz",
+ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=",
+ "dev": true
+ },
+ "tty-browserify": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
+ "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=",
+ "dev": true
+ },
+ "uglify-js": {
+ "version": "2.8.22",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.22.tgz",
+ "integrity": "sha1-1Uk0d4qNoUkD+imjJvskwKtRoaA=",
+ "dev": true,
+ "requires": {
+ "source-map": "~0.5.1",
+ "uglify-to-browserify": "~1.0.0",
+ "yargs": "~3.10.0"
+ },
+ "dependencies": {
+ "yargs": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz",
+ "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=",
+ "dev": true,
+ "requires": {
+ "camelcase": "^1.0.2",
+ "cliui": "^2.1.0",
+ "decamelize": "^1.0.0",
+ "window-size": "0.1.0"
+ }
+ }
+ }
+ },
+ "uglify-to-browserify": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz",
+ "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=",
+ "dev": true,
+ "optional": true
+ },
+ "url": {
+ "version": "0.11.0",
+ "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz",
+ "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=",
+ "dev": true,
+ "requires": {
+ "punycode": "1.3.2",
+ "querystring": "0.2.0"
+ },
+ "dependencies": {
+ "punycode": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
+ "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=",
+ "dev": true
+ }
+ }
+ },
+ "util": {
+ "version": "0.10.3",
+ "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
+ "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=",
+ "dev": true,
+ "requires": {
+ "inherits": "2.0.1"
+ },
+ "dependencies": {
+ "inherits": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
+ "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=",
+ "dev": true
+ }
+ }
+ },
+ "util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
+ "dev": true
+ },
+ "validate-npm-package-license": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz",
+ "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=",
+ "dev": true,
+ "requires": {
+ "spdx-correct": "~1.0.0",
+ "spdx-expression-parse": "~1.0.0"
+ }
+ },
+ "vm-browserify": {
+ "version": "0.0.4",
+ "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
+ "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=",
+ "dev": true,
+ "requires": {
+ "indexof": "0.0.1"
+ }
+ },
+ "watchpack": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.3.1.tgz",
+ "integrity": "sha1-fYaTkHsozmAT5/NhCqKhrPB9rYc=",
+ "dev": true,
+ "requires": {
+ "async": "^2.1.2",
+ "chokidar": "^1.4.3",
+ "graceful-fs": "^4.1.2"
+ }
+ },
+ "webfontloader": {
+ "version": "1.6.27",
+ "resolved": "https://registry.npmjs.org/webfontloader/-/webfontloader-1.6.27.tgz",
+ "integrity": "sha1-w4mWSbBlOqV9CiM4j4JAng3yJLo="
+ },
+ "webmidi": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/webmidi/-/webmidi-2.2.0.tgz",
+ "integrity": "sha512-/HncJbftTyijTAhk/oKAZFBk5sE3UgWFlBUcd82YVEz1epAXMk0thXLpSKe3nGPR8V4R/LLBCbdzqQ9ZeBQOsw=="
+ },
+ "webpack": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-2.4.1.tgz",
+ "integrity": "sha1-FakdvjSWbYpLmcfWVu/ZKi5ab2o=",
+ "dev": true,
+ "requires": {
+ "acorn": "^5.0.0",
+ "acorn-dynamic-import": "^2.0.0",
+ "ajv": "^4.7.0",
+ "ajv-keywords": "^1.1.1",
+ "async": "^2.1.2",
+ "enhanced-resolve": "^3.0.0",
+ "interpret": "^1.0.0",
+ "json-loader": "^0.5.4",
+ "json5": "^0.5.1",
+ "loader-runner": "^2.3.0",
+ "loader-utils": "^0.2.16",
+ "memory-fs": "~0.4.1",
+ "mkdirp": "~0.5.0",
+ "node-libs-browser": "^2.0.0",
+ "source-map": "^0.5.3",
+ "supports-color": "^3.1.0",
+ "tapable": "~0.2.5",
+ "uglify-js": "^2.8.5",
+ "watchpack": "^1.3.1",
+ "webpack-sources": "^0.2.3",
+ "yargs": "^6.0.0"
+ },
+ "dependencies": {
+ "loader-utils": {
+ "version": "0.2.17",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz",
+ "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=",
+ "dev": true,
+ "requires": {
+ "big.js": "^3.1.3",
+ "emojis-list": "^2.0.0",
+ "json5": "^0.5.0",
+ "object-assign": "^4.0.1"
+ }
+ },
+ "supports-color": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz",
+ "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=",
+ "dev": true,
+ "requires": {
+ "has-flag": "^1.0.0"
+ }
+ }
+ }
+ },
+ "webpack-sources": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-0.2.3.tgz",
+ "integrity": "sha1-F8Yr+vE8cH+dAsR54Nzd6DgGl/s=",
+ "dev": true,
+ "requires": {
+ "source-list-map": "^1.1.1",
+ "source-map": "~0.5.3"
+ }
+ },
+ "which-module": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz",
+ "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=",
+ "dev": true
+ },
+ "window-size": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz",
+ "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=",
+ "dev": true
+ },
+ "wordwrap": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz",
+ "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=",
+ "dev": true
+ },
+ "wrap-ansi": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
+ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
+ "dev": true,
+ "requires": {
+ "string-width": "^1.0.1",
+ "strip-ansi": "^3.0.1"
+ }
+ },
+ "xtend": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
+ "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=",
+ "dev": true
+ },
+ "y18n": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
+ "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=",
+ "dev": true
+ },
+ "yargs": {
+ "version": "6.6.0",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz",
+ "integrity": "sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg=",
+ "dev": true,
+ "requires": {
+ "camelcase": "^3.0.0",
+ "cliui": "^3.2.0",
+ "decamelize": "^1.1.1",
+ "get-caller-file": "^1.0.1",
+ "os-locale": "^1.4.0",
+ "read-pkg-up": "^1.0.1",
+ "require-directory": "^2.1.1",
+ "require-main-filename": "^1.0.1",
+ "set-blocking": "^2.0.0",
+ "string-width": "^1.0.2",
+ "which-module": "^1.0.0",
+ "y18n": "^3.2.1",
+ "yargs-parser": "^4.2.0"
+ },
+ "dependencies": {
+ "camelcase": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
+ "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=",
+ "dev": true
+ },
+ "cliui": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
+ "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
+ "dev": true,
+ "requires": {
+ "string-width": "^1.0.1",
+ "strip-ansi": "^3.0.1",
+ "wrap-ansi": "^2.0.0"
+ }
+ }
+ }
+ },
+ "yargs-parser": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz",
+ "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=",
+ "dev": true,
+ "requires": {
+ "camelcase": "^3.0.0"
+ },
+ "dependencies": {
+ "camelcase": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
+ "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=",
+ "dev": true
+ }
+ }
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..e986c4c
--- /dev/null
+++ b/package.json
@@ -0,0 +1,28 @@
+{
+ "name": "civic-violence",
+ "version": "1.0.0",
+ "description": "",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "",
+ "license": "UNLICENSED",
+ "devDependencies": {
+ "babel-core": "^6.26.3",
+ "babel-loader": "^7.0.0",
+ "babel-preset-env": "^1.7.0",
+ "babel-preset-es2015": "^6.24.1",
+ "webpack": "^2.4.1"
+ },
+ "dependencies": {
+ "csv": "^3.1.0",
+ "csv-parse": "^2.5.0",
+ "file-saver": "^1.3.8",
+ "midi-writer-js": "^1.5.2",
+ "nexusui": "^2.0.0",
+ "tone": "^0.12.80",
+ "webfontloader": "^1.6.27",
+ "webmidi": "^2.2.0"
+ }
+}
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 0000000..3b2bf92
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,24 @@
+var webpack = require('webpack');
+
+module.exports = {
+ entry: './client/index.js',
+ watch: true,
+ devtool: 'cheap-source-map',
+ output: {
+ filename: './bundle.js'
+ },
+ module: {
+ rules: [
+ {
+ test: /\.jsx?$/,
+ exclude: /(node_modules|bower_components)/,
+ use: {
+ loader: 'babel-loader',
+ options: {
+ presets: ['env']
+ }
+ }
+ }
+ ]
+ },
+}