diff --git a/hydra-server/app/keymaps.js b/hydra-server/app/keymaps.js index 8a8aba2a7..5adbf62ac 100644 --- a/hydra-server/app/keymaps.js +++ b/hydra-server/app/keymaps.js @@ -1,6 +1,6 @@ module.exports = { init : ({ editor, gallery, menu, repl, log}) => { - window.onkeydown = (e) => { + window.addEventListener("keydown", (e) => { console.log(e) if ( e.ctrlKey === true ) { if ( e.shiftKey === true ) { @@ -73,7 +73,15 @@ module.exports = { e.preventDefault() repl.eval(editor.getCurrentBlock().text) } + + // shift - alt - a: toggle comment -> Visual Studio Code style + if (e.shiftKey === true) { + if ( e.keyCode === 65) { + e.preventDefault() + editor.cm.toggleComment() + } + } } - } + }); } } diff --git a/hydra-server/app/src/editor.js b/hydra-server/app/src/editor.js index d6aeb185c..a4afcc845 100755 --- a/hydra-server/app/src/editor.js +++ b/hydra-server/app/src/editor.js @@ -4,11 +4,13 @@ require('codemirror/mode/javascript/javascript') require('codemirror/addon/hint/javascript-hint') require('codemirror/addon/hint/show-hint') require('codemirror/addon/selection/mark-selection') +require('codemirror/addon/selection/active-line') +require('codemirror/addon/edit/matchbrackets') +require('codemirror/addon/edit/closebrackets') require('codemirror/addon/comment/comment') var Mutator = require('./Mutator.js'); - var isShowing = true var EditorClass = function () { @@ -27,7 +29,11 @@ var EditorClass = function () { value: 'hello', mode: {name: 'javascript', globalVars: true}, lineWrapping: true, - styleSelectedText: true + styleSelectedText: true, + matchBrackets: true, + autoCloseBrackets: true, + styleActiveLine: true, + comment: true, }) this.cm.refresh() diff --git a/hydra-server/public/bundle.js b/hydra-server/public/bundle.js index 2ce74bc97..598bc03c0 100644 --- a/hydra-server/public/bundle.js +++ b/hydra-server/public/bundle.js @@ -73,10 +73,10 @@ function init () { window.onload = init -},{"./keymaps.js":2,"./src/editor.js":5,"./src/gallery.js":7,"./src/log.js":8,"./src/menu.js":9,"./src/p5-wrapper.js":10,"./src/pb-live.js":11,"./src/repl.js":12,"hydra-synth":72,"raf-loop":102}],2:[function(require,module,exports){ +},{"./keymaps.js":2,"./src/editor.js":5,"./src/gallery.js":7,"./src/log.js":8,"./src/menu.js":9,"./src/p5-wrapper.js":10,"./src/pb-live.js":11,"./src/repl.js":12,"hydra-synth":75,"raf-loop":105}],2:[function(require,module,exports){ module.exports = { init : ({ editor, gallery, menu, repl, log}) => { - window.onkeydown = (e) => { + window.addEventListener("keydown", (e) => { console.log(e) if ( e.ctrlKey === true ) { if ( e.shiftKey === true ) { @@ -149,8 +149,16 @@ module.exports = { e.preventDefault() repl.eval(editor.getCurrentBlock().text) } + + // shift - alt - a: toggle comment -> Visual Studio Code style + if (e.shiftKey === true) { + if ( e.keyCode === 65) { + e.preventDefault() + editor.cm.toggleComment() + } + } } - } + }); } } @@ -382,11 +390,13 @@ require('codemirror/mode/javascript/javascript') require('codemirror/addon/hint/javascript-hint') require('codemirror/addon/hint/show-hint') require('codemirror/addon/selection/mark-selection') +require('codemirror/addon/selection/active-line') +require('codemirror/addon/edit/matchbrackets') +require('codemirror/addon/edit/closebrackets') require('codemirror/addon/comment/comment') var Mutator = require('./Mutator.js'); - var isShowing = true var EditorClass = function () { @@ -405,7 +415,11 @@ var EditorClass = function () { value: 'hello', mode: {name: 'javascript', globalVars: true}, lineWrapping: true, - styleSelectedText: true + styleSelectedText: true, + matchBrackets: true, + autoCloseBrackets: true, + styleActiveLine: true, + comment: true, }) this.cm.refresh() @@ -511,7 +525,7 @@ EditorClass.prototype.getCurrentBlock = function () { // thanks to graham wakefi module.exports = EditorClass -},{"./Mutator.js":3,"codemirror/addon/comment/comment":28,"codemirror/addon/hint/javascript-hint":29,"codemirror/addon/hint/show-hint":30,"codemirror/addon/selection/mark-selection":31,"codemirror/lib/codemirror":32,"codemirror/mode/javascript/javascript":33}],6:[function(require,module,exports){ +},{"./Mutator.js":3,"codemirror/addon/comment/comment":28,"codemirror/addon/edit/closebrackets":29,"codemirror/addon/edit/matchbrackets":30,"codemirror/addon/hint/javascript-hint":31,"codemirror/addon/hint/show-hint":32,"codemirror/addon/selection/active-line":33,"codemirror/addon/selection/mark-selection":34,"codemirror/lib/codemirror":35,"codemirror/mode/javascript/javascript":36}],6:[function(require,module,exports){ module.exports=[ { "sketch_id": "example_0", @@ -822,7 +836,7 @@ class Gallery { module.exports = Gallery -},{"./examples.json":6,"superagent":144}],8:[function(require,module,exports){ +},{"./examples.json":6,"superagent":147}],8:[function(require,module,exports){ var logElement module.exports = { @@ -998,7 +1012,7 @@ class P5 extends p5lib{ module.exports = P5 -},{"p5":96,"p5/lib/addons/p5.dom":95}],11:[function(require,module,exports){ +},{"p5":99,"p5/lib/addons/p5.dom":98}],11:[function(require,module,exports){ /* globals sessionStorage */ // Extends rtc-patch-bay to include support for nicknames and persistent session storage @@ -1132,7 +1146,7 @@ PBLive.prototype._processBroadcast = function (data) { // PBExtended.prototype. module.exports = PBLive -},{"./rtc-patch-bay.js":13,"inherits":89}],12:[function(require,module,exports){ +},{"./rtc-patch-bay.js":13,"inherits":92}],12:[function(require,module,exports){ const log = require('./log.js').log module.exports = { @@ -1407,7 +1421,7 @@ PatchBay.prototype._destroy = function () { module.exports = PatchBay -},{"events":26,"inherits":89,"shortid":119,"simple-peer":129,"socket.io-client":133}],14:[function(require,module,exports){ +},{"events":26,"inherits":92,"shortid":122,"simple-peer":132,"socket.io-client":136}],14:[function(require,module,exports){ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -10839,7 +10853,7 @@ function numberIsNaN (obj) { return obj !== obj // eslint-disable-line no-self-compare } -},{"base64-js":23,"ieee754":87}],28:[function(require,module,exports){ +},{"base64-js":23,"ieee754":90}],28:[function(require,module,exports){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE @@ -11050,7 +11064,350 @@ function numberIsNaN (obj) { }); }); -},{"../../lib/codemirror":32}],29:[function(require,module,exports){ +},{"../../lib/codemirror":35}],29:[function(require,module,exports){ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + var defaults = { + pairs: "()[]{}''\"\"", + triples: "", + explode: "[]{}" + }; + + var Pos = CodeMirror.Pos; + + CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) { + if (old && old != CodeMirror.Init) { + cm.removeKeyMap(keyMap); + cm.state.closeBrackets = null; + } + if (val) { + ensureBound(getOption(val, "pairs")) + cm.state.closeBrackets = val; + cm.addKeyMap(keyMap); + } + }); + + function getOption(conf, name) { + if (name == "pairs" && typeof conf == "string") return conf; + if (typeof conf == "object" && conf[name] != null) return conf[name]; + return defaults[name]; + } + + var keyMap = {Backspace: handleBackspace, Enter: handleEnter}; + function ensureBound(chars) { + for (var i = 0; i < chars.length; i++) { + var ch = chars.charAt(i), key = "'" + ch + "'" + if (!keyMap[key]) keyMap[key] = handler(ch) + } + } + ensureBound(defaults.pairs + "`") + + function handler(ch) { + return function(cm) { return handleChar(cm, ch); }; + } + + function getConfig(cm) { + var deflt = cm.state.closeBrackets; + if (!deflt || deflt.override) return deflt; + var mode = cm.getModeAt(cm.getCursor()); + return mode.closeBrackets || deflt; + } + + function handleBackspace(cm) { + var conf = getConfig(cm); + if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; + + var pairs = getOption(conf, "pairs"); + var ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) return CodeMirror.Pass; + var around = charsAround(cm, ranges[i].head); + if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; + } + for (var i = ranges.length - 1; i >= 0; i--) { + var cur = ranges[i].head; + cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), "+delete"); + } + } + + function handleEnter(cm) { + var conf = getConfig(cm); + var explode = conf && getOption(conf, "explode"); + if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass; + + var ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) return CodeMirror.Pass; + var around = charsAround(cm, ranges[i].head); + if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass; + } + cm.operation(function() { + var linesep = cm.lineSeparator() || "\n"; + cm.replaceSelection(linesep + linesep, null); + cm.execCommand("goCharLeft"); + ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + var line = ranges[i].head.line; + cm.indentLine(line, null, true); + cm.indentLine(line + 1, null, true); + } + }); + } + + function contractSelection(sel) { + var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0; + return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)), + head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))}; + } + + function handleChar(cm, ch) { + var conf = getConfig(cm); + if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; + + var pairs = getOption(conf, "pairs"); + var pos = pairs.indexOf(ch); + if (pos == -1) return CodeMirror.Pass; + var triples = getOption(conf, "triples"); + + var identical = pairs.charAt(pos + 1) == ch; + var ranges = cm.listSelections(); + var opening = pos % 2 == 0; + + var type; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i], cur = range.head, curType; + var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); + if (opening && !range.empty()) { + curType = "surround"; + } else if ((identical || !opening) && next == ch) { + if (identical && stringStartsAfter(cm, cur)) + curType = "both"; + else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch) + curType = "skipThree"; + else + curType = "skip"; + } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 && + cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) { + if (cur.ch > 2 && /\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass; + curType = "addFour"; + } else if (identical) { + var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur) + if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both"; + else return CodeMirror.Pass; + } else if (opening && (cm.getLine(cur.line).length == cur.ch || + isClosingBracket(next, pairs) || + /\s/.test(next))) { + curType = "both"; + } else { + return CodeMirror.Pass; + } + if (!type) type = curType; + else if (type != curType) return CodeMirror.Pass; + } + + var left = pos % 2 ? pairs.charAt(pos - 1) : ch; + var right = pos % 2 ? ch : pairs.charAt(pos + 1); + cm.operation(function() { + if (type == "skip") { + cm.execCommand("goCharRight"); + } else if (type == "skipThree") { + for (var i = 0; i < 3; i++) + cm.execCommand("goCharRight"); + } else if (type == "surround") { + var sels = cm.getSelections(); + for (var i = 0; i < sels.length; i++) + sels[i] = left + sels[i] + right; + cm.replaceSelections(sels, "around"); + sels = cm.listSelections().slice(); + for (var i = 0; i < sels.length; i++) + sels[i] = contractSelection(sels[i]); + cm.setSelections(sels); + } else if (type == "both") { + cm.replaceSelection(left + right, null); + cm.triggerElectric(left + right); + cm.execCommand("goCharLeft"); + } else if (type == "addFour") { + cm.replaceSelection(left + left + left + left, "before"); + cm.execCommand("goCharRight"); + } + }); + } + + function isClosingBracket(ch, pairs) { + var pos = pairs.lastIndexOf(ch); + return pos > -1 && pos % 2 == 1; + } + + function charsAround(cm, pos) { + var str = cm.getRange(Pos(pos.line, pos.ch - 1), + Pos(pos.line, pos.ch + 1)); + return str.length == 2 ? str : null; + } + + function stringStartsAfter(cm, pos) { + var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1)) + return /\bstring/.test(token.type) && token.start == pos.ch && + (pos.ch == 0 || !/\bstring/.test(cm.getTokenTypeAt(pos))) + } +}); + +},{"../../lib/codemirror":35}],30:[function(require,module,exports){ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + var ie_lt8 = /MSIE \d/.test(navigator.userAgent) && + (document.documentMode == null || document.documentMode < 8); + + var Pos = CodeMirror.Pos; + + var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; + + function findMatchingBracket(cm, where, config) { + var line = cm.getLineHandle(where.line), pos = where.ch - 1; + var afterCursor = config && config.afterCursor + if (afterCursor == null) + afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className) + + // A cursor is defined as between two characters, but in in vim command mode + // (i.e. not insert mode), the cursor is visually represented as a + // highlighted box on top of the 2nd character. Otherwise, we allow matches + // from before or after the cursor. + var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) || + matching[line.text.charAt(++pos)]; + if (!match) return null; + var dir = match.charAt(1) == ">" ? 1 : -1; + if (config && config.strict && (dir > 0) != (pos == where.ch)) return null; + var style = cm.getTokenTypeAt(Pos(where.line, pos + 1)); + + var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config); + if (found == null) return null; + return {from: Pos(where.line, pos), to: found && found.pos, + match: found && found.ch == match.charAt(0), forward: dir > 0}; + } + + // bracketRegex is used to specify which type of bracket to scan + // should be a regexp, e.g. /[[\]]/ + // + // Note: If "where" is on an open bracket, then this bracket is ignored. + // + // Returns false when no bracket was found, null when it reached + // maxScanLines and gave up + function scanForBracket(cm, where, dir, style, config) { + var maxScanLen = (config && config.maxScanLineLength) || 10000; + var maxScanLines = (config && config.maxScanLines) || 1000; + + var stack = []; + var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/; + var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1) + : Math.max(cm.firstLine() - 1, where.line - maxScanLines); + for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) { + var line = cm.getLine(lineNo); + if (!line) continue; + var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1; + if (line.length > maxScanLen) continue; + if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0); + for (; pos != end; pos += dir) { + var ch = line.charAt(pos); + if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) { + var match = matching[ch]; + if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch); + else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch}; + else stack.pop(); + } + } + } + return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null; + } + + function matchBrackets(cm, autoclear, config) { + // Disable brace matching in long lines, since it'll cause hugely slow updates + var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000; + var marks = [], ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config); + if (match && cm.getLine(match.from.line).length <= maxHighlightLen) { + var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; + marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style})); + if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen) + marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style})); + } + } + + if (marks.length) { + // Kludge to work around the IE bug from issue #1193, where text + // input stops going to the textare whever this fires. + if (ie_lt8 && cm.state.focused) cm.focus(); + + var clear = function() { + cm.operation(function() { + for (var i = 0; i < marks.length; i++) marks[i].clear(); + }); + }; + if (autoclear) setTimeout(clear, 800); + else return clear; + } + } + + function doMatchBrackets(cm) { + cm.operation(function() { + if (cm.state.matchBrackets.currentlyHighlighted) { + cm.state.matchBrackets.currentlyHighlighted(); + cm.state.matchBrackets.currentlyHighlighted = null; + } + cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); + }); + } + + CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) { + if (old && old != CodeMirror.Init) { + cm.off("cursorActivity", doMatchBrackets); + if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) { + cm.state.matchBrackets.currentlyHighlighted(); + cm.state.matchBrackets.currentlyHighlighted = null; + } + } + if (val) { + cm.state.matchBrackets = typeof val == "object" ? val : {}; + cm.on("cursorActivity", doMatchBrackets); + } + }); + + CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);}); + CodeMirror.defineExtension("findMatchingBracket", function(pos, config, oldConfig){ + // Backwards-compatibility kludge + if (oldConfig || typeof config == "boolean") { + if (!oldConfig) { + config = config ? {strict: true} : null + } else { + oldConfig.strict = config + config = oldConfig + } + } + return findMatchingBracket(this, pos, config) + }); + CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){ + return scanForBracket(this, pos, dir, style, config); + }); +}); + +},{"../../lib/codemirror":35}],31:[function(require,module,exports){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE @@ -11209,7 +11566,7 @@ function numberIsNaN (obj) { } }); -},{"../../lib/codemirror":32}],30:[function(require,module,exports){ +},{"../../lib/codemirror":35}],32:[function(require,module,exports){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE @@ -11644,7 +12001,81 @@ function numberIsNaN (obj) { CodeMirror.defineOption("hintOptions", null); }); -},{"../../lib/codemirror":32}],31:[function(require,module,exports){ +},{"../../lib/codemirror":35}],33:[function(require,module,exports){ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + var WRAP_CLASS = "CodeMirror-activeline"; + var BACK_CLASS = "CodeMirror-activeline-background"; + var GUTT_CLASS = "CodeMirror-activeline-gutter"; + + CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { + var prev = old == CodeMirror.Init ? false : old; + if (val == prev) return + if (prev) { + cm.off("beforeSelectionChange", selectionChange); + clearActiveLines(cm); + delete cm.state.activeLines; + } + if (val) { + cm.state.activeLines = []; + updateActiveLines(cm, cm.listSelections()); + cm.on("beforeSelectionChange", selectionChange); + } + }); + + function clearActiveLines(cm) { + for (var i = 0; i < cm.state.activeLines.length; i++) { + cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS); + cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS); + cm.removeLineClass(cm.state.activeLines[i], "gutter", GUTT_CLASS); + } + } + + function sameArray(a, b) { + if (a.length != b.length) return false; + for (var i = 0; i < a.length; i++) + if (a[i] != b[i]) return false; + return true; + } + + function updateActiveLines(cm, ranges) { + var active = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + var option = cm.getOption("styleActiveLine"); + if (typeof option == "object" && option.nonEmpty ? range.anchor.line != range.head.line : !range.empty()) + continue + var line = cm.getLineHandleVisualStart(range.head.line); + if (active[active.length - 1] != line) active.push(line); + } + if (sameArray(cm.state.activeLines, active)) return; + cm.operation(function() { + clearActiveLines(cm); + for (var i = 0; i < active.length; i++) { + cm.addLineClass(active[i], "wrap", WRAP_CLASS); + cm.addLineClass(active[i], "background", BACK_CLASS); + cm.addLineClass(active[i], "gutter", GUTT_CLASS); + } + cm.state.activeLines = active; + }); + } + + function selectionChange(cm, sel) { + updateActiveLines(cm, sel.ranges); + } +}); + +},{"../../lib/codemirror":35}],34:[function(require,module,exports){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE @@ -11765,7 +12196,7 @@ function numberIsNaN (obj) { } }); -},{"../../lib/codemirror":32}],32:[function(require,module,exports){ +},{"../../lib/codemirror":35}],35:[function(require,module,exports){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE @@ -21444,7 +21875,7 @@ return CodeMirror$1; }))); -},{}],33:[function(require,module,exports){ +},{}],36:[function(require,module,exports){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE @@ -22313,7 +22744,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript }); -},{"../../lib/codemirror":32}],34:[function(require,module,exports){ +},{"../../lib/codemirror":35}],37:[function(require,module,exports){ /** * Slice reference. */ @@ -22338,7 +22769,7 @@ module.exports = function(obj, fn){ } }; -},{}],35:[function(require,module,exports){ +},{}],38:[function(require,module,exports){ /** * Expose `Emitter`. @@ -22503,7 +22934,7 @@ Emitter.prototype.hasListeners = function(event){ return !! this.listeners(event).length; }; -},{}],36:[function(require,module,exports){ +},{}],39:[function(require,module,exports){ module.exports = function(a, b){ var fn = function(){}; @@ -22511,7 +22942,7 @@ module.exports = function(a, b){ a.prototype = new fn; a.prototype.constructor = a; }; -},{}],37:[function(require,module,exports){ +},{}],40:[function(require,module,exports){ (function (Buffer){ // Copyright Joyent, Inc. and other Node contributors. // @@ -22622,7 +23053,7 @@ function objectToString(o) { } }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":90}],38:[function(require,module,exports){ +},{"../../is-buffer/index.js":93}],41:[function(require,module,exports){ /** * Helpers. */ @@ -22776,7 +23207,7 @@ function plural(ms, n, name) { return Math.ceil(ms / n) + ' ' + name + 's'; } -},{}],39:[function(require,module,exports){ +},{}],42:[function(require,module,exports){ (function (process){ /** * This is the web browser implementation of `debug()`. @@ -22965,7 +23396,7 @@ function localstorage() { } }).call(this,require('_process')) -},{"./debug":40,"_process":101}],40:[function(require,module,exports){ +},{"./debug":43,"_process":104}],43:[function(require,module,exports){ /** * This is the common logic for both the Node.js and web browser @@ -23169,7 +23600,7 @@ function coerce(val) { return val; } -},{"ms":38}],41:[function(require,module,exports){ +},{"ms":41}],44:[function(require,module,exports){ module.exports = require('./socket'); @@ -23181,7 +23612,7 @@ module.exports = require('./socket'); */ module.exports.parser = require('engine.io-parser'); -},{"./socket":42,"engine.io-parser":53}],42:[function(require,module,exports){ +},{"./socket":45,"engine.io-parser":56}],45:[function(require,module,exports){ (function (global){ /** * Module dependencies. @@ -23928,7 +24359,7 @@ Socket.prototype.filterUpgrades = function (upgrades) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./transport":43,"./transports/index":44,"component-emitter":35,"debug":50,"engine.io-parser":53,"indexof":88,"parseqs":97,"parseuri":98}],43:[function(require,module,exports){ +},{"./transport":46,"./transports/index":47,"component-emitter":38,"debug":53,"engine.io-parser":56,"indexof":91,"parseqs":100,"parseuri":101}],46:[function(require,module,exports){ /** * Module dependencies. */ @@ -24087,7 +24518,7 @@ Transport.prototype.onClose = function () { this.emit('close'); }; -},{"component-emitter":35,"engine.io-parser":53}],44:[function(require,module,exports){ +},{"component-emitter":38,"engine.io-parser":56}],47:[function(require,module,exports){ (function (global){ /** * Module dependencies @@ -24144,7 +24575,7 @@ function polling (opts) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./polling-jsonp":45,"./polling-xhr":46,"./websocket":48,"xmlhttprequest-ssl":49}],45:[function(require,module,exports){ +},{"./polling-jsonp":48,"./polling-xhr":49,"./websocket":51,"xmlhttprequest-ssl":52}],48:[function(require,module,exports){ (function (global){ /** @@ -24379,7 +24810,7 @@ JSONPPolling.prototype.doWrite = function (data, fn) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./polling":47,"component-inherit":36}],46:[function(require,module,exports){ +},{"./polling":50,"component-inherit":39}],49:[function(require,module,exports){ (function (global){ /** * Module requirements. @@ -24803,7 +25234,7 @@ function unloadHandler () { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./polling":47,"component-emitter":35,"component-inherit":36,"debug":50,"xmlhttprequest-ssl":49}],47:[function(require,module,exports){ +},{"./polling":50,"component-emitter":38,"component-inherit":39,"debug":53,"xmlhttprequest-ssl":52}],50:[function(require,module,exports){ /** * Module dependencies. */ @@ -25050,7 +25481,7 @@ Polling.prototype.uri = function () { return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query; }; -},{"../transport":43,"component-inherit":36,"debug":50,"engine.io-parser":53,"parseqs":97,"xmlhttprequest-ssl":49,"yeast":163}],48:[function(require,module,exports){ +},{"../transport":46,"component-inherit":39,"debug":53,"engine.io-parser":56,"parseqs":100,"xmlhttprequest-ssl":52,"yeast":166}],51:[function(require,module,exports){ (function (global){ /** * Module dependencies. @@ -25340,7 +25771,7 @@ WS.prototype.check = function () { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../transport":43,"component-inherit":36,"debug":50,"engine.io-parser":53,"parseqs":97,"ws":25,"yeast":163}],49:[function(require,module,exports){ +},{"../transport":46,"component-inherit":39,"debug":53,"engine.io-parser":56,"parseqs":100,"ws":25,"yeast":166}],52:[function(require,module,exports){ (function (global){ // browser shim for xmlhttprequest module @@ -25381,7 +25812,7 @@ module.exports = function (opts) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"has-cors":71}],50:[function(require,module,exports){ +},{"has-cors":74}],53:[function(require,module,exports){ (function (process){ /** * This is the web browser implementation of `debug()`. @@ -25580,7 +26011,7 @@ function localstorage() { } }).call(this,require('_process')) -},{"./debug":51,"_process":101}],51:[function(require,module,exports){ +},{"./debug":54,"_process":104}],54:[function(require,module,exports){ /** * This is the common logic for both the Node.js and web browser @@ -25807,9 +26238,9 @@ function coerce(val) { return val; } -},{"ms":52}],52:[function(require,module,exports){ -arguments[4][38][0].apply(exports,arguments) -},{"dup":38}],53:[function(require,module,exports){ +},{"ms":55}],55:[function(require,module,exports){ +arguments[4][41][0].apply(exports,arguments) +},{"dup":41}],56:[function(require,module,exports){ (function (global){ /** * Module dependencies. @@ -26419,7 +26850,7 @@ exports.decodePayloadAsBinary = function (data, binaryType, callback) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./keys":54,"./utf8":55,"after":15,"arraybuffer.slice":16,"base64-arraybuffer":22,"blob":24,"has-binary2":69}],54:[function(require,module,exports){ +},{"./keys":57,"./utf8":58,"after":15,"arraybuffer.slice":16,"base64-arraybuffer":22,"blob":24,"has-binary2":72}],57:[function(require,module,exports){ /** * Gets the keys for an object. @@ -26440,7 +26871,7 @@ module.exports = Object.keys || function keys (obj){ return arr; }; -},{}],55:[function(require,module,exports){ +},{}],58:[function(require,module,exports){ (function (global){ /*! https://mths.be/utf8js v2.1.2 by @mathias */ ;(function(root) { @@ -26699,7 +27130,7 @@ module.exports = Object.keys || function keys (obj){ }(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],56:[function(require,module,exports){ +},{}],59:[function(require,module,exports){ module.exports = function (cb) { if (typeof Promise !== 'function') { var err = new Error('Device enumeration not supported.'); @@ -26754,7 +27185,7 @@ module.exports = function (cb) { }); }; -},{}],57:[function(require,module,exports){ +},{}],60:[function(require,module,exports){ // originally pulled out of simple-peer module.exports = function getBrowserRTC () { @@ -26771,7 +27202,7 @@ module.exports = function getBrowserRTC () { return wrtc } -},{}],58:[function(require,module,exports){ +},{}],61:[function(require,module,exports){ // getUserMedia helper by @HenrikJoreteg used for navigator.getUserMedia shim var adapter = require('webrtc-adapter'); @@ -26848,7 +27279,7 @@ module.exports = function (constraints, cb) { }); }; -},{"webrtc-adapter":60}],59:[function(require,module,exports){ +},{"webrtc-adapter":63}],62:[function(require,module,exports){ /* eslint-env node */ 'use strict'; @@ -27456,7 +27887,7 @@ SDPUtils.isRejected = function(mediaSection) { // Expose public methods. module.exports = SDPUtils; -},{}],60:[function(require,module,exports){ +},{}],63:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -27550,7 +27981,7 @@ module.exports = SDPUtils; } })(); -},{"./chrome/chrome_shim":61,"./edge/edge_shim":63,"./firefox/firefox_shim":65,"./safari/safari_shim":67,"./utils":68}],61:[function(require,module,exports){ +},{"./chrome/chrome_shim":64,"./edge/edge_shim":66,"./firefox/firefox_shim":68,"./safari/safari_shim":70,"./utils":71}],64:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. @@ -27817,7 +28248,7 @@ module.exports = { shimGetUserMedia: require('./getusermedia') }; -},{"../utils.js":68,"./getusermedia":62}],62:[function(require,module,exports){ +},{"../utils.js":71,"./getusermedia":65}],65:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -28017,7 +28448,7 @@ module.exports = function() { } }; -},{"../utils.js":68}],63:[function(require,module,exports){ +},{"../utils.js":71}],66:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -29146,7 +29577,7 @@ module.exports = { shimGetUserMedia: require('./getusermedia') }; -},{"../utils":68,"./getusermedia":64,"sdp":59}],64:[function(require,module,exports){ +},{"../utils":71,"./getusermedia":67,"sdp":62}],67:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -29180,7 +29611,7 @@ module.exports = function() { }; }; -},{}],65:[function(require,module,exports){ +},{}],68:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -29344,7 +29775,7 @@ module.exports = { shimGetUserMedia: require('./getusermedia') }; -},{"../utils":68,"./getusermedia":66}],66:[function(require,module,exports){ +},{"../utils":71,"./getusermedia":69}],69:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -29507,7 +29938,7 @@ module.exports = function() { }; }; -},{"../utils":68}],67:[function(require,module,exports){ +},{"../utils":71}],70:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -29537,7 +29968,7 @@ module.exports = { // shimPeerConnection: safariShim.shimPeerConnection }; -},{}],68:[function(require,module,exports){ +},{}],71:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -29670,7 +30101,7 @@ module.exports = { extractVersion: utils.extractVersion }; -},{}],69:[function(require,module,exports){ +},{}],72:[function(require,module,exports){ (function (global){ /* global Blob File */ @@ -29736,14 +30167,14 @@ function hasBinary (obj) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"isarray":70}],70:[function(require,module,exports){ +},{"isarray":73}],73:[function(require,module,exports){ var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; -},{}],71:[function(require,module,exports){ +},{}],74:[function(require,module,exports){ /** * Module exports. @@ -29762,7 +30193,7 @@ try { module.exports = false; } -},{}],72:[function(require,module,exports){ +},{}],75:[function(require,module,exports){ const Output = require('./src/output.js') const loop = require('raf-loop') const Source = require('./src/hydra-source.js') @@ -30100,7 +30531,7 @@ class HydraSynth { module.exports = HydraSynth -},{"./src/GeneratorFactory.js":73,"./src/audio.js":74,"./src/hydra-source.js":78,"./src/output.js":81,"./src/video-recorder.js":85,"getusermedia":58,"mouse-change":93,"raf-loop":102,"regl":114}],73:[function(require,module,exports){ +},{"./src/GeneratorFactory.js":76,"./src/audio.js":77,"./src/hydra-source.js":81,"./src/output.js":84,"./src/video-recorder.js":88,"getusermedia":61,"mouse-change":96,"raf-loop":105,"regl":117}],76:[function(require,module,exports){ /* globals tex */ const { seq, sin, ramp, createFades } = require('./timingUtils.js') const glslTransforms = require('./composable-glsl-functions.js') @@ -30406,7 +30837,7 @@ Generator.prototype.out = function (_output) { module.exports = GeneratorFactory -},{"./composable-glsl-functions.js":75,"./counter.js":76,"./renderpass-functions.js":82,"./shaderManager.js":83,"./timingUtils.js":84}],74:[function(require,module,exports){ +},{"./composable-glsl-functions.js":78,"./counter.js":79,"./renderpass-functions.js":85,"./shaderManager.js":86,"./timingUtils.js":87}],77:[function(require,module,exports){ const Meyda = require('meyda') const getUserMedia = require('getusermedia') @@ -30629,7 +31060,7 @@ class Audio { module.exports = Audio -},{"getusermedia":58,"meyda":92}],75:[function(require,module,exports){ +},{"getusermedia":61,"meyda":95}],78:[function(require,module,exports){ // to add: ripple: https://www.shadertoy.com/view/4djGzz // mask // convolution @@ -31710,7 +32141,7 @@ float _noise(vec3 v){ } } -},{}],76:[function(require,module,exports){ +},{}],79:[function(require,module,exports){ // singleton class that generates ids to use has unique variable names for variables // counter.js @@ -31721,7 +32152,7 @@ module.exports = { get: () => value } -},{}],77:[function(require,module,exports){ +},{}],80:[function(require,module,exports){ module.exports = { src: { transformType: 'color', @@ -32078,7 +32509,7 @@ module.exports = { } } -},{}],78:[function(require,module,exports){ +},{}],81:[function(require,module,exports){ const Webcam = require('./webcam.js') const Screen = require('./lib/screenmedia.js') @@ -32162,7 +32593,7 @@ class HydraSource { module.exports = HydraSource -},{"./lib/screenmedia.js":80,"./webcam.js":86}],79:[function(require,module,exports){ +},{"./lib/screenmedia.js":83,"./webcam.js":89}],82:[function(require,module,exports){ var adapter = require('webrtc-adapter'); // to do: clean up this code // cache for constraints and callback @@ -32372,7 +32803,7 @@ typeof window !== 'undefined' && window.addEventListener('message', function (ev } }); -},{"webrtc-adapter":151}],80:[function(require,module,exports){ +},{"webrtc-adapter":154}],83:[function(require,module,exports){ const getScreenMedia = require('./getscreenmedia.js') module.exports = function (options) { @@ -32411,7 +32842,7 @@ module.exports = function (options) { } -},{"./getscreenmedia.js":79}],81:[function(require,module,exports){ +},{"./getscreenmedia.js":82}],84:[function(require,module,exports){ const transforms = require('./glsl-transforms.js') var Output = function (opts) { @@ -32574,7 +33005,7 @@ Output.prototype.tick = function (props) { module.exports = Output -},{"./glsl-transforms.js":77}],82:[function(require,module,exports){ +},{"./glsl-transforms.js":80}],85:[function(require,module,exports){ // to add: ripple: https://www.shadertoy.com/view/4djGzz // mask // convolution @@ -32651,7 +33082,7 @@ module.exports = { } } -},{}],83:[function(require,module,exports){ +},{}],86:[function(require,module,exports){ // to do: // 1. how to handle multi-pass renders // 2. how to handle vertex shaders @@ -32703,7 +33134,7 @@ module.exports = function (defaultOutput) { return Frag } -},{}],84:[function(require,module,exports){ +},{}],87:[function(require,module,exports){ // some utility functions for managing time within hydra // to do: add easing functions: https://github.com/bameyrick/js-easing-functions @@ -32766,7 +33197,7 @@ module.exports = { createFades: createFades } -},{}],85:[function(require,module,exports){ +},{}],88:[function(require,module,exports){ class VideoRecorder { constructor(stream) { this.mediaSource = new MediaSource() @@ -32854,7 +33285,7 @@ class VideoRecorder { module.exports = VideoRecorder -},{}],86:[function(require,module,exports){ +},{}],89:[function(require,module,exports){ const getUserMedia = require('getusermedia') const enumerateDevices = require('enumerate-devices') @@ -32890,7 +33321,7 @@ module.exports = function (deviceId) { }) } -},{"enumerate-devices":56,"getusermedia":58}],87:[function(require,module,exports){ +},{"enumerate-devices":59,"getusermedia":61}],90:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = nBytes * 8 - mLen - 1 @@ -32976,7 +33407,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],88:[function(require,module,exports){ +},{}],91:[function(require,module,exports){ var indexOf = [].indexOf; @@ -32987,7 +33418,7 @@ module.exports = function(arr, obj){ } return -1; }; -},{}],89:[function(require,module,exports){ +},{}],92:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { @@ -33012,7 +33443,7 @@ if (typeof Object.create === 'function') { } } -},{}],90:[function(require,module,exports){ +},{}],93:[function(require,module,exports){ /*! * Determine if an object is a Buffer * @@ -33035,9 +33466,9 @@ function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } -},{}],91:[function(require,module,exports){ -arguments[4][70][0].apply(exports,arguments) -},{"dup":70}],92:[function(require,module,exports){ +},{}],94:[function(require,module,exports){ +arguments[4][73][0].apply(exports,arguments) +},{"dup":73}],95:[function(require,module,exports){ !function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.Meyda=r():t.Meyda=r()}(this,function(){return function(t){function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var e={};return r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="",r(r.s=23)}([function(t,r,e){"use strict";function n(t){if(Array.isArray(t)){for(var r=0,e=Array(t.length);r1;)t/=2;return 1===t}function i(t,r){for(var e=[],n=0;n3&&void 0!==arguments[3]?arguments[3]:5,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:440,c=Math.floor(e/2)+1,f=new Array(e).fill(0).map(function(n,o){return t*p(r*o/e,u)});f[0]=f[1]-1.5*t;var l=f.slice(1).map(function(t,r){return Math.max(t-f[r])},1).concat([1]),s=Math.round(t/2),y=new Array(t).fill(0).map(function(r,e){return f.map(function(r){return(10*t+s+r-e)%t-s})}),h=y.map(function(t,r){return t.map(function(t,e){return Math.exp(-.5*Math.pow(2*y[r][e]/l[e],2))})});if(h=m(h),i){var b=f.map(function(r){return Math.exp(-.5*Math.pow((r/t-o)/i,2))});h=h.map(function(t){return t.map(function(t,r){return t*b[r]})})}return a&&(h=[].concat(n(h.slice(3)),n(h.slice(0,3)))),h.map(function(t){return t.slice(0,c)})}function h(t,r,e){if(t.lengtha;)i[u++]=c,a=u*t.barkScale[o.length-1]/24;i[24]=o.length-1;for(var f=0;f<24;f++){for(var l=0,s=i[f];s=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(a=c[u],!m(t[a],r[a],e,n))return!1;return!0}function b(t,r,e){m(t,r,!0)&&s(t,r,e,"notDeepStrictEqual",b)}function g(t,r){if(!t||!r)return!1;if("[object RegExp]"==Object.prototype.toString.call(r))return r.test(t);try{if(t instanceof r)return!0}catch(t){}return!Error.isPrototypeOf(r)&&!0===r.call({},t)}function S(t){var r;try{t()}catch(t){r=t}return r}function d(t,r,e,n){var o;if("function"!=typeof r)throw new TypeError('"block" argument must be a function');"string"==typeof e&&(n=e,e=null),o=S(r),n=(e&&e.name?" ("+e.name+").":".")+(n?" "+n:"."),t&&!o&&s(o,e,"Missing expected exception"+n);var i="string"==typeof n,a=!t&&v.isError(o),u=!t&&o&&!e;if((a&&i&&g(o,e)||u)&&s(o,e,"Got unwanted exception"+n),t&&o&&e&&!g(o,e)||!t&&o)throw o}var v=e(33),w=Object.prototype.hasOwnProperty,x=Array.prototype.slice,E=function(){return"foo"===function(){}.name}(),_=t.exports=p,M=/\s*function\s+([^\(\s]*)\s*/;_.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=l(this),this.generatedMessage=!0);var r=t.stackStartFunction||s;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var e=new Error;if(e.stack){var n=e.stack,o=u(r),i=n.indexOf("\n"+o);if(i>=0){var a=n.indexOf("\n",i+1);n=n.substring(a+1)}this.stack=n}}},v.inherits(_.AssertionError,Error),_.fail=s,_.ok=p,_.equal=function(t,r,e){t!=r&&s(t,r,e,"==",_.equal)},_.notEqual=function(t,r,e){t==r&&s(t,r,e,"!=",_.notEqual)},_.deepEqual=function(t,r,e){m(t,r,!1)||s(t,r,e,"deepEqual",_.deepEqual)},_.deepStrictEqual=function(t,r,e){m(t,r,!0)||s(t,r,e,"deepStrictEqual",_.deepStrictEqual)},_.notDeepEqual=function(t,r,e){m(t,r,!1)&&s(t,r,e,"notDeepEqual",_.notDeepEqual)},_.notDeepStrictEqual=b,_.strictEqual=function(t,r,e){t!==r&&s(t,r,e,"===",_.strictEqual)},_.notStrictEqual=function(t,r,e){t===r&&s(t,r,e,"!==",_.notStrictEqual)},_.throws=function(t,r,e){d(!0,t,r,e)},_.doesNotThrow=function(t,r,e){d(!1,t,r,e)},_.ifError=function(t){if(t)throw t};var A=Object.keys||function(t){var r=[];for(var e in t)w.call(t,e)&&r.push(e);return r}}).call(r,e(5))},function(t,r,e){"use strict";function n(t){if(Array.isArray(t)){for(var r=0,e=Array(t.length);rr&&(r=t.specific[i]);return Math.pow((t.total-r)/t.total,2)}},function(t,r,e){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};r.a=function(t){if("object"!==n(t.signal))throw new TypeError;for(var r=0,e=0;ei&&a>=0;)e-=t[a],--a;return(a+1)*r}},function(t,r,e){"use strict";var n=e(1),o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};r.a=function(t){if("object"!==o(t.ampSpectrum))throw new TypeError;var r=e.i(n.a)(1,t.ampSpectrum),i=e.i(n.a)(2,t.ampSpectrum),a=e.i(n.a)(3,t.ampSpectrum);return(2*Math.pow(r,3)-3*r*i+a)/Math.pow(Math.sqrt(i-Math.pow(r,2)),3)}},function(t,r,e){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};r.a=function(t){if("object"!==n(t.ampSpectrum))throw new TypeError;for(var r=0,e=0,o=new Float32Array(t.ampSpectrum.length),i=0,a=0,u=0;u=0&&arguments[0].signal[r+1]<0||arguments[0].signal[r]<0&&arguments[0].signal[r+1]>=0)&&t++;return t}},function(t,r,e){t.exports=e(6).default},function(t,r,e){"use strict";function n(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}e.d(r,"a",function(){return u});var o=e(0),i=e(4),a=function(){function t(t,r){for(var e=0;e0;i--)r[t-i]=r[i-1];return r}function o(t){for(var r=Math.PI/(t-1),e=new Float32Array(t),n=0;n1)for(var e=1;e=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),h(e)?n.showHidden=e:e&&r._extend(n,e),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=i),c(n,t,n.depth)}function i(t,r){var e=o.styles[r];return e?"["+o.colors[e][0]+"m"+t+"["+o.colors[e][1]+"m":t}function a(t,r){return t}function u(t){var r={};return t.forEach(function(t,e){r[t]=!0}),r}function c(t,e,n){if(t.customInspect&&e&&A(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var o=e.inspect(n,t);return d(o)||(o=c(t,o,n)),o}var i=f(t,e);if(i)return i;var a=Object.keys(e),h=u(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),M(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(e);if(0===a.length){if(A(e)){var b=e.name?": "+e.name:"";return t.stylize("[Function"+b+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(M(e))return l(e)}var g="",S=!1,v=["{","}"];if(y(e)&&(S=!0,v=["[","]"]),A(e)){g=" [Function"+(e.name?": "+e.name:"")+"]"}if(x(e)&&(g=" "+RegExp.prototype.toString.call(e)),_(e)&&(g=" "+Date.prototype.toUTCString.call(e)),M(e)&&(g=" "+l(e)),0===a.length&&(!S||0==e.length))return v[0]+g+v[1];if(n<0)return x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var w;return w=S?s(t,e,n,h,a):a.map(function(r){return p(t,e,n,h,r,S)}),t.seen.pop(),m(w,g,v)}function f(t,r){if(w(r))return t.stylize("undefined","undefined");if(d(r)){var e="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(e,"string")}return S(r)?t.stylize(""+r,"number"):h(r)?t.stylize(""+r,"boolean"):b(r)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function s(t,r,e,n,o){for(var i=[],a=0,u=r.length;a-1&&(u=i?u.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+u.split("\n").map(function(t){return" "+t}).join("\n"))):u=t.stylize("[Circular]","special")),w(a)){if(i&&o.match(/^\d+$/))return u;a=JSON.stringify(""+o),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+u}function m(t,r,e){var n=0;return t.reduce(function(t,r){return n++,r.indexOf("\n")>=0&&n++,t+r.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?e[0]+(""===r?"":r+"\n ")+" "+t.join(",\n ")+" "+e[1]:e[0]+r+" "+t.join(", ")+" "+e[1]}function y(t){return Array.isArray(t)}function h(t){return"boolean"==typeof t}function b(t){return null===t}function g(t){return null==t}function S(t){return"number"==typeof t}function d(t){return"string"==typeof t}function v(t){return"symbol"==typeof t}function w(t){return void 0===t}function x(t){return E(t)&&"[object RegExp]"===T(t)}function E(t){return"object"==typeof t&&null!==t}function _(t){return E(t)&&"[object Date]"===T(t)}function M(t){return E(t)&&("[object Error]"===T(t)||t instanceof Error)}function A(t){return"function"==typeof t}function j(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function T(t){return Object.prototype.toString.call(t)}function F(t){return t<10?"0"+t.toString(10):t.toString(10)}function k(){var t=new Date,r=[F(t.getHours()),F(t.getMinutes()),F(t.getSeconds())].join(":");return[t.getDate(),R[t.getMonth()],r].join(" ")}function z(t,r){return Object.prototype.hasOwnProperty.call(t,r)}var O=/%[sdj%]/g;r.format=function(t){if(!d(t)){for(var r=[],e=0;e=i)return t;switch(t){case"%s":return String(n[e++]);case"%d":return Number(n[e++]);case"%j":try{return JSON.stringify(n[e++])}catch(t){return"[Circular]"}default:return t}}),u=n[e];eThe web is much more than just canvas and p5.dom makes it easy to interact @@ -36255,7 +36686,7 @@ exports.y = mouseRelativeY }; }); -},{"../p5":96}],96:[function(require,module,exports){ +},{"../p5":99}],99:[function(require,module,exports){ (function (global){ /*! p5.js v0.6.1 April 27, 2018 */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.p5 = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o*/ @@ -115408,10 +115839,10 @@ module.exports = { destroy: destroy, undestroy: undestroy }; -},{"process-nextick-args":100}],112:[function(require,module,exports){ +},{"process-nextick-args":103}],115:[function(require,module,exports){ module.exports = require('events').EventEmitter; -},{"events":26}],113:[function(require,module,exports){ +},{"events":26}],116:[function(require,module,exports){ exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = exports; exports.Readable = exports; @@ -115420,7 +115851,7 @@ exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); -},{"./lib/_stream_duplex.js":105,"./lib/_stream_passthrough.js":106,"./lib/_stream_readable.js":107,"./lib/_stream_transform.js":108,"./lib/_stream_writable.js":109}],114:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":108,"./lib/_stream_passthrough.js":109,"./lib/_stream_readable.js":110,"./lib/_stream_transform.js":111,"./lib/_stream_writable.js":112}],117:[function(require,module,exports){ (function(aa,ia){"object"===typeof exports&&"undefined"!==typeof module?module.exports=ia():"function"===typeof define&&define.amd?define(ia):aa.createREGL=ia()})(this,function(){function aa(a,b){this.id=Ab++;this.type=a;this.data=b}function ia(a){if(0===a.length)return[];var b=a.charAt(0),c=a.charAt(a.length-1);if(1