diff --git a/dist/hotkeys.js b/dist/hotkeys.js index b9ff67b8..93e6c067 100644 --- a/dist/hotkeys.js +++ b/dist/hotkeys.js @@ -28,14 +28,14 @@ })(function() { var define, module, exports; //IE对indexOf方法的支持 - if (!Array.prototype.indexOf) { + if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(obj) { for (var i = 0; i < this.length; i++) if (this[i] === obj) return i; return -1; }; } // IE对lastIndexOf方法的支持 - if (!Array.prototype.lastIndexOf) { + if (!Array.prototype.lastIndexOf) { Array.prototype.lastIndexOf = function(obj) { for (var i = this.length - 1; i >= 0; i--) if (this[i] === obj) return i; return -1; @@ -58,6 +58,8 @@ down: 40, del: 46, delete: 46, + ins: 45, + insert: 45, home: 36, end: 35, pageup: 33, @@ -100,26 +102,26 @@ 17: false }, _handlers = {}; // F1~F12 特殊键 - for (var k = 1; k < 20; k++) { + for (var k = 1; k < 20; k++) { _keyMap["f" + k] = 111 + k; } // 兼容Firefox处理 - modifierMap[isff ? 224 : 91] = "metaKey"; + modifierMap[isff ? 224 : 91] = "metaKey"; _mods[isff ? 224 : 91] = false; // 返回键码 - function code(x) { + function code(x) { return _keyMap[x.toLowerCase()] || x.toUpperCase().charCodeAt(0); } // 设置获取当前范围(默认为'所有') - function setScope(scope) { + function setScope(scope) { _scope = scope || "all"; } // 获取当前范围 - function getScope() { + function getScope() { return _scope || "all"; } // 绑定事件 - function addEvent(object, event, method) { + function addEvent(object, event, method) { if (object.addEventListener) { object.addEventListener(event, method, false); } else if (object.attachEvent) { @@ -129,61 +131,62 @@ } } // 判断摁下的键是否为某个键,返回true或者false - function isPressed(keyCode) { + function isPressed(keyCode) { if (typeof keyCode === "string") { keyCode = code(keyCode); - } + // 转换成键码 + } return _downKeys.indexOf(keyCode) !== -1; } // 获取摁下绑定键的键值 - function getPressedKeyCodes() { + function getPressedKeyCodes() { return _downKeys.slice(0); } // 处理keydown事件 - function dispatch(event) { + function dispatch(event) { var key = event.keyCode || event.which || event.charCode, scope, asterisk = _handlers["*"]; // 搜集绑定的键 - if (_downKeys.indexOf(key) === -1) _downKeys.push(key); + if (_downKeys.indexOf(key) === -1) _downKeys.push(key); // Gecko(Firefox)的command键值224,在Webkit(Chrome)中保持一致 // Webkit左右command键值不一样 - if (key === 93 || key === 224) key = 91; + if (key === 93 || key === 224) key = 91; if (key in _mods) { _mods[key] = true; // 将特殊字符的key注册到 hotkeys 上 - for (var k in _modifier) if (_modifier[k] === key) hotkeys[k] = true; + for (var k in _modifier) if (_modifier[k] === key) hotkeys[k] = true; if (!asterisk) return; } // 将modifierMap里面的修饰键绑定到event中 - for (var e in _mods) _mods[e] = event[modifierMap[e]]; + for (var e in _mods) _mods[e] = event[modifierMap[e]]; // 表单控件过滤 默认表单控件不触发快捷键 - if (!hotkeys.filter.call(this, event)) return; + if (!hotkeys.filter.call(this, event)) return; // 获取范围 默认为all - scope = getScope(); + scope = getScope(); // 对任何快捷键都需要做的处理 - if (asterisk) { + if (asterisk) { for (i = 0; i < asterisk.length; i++) { if (asterisk[i].scope === scope) eventHandler(event, asterisk[i], scope); } } // key 不在_handlers中返回 - if (!(key in _handlers)) return; + if (!(key in _handlers)) return; for (var i = 0; i < _handlers[key].length; i++) { // 找到处理内容 eventHandler(event, _handlers[key][i], scope); } } // 对监听对应快捷键的回调函数进行处理 - function eventHandler(event, handler, scope) { + function eventHandler(event, handler, scope) { var modifiersMatch; // 看它是否在当前范围 - if (handler.scope === scope || handler.scope === "all") { + if (handler.scope === scope || handler.scope === "all") { //检查是否匹配修饰符(如果有返回true) modifiersMatch = handler.mods.length > 0; for (var y in _mods) { if (!_mods[y] && handler.mods.indexOf(+y) > -1 || _mods[y] && handler.mods.indexOf(+y) === -1) modifiersMatch = false; } // 调用处理程序,如果是修饰键不做处理 - if (handler.mods.length === 0 && !_mods[16] && !_mods[18] && !_mods[17] && !_mods[91] || modifiersMatch || handler.shortcut === "*") { + if (handler.mods.length === 0 && !_mods[16] && !_mods[18] && !_mods[17] && !_mods[91] || modifiersMatch || handler.shortcut === "*") { if (handler.method(event, handler) === false) { if (event.preventDefault) event.preventDefault(); else event.returnValue = false; if (event.stopPropagation) event.stopPropagation(); @@ -193,34 +196,34 @@ } } // 解除绑定某个范围的快捷键 - function unbind(key, scope) { + function unbind(key, scope) { var multipleKeys = getKeys(key), keys, mods = [], obj; for (var i = 0; i < multipleKeys.length; i++) { // 将组合快捷键拆分为数组 keys = multipleKeys[i].split("+"); // 记录每个组合键中的修饰键的键码 返回数组 - if (keys.length > 1) mods = getMods(keys); + if (keys.length > 1) mods = getMods(keys); // 获取除修饰键外的键值key - key = keys[keys.length - 1]; + key = keys[keys.length - 1]; key = key === "*" ? "*" : code(key); // 判断是否传入范围,没有就获取范围 - if (!scope) scope = getScope(); + if (!scope) scope = getScope(); // 如何key不在 _handlers 中返回不做处理 - if (!_handlers[key]) return; + if (!_handlers[key]) return; // 清空 handlers 中数据, // 让触发快捷键键之后没有事件执行到达解除快捷键绑定的目的 - for (var r = 0; r < _handlers[key].length; r++) { + for (var r = 0; r < _handlers[key].length; r++) { obj = _handlers[key][r]; // 判断是否在范围内并且键值相同 - if (obj.scope === scope && compareArray(obj.mods, mods)) _handlers[key][r] = {}; + if (obj.scope === scope && compareArray(obj.mods, mods)) _handlers[key][r] = {}; } } } // 循环删除handlers中的所有 scope(范围) - function deleteScope(scope, newScope) { + function deleteScope(scope, newScope) { var key, handlers, i; // 没有指定scope,获取scope - if (!scope) scope = getScope(); + if (!scope) scope = getScope(); for (key in _handlers) { handlers = _handlers[key]; for (i = 0; i < handlers.length; ) { @@ -228,10 +231,10 @@ } } // 如果scope被删除,将scope重置为all - if (getScope() === scope) setScope(newScope || "all"); + if (getScope() === scope) setScope(newScope || "all"); } //比较修饰键的数组 - function compareArray(a1, a2) { + function compareArray(a1, a2) { var arr1 = a1.length >= a2.length ? a1 : a2; var arr2 = a1.length >= a2.length ? a2 : a1; for (var i = 0; i < arr1.length; i++) { @@ -240,28 +243,28 @@ return true; } // 表单控件控件判断 返回 Boolean - function filter(event) { + function filter(event) { var tagName = (event.target || event.srcElement).tagName; // 忽略这些标签情况下快捷键无效 - return !(tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA"); + return !(tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA"); } // 修饰键转换成对应的键码 - function getMods(key) { + function getMods(key) { var mods = key.slice(0, key.length - 1); for (var i = 0; i < mods.length; i++) mods[i] = _modifier[mods[i].toLowerCase()]; return mods; } // 处理传的key字符串转换成数组 - function getKeys(key) { + function getKeys(key) { if (!key) key = ""; var keys, index; key = key.replace(/\s/g, ""); - // 匹配任何空白字符,包括空格、制表符、换页符等等 - keys = key.split(","); - // 同时设置多个快捷键,以','分割 - index = keys.lastIndexOf(""); + // 匹配任何空白字符,包括空格、制表符、换页符等等 + keys = key.split(","); + // 同时设置多个快捷键,以','分割 + index = keys.lastIndexOf(""); // 快捷键可能包含',',需特殊处理 - for (;index >= 0; ) { + for (;index >= 0; ) { keys[index - 1] += ","; keys.splice(index, 1); index = keys.lastIndexOf(""); @@ -269,7 +272,7 @@ return keys; } // 在全局document上设置快捷键 - if (typeof document !== "undefined") { + if (typeof document !== "undefined") { addEvent(document, "keydown", function(event) { dispatch(event); }); @@ -278,40 +281,41 @@ }); } // 清除修饰键 - function clearModifier(event) { + function clearModifier(event) { var key = event.keyCode || event.which || event.charCode, i = _downKeys.indexOf(key); // 从列表中清除按压过的键 - if (i >= 0) _downKeys.splice(i, 1); + if (i >= 0) _downKeys.splice(i, 1); // 修饰键 shiftKey altKey ctrlKey (command||metaKey) 清除 - if (key === 93 || key === 224) key = 91; + if (key === 93 || key === 224) key = 91; if (key in _mods) { _mods[key] = false; // 将修饰键重置为false - for (var k in _modifier) if (_modifier[k] === key) hotkeys[k] = false; + for (var k in _modifier) if (_modifier[k] === key) hotkeys[k] = false; } } // 主体hotkeys函数 - function hotkeys(key, scope, method) { + function hotkeys(key, scope, method) { var keys = getKeys(key), // 需要处理的快捷键列表 mods = [], i = 0; // 对为设定范围的判断 - if (method === undefined) { + if (method === undefined) { method = scope; scope = "all"; - } + // scope默认为all,所有范围都有效 + } // 对于每个快捷键进行处理 - for (;i < keys.length; i++) { + for (;i < keys.length; i++) { key = keys[i].split("+"); - // 按键列表 - mods = []; + // 按键列表 + mods = []; // 如果是组合快捷键取得组合快捷键 - if (key.length > 1) mods = getMods(key); + if (key.length > 1) mods = getMods(key); // 将非修饰键转化为键码 - key = key[key.length - 1]; + key = key[key.length - 1]; key = key === "*" ? "*" : code(key); - // *表示匹配所有快捷键 + // *表示匹配所有快捷键 // 判断key是否在_handlers中,不在就赋一个空数组 - if (!(key in _handlers)) _handlers[key] = []; + if (!(key in _handlers)) _handlers[key] = []; _handlers[key].push({ shortcut: keys[i], scope: scope, diff --git a/dist/hotkeys.min.js b/dist/hotkeys.min.js index e171d0da..c6c170ad 100644 --- a/dist/hotkeys.min.js +++ b/dist/hotkeys.min.js @@ -1,3 +1,3 @@ /*! hotkeys-js v2.0.8 | MIT (c) 2018 kenny wang | https://github.com/jaywcjlove/hotkeys.git */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).hotkeys=e()}}(function(){function e(e){return p[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)}function n(e){h=e||"all"}function t(){return h||"all"}function o(e,n,t){e.addEventListener?e.addEventListener(n,t,!1):e.attachEvent&&e.attachEvent("on"+n,function(){t(window.event)})}function r(e){var n,o=e.keyCode||e.which||e.charCode,r=m["*"];if(-1===y.indexOf(o)&&y.push(o),93!==o&&224!==o||(o=91),o in w){w[o]=!0;for(var f in g)g[f]===o&&(c[f]=!0);if(!r)return}for(var a in w)w[a]=e[v[a]];if(c.filter.call(this,e)){if(n=t(),r)for(l=0;l0;for(var r in w)(!w[r]&&n.mods.indexOf(+r)>-1||w[r]&&-1===n.mods.indexOf(+r))&&(o=!1);(0!==n.mods.length||w[16]||w[18]||w[17]||w[91])&&!o&&"*"!==n.shortcut||!1===n.method(e,n)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function f(e,n){for(var t=e.length>=n.length?e:n,o=e.length>=n.length?n:e,r=0;r=0;)n[t-1]+=",",n.splice(t,1),t=n.lastIndexOf("");return n}function d(e){var n=e.keyCode||e.which||e.charCode,t=y.indexOf(n);if(t>=0&&y.splice(t,1),93!==n&&224!==n||(n=91),n in w){w[n]=!1;for(var o in g)g[o]===n&&(c[o]=!1)}}function c(n,t,o){var r=l(n),i=[],f=0;for(void 0===o&&(o=t,t="all");f1&&(i=a(n)),(n="*"===(n=n[n.length-1])?"*":e(n))in m||(m[n]=[]),m[n].push({shortcut:r[f],scope:t,method:o,key:r[f],mods:i})}Array.prototype.indexOf||(Array.prototype.indexOf=function(e){for(var n=0;n=0;n--)if(this[n]===e)return n;return-1});for(var s,u="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0,p={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,"⇪":20,capslock:20,",":188,".":190,"/":191,"`":192,"-":u?173:189,"=":u?61:187,";":u?59:186,"'":222,"[":219,"]":221,"\\":220},h="all",g={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":u?224:91,cmd:u?224:91,command:u?224:91},y=[],v={16:"shiftKey",18:"altKey",17:"ctrlKey"},w={16:!1,18:!1,17:!1},m={},x=1;x<20;x++)p["f"+x]=111+x;v[u?224:91]="metaKey",w[u?224:91]=!1,"undefined"!=typeof document&&(o(document,"keydown",function(e){r(e)}),o(document,"keyup",function(e){d(e)})),s={setScope:n,getScope:t,deleteScope:function(e,o){var r,i,f;e||(e=t());for(r in m)for(i=m[r],f=0;f1&&(c=a(r)),n=r[r.length-1],n="*"===n?"*":e(n),o||(o=t()),!m[n])return;for(var u=0;u=0;n--)if(this[n]===e)return n;return-1});for(var e,n="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0,t={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,"⇪":20,capslock:20,",":188,".":190,"/":191,"`":192,"-":n?173:189,"=":n?61:187,";":n?59:186,"'":222,"[":219,"]":221,"\\":220},o="all",r={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":n?224:91,cmd:n?224:91,command:n?224:91},i=[],f={16:"shiftKey",18:"altKey",17:"ctrlKey"},a={16:!1,18:!1,17:!1},l={},d=1;d<20;d++)t["f"+d]=111+d;function s(e){return t[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)}function c(e){o=e||"all"}function u(){return o||"all"}function p(e,n,t){e.addEventListener?e.addEventListener(n,t,!1):e.attachEvent&&e.attachEvent("on"+n,function(){t(window.event)})}function h(e,n,t){var o;if(n.scope===t||"all"===n.scope){for(var r in o=n.mods.length>0,a)(!a[r]&&n.mods.indexOf(+r)>-1||a[r]&&-1===n.mods.indexOf(+r))&&(o=!1);(0!==n.mods.length||a[16]||a[18]||a[17]||a[91])&&!o&&"*"!==n.shortcut||!1===n.method(e,n)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function g(e,n){for(var t=e.length>=n.length?e:n,o=e.length>=n.length?n:e,r=0;r=0;)n[t-1]+=",",n.splice(t,1),t=n.lastIndexOf("");return n}function w(e,n,t){var o=v(e),r=[],i=0;for(void 0===t&&(t=n,n="all");i1&&(r=y(e)),(e="*"===(e=e[e.length-1])?"*":s(e))in l||(l[e]=[]),l[e].push({shortcut:o[i],scope:n,method:t,key:o[i],mods:r})}for(var m in f[n?224:91]="metaKey",a[n?224:91]=!1,"undefined"!=typeof document&&(p(document,"keydown",function(e){!function(e){var n,t=e.keyCode||e.which||e.charCode,o=l["*"];if(-1===i.indexOf(t)&&i.push(t),93!==t&&224!==t||(t=91),t in a){for(var d in a[t]=!0,r)r[d]===t&&(w[d]=!0);if(!o)return}for(var s in a)a[s]=e[f[s]];if(w.filter.call(this,e)){if(n=u(),o)for(c=0;c=0&&i.splice(t,1);93!==n&&224!==n||(n=91);if(n in a)for(var o in a[n]=!1,r)r[o]===n&&(w[o]=!1)}(e)})),e={setScope:c,getScope:u,deleteScope:function(e,n){var t,o,r;for(t in e||(e=u()),l)for(o=l[t],r=0;r1&&(i=y(t)),e="*"===(e=t[t.length-1])?"*":s(e),n||(n=u()),!l[e])return;for(var a=0;a0;for(var i in v)(!v[i]&&e.mods.indexOf(+i)>-1||v[i]&&-1===e.mods.indexOf(+i))&&(n=!1);(0!==e.mods.length||v[16]||v[18]||v[17]||v[91])&&!n&&"*"!==e.shortcut||!1===e.method(t,e)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function a(t,e){for(var r=t.length>=e.length?t:e,n=t.length>=e.length?e:t,i=0;i=0;)e[r-1]+=",",e.splice(r,1),r=e.lastIndexOf("");return e}function l(t){var r=t.keyCode||e.which||e.charCode,n=b.indexOf(r);if(n>=0&&b.splice(n,1),93!==r&&224!==r||(r=91),r in v){v[r]=!1;for(var i in y)y[i]===r&&(c[i]=!1)}}function c(e,r,n){var i=f(e),o=[],s=0;for(void 0===n&&(n=r,r="all");s1&&(o=u(e)),(e="*"===(e=e[e.length-1])?"*":t(e))in w||(w[e]=[]),w[e].push({shortcut:i[s],scope:r,method:n,key:i[s],mods:o})}Array.prototype.indexOf||(Array.prototype.indexOf=function(t){for(var e=0;e=0;e--)if(this[e]===t)return e;return-1});for(var h,p="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0,d={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,"⇪":20,capslock:20,",":188,".":190,"/":191,"`":192,"-":p?173:189,"=":p?61:187,";":p?59:186,"'":222,"[":219,"]":221,"\\":220},g="all",y={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":p?224:91,cmd:p?224:91,command:p?224:91},b=[],m={16:"shiftKey",18:"altKey",17:"ctrlKey"},v={16:!1,18:!1,17:!1},w={},_=1;_<20;_++)d["f"+_]=111+_;m[p?224:91]="metaKey",v[p?224:91]=!1,"undefined"!=typeof document&&(i(document,"keydown",function(t){o(t)}),i(document,"keyup",function(t){l(t)})),h={setScope:r,getScope:n,deleteScope:function(t,e){var i,o,s;t||(t=n());for(i in w)for(o=w[i],s=0;s1&&(l=u(i)),e=i[i.length-1],e="*"===e?"*":t(e),r||(r=n()),!w[e])return;for(var h=0;h0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}function o(t,e,r){for(var n,o=[],s=e;s0?f-4:f;var l=0;for(e=0;e>16&255,s[l++]=i>>8&255,s[l++]=255&i;return 2===o?(i=a[t.charCodeAt(e)]<<2|a[t.charCodeAt(e+1)]>>4,s[l++]=255&i):1===o&&(i=a[t.charCodeAt(e)]<<10|a[t.charCodeAt(e+1)]<<4|a[t.charCodeAt(e+2)]>>2,s[l++]=i>>8&255,s[l++]=255&i),s},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i="",a=[],u=0,f=r-n;uf?f:u+16383));return 1===n?(e=t[r-1],i+=s[e>>2],i+=s[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=s[e>>10],i+=s[e>>4&63],i+=s[e<<2&63],i+="="),a.push(i),a.join("")};for(var s=[],a=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,c=f.length;lG)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return u(t)}return o(t,e,r)}function o(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return $(t)?c(t,e,r):"string"==typeof t?f(t,e):h(t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,e,r){return s(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}function u(t){return s(t),n(t<0?0:0|p(t))}function f(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(t,e),o=n(r),s=o.write(t,e);return s!==r&&(o=o.slice(0,s)),o}function l(t){for(var e=t.length<0?0:0|p(t.length),r=n(e),i=0;i=G)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+G.toString(16)+" bytes");return 0|t}function d(t,e){if(i.isBuffer(t))return t.length;if(V(t)||$(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(t).length;default:if(n)return P(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,r);case"utf8":case"utf-8":return C(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,z(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}var f;if(i){var l=-1;for(f=r;fa&&(r=a-u),f=r;f>=0;f--){for(var c=!0,h=0;hi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s239?4:o>223?3:o>191?2:1;if(i+a<=r){var u,f,l,c;switch(a){case 1:o<128&&(s=o);break;case 2:128==(192&(u=t[i+1]))&&(c=(31&o)<<6|63&u)>127&&(s=c);break;case 3:u=t[i+1],f=t[i+2],128==(192&u)&&128==(192&f)&&(c=(15&o)<<12|(63&u)<<6|63&f)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:u=t[i+1],f=t[i+2],l=t[i+3],128==(192&u)&&128==(192&f)&&128==(192&l)&&(c=(15&o)<<18|(63&u)<<12|(63&f)<<6|63&l)>65535&&c<1114112&&(s=c)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=a}return j(n)}function j(t){var e=t.length;if(e<=X)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,o,s){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function D(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(t,e,r,n,i){return e=+e,r>>>=0,i||D(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Y.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,i){return e=+e,r>>>=0,i||D(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Y.write(t,e,r,n,52,8),r+8}function N(t){if((t=t.trim().replace(Z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function R(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function K(t){return H.toByteArray(N(t))}function W(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function $(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function V(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function z(t){return t!==t}var H=t("base64-js"),Y=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},r.INSPECT_MAX_BYTES=50;var G=2147483647;r.kMaxLength=G,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return o(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return a(t,e,r)},i.allocUnsafe=function(t){return u(t)},i.allocUnsafeSlow=function(t){return u(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,s=Math.min(r,n);o0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,r,n,o){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var s=o-n,a=r-e,u=Math.min(s,a),f=this.slice(n,o),l=t.slice(e,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var X=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||q(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||q(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||q(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||q(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||q(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||q(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||q(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||q(t,e,this.length);for(var n=this[t],i=1,o=0;++o=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||q(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},i.prototype.readInt8=function(t,e){return t>>>=0,e||q(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||q(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||q(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||q(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||q(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||q(t,4,this.length),Y.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||q(t,4,this.length),Y.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||q(t,8,this.length),Y.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||q(t,8,this.length),Y.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var s;if("number"==typeof t)for(s=e;s0&&"number"!=typeof t[0]))}function o(t,e,r){var o,l;if(n(t)||n(e))return!1;if(t.prototype!==e.prototype)return!1;if(u(t))return!!u(e)&&(t=s.call(t),e=s.call(e),f(t,e,r));if(i(t)){if(!i(e))return!1;if(t.length!==e.length)return!1;for(o=0;o=0;o--)if(c[o]!=h[o])return!1;for(o=c.length-1;o>=0;o--)if(l=c[o],!f(t[l],e[l],r))return!1;return typeof t==typeof e}var s=Array.prototype.slice,a=t("./lib/keys.js"),u=t("./lib/is_arguments.js"),f=e.exports=function(t,e,r){return r||(r={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?r.strict?t===e:t==e:o(t,e,r))}},{"./lib/is_arguments.js":8,"./lib/keys.js":9}],8:[function(t,e,r){function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function i(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();(r=e.exports=o?n:i).supported=n,r.unsupported=i},{}],9:[function(t,e,r){function n(t){var e=[];for(var r in t)e.push(r);return e}(e.exports="function"==typeof Object.keys?Object.keys:n).shim=n},{}],10:[function(t,e,r){"use strict";var n=t("object-keys"),i=t("foreach"),o="function"==typeof Symbol&&"symbol"==typeof Symbol(),s=Object.prototype.toString,a=function(t){return"function"==typeof t&&"[object Function]"===s.call(t)},u=Object.defineProperty&&function(){var t={};try{Object.defineProperty(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}}(),f=function(t,e,r,n){(!(e in t)||a(n)&&n())&&(u?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},s=n(e);o&&(s=s.concat(Object.getOwnPropertySymbols(e))),i(s,function(n){f(t,n,e[n],r[n])})};l.supportsDescriptors=!!u,e.exports=l},{foreach:21,"object-keys":34}],11:[function(t,e,r){e.exports=function(){for(var t=0;t>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(n(e)||0===e||!i(e))return 0;var r=o(e)*Math.floor(Math.abs(e));return s(r,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:a,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0},IsPropertyDescriptor:function(t){if("Object"!==this.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(f(t,r)&&!e[r])return!1;var n=f(t,"[[Value]]"),i=f(t,"[[Get]]")||f(t,"[[Set]]");if(n&&i)throw new TypeError("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");return!(!f(t,"[[Get]]")&&!f(t,"[[Set]]"))},IsDataDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");return!(!f(t,"[[Value]]")&&!f(t,"[[Writable]]"))},IsGenericDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");return!this.IsAccessorDescriptor(t)&&!this.IsDataDescriptor(t)},FromPropertyDescriptor:function(t){if(void 0===t)return t;if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");if(this.IsDataDescriptor(t))return{value:t["[[Value]]"],writable:!!t["[[Writable]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};if(this.IsAccessorDescriptor(t))return{get:t["[[Get]]"],set:t["[[Set]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};throw new TypeError("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(t){if("Object"!==this.Type(t))throw new TypeError("ToPropertyDescriptor requires an object");var e={};if(f(t,"enumerable")&&(e["[[Enumerable]]"]=this.ToBoolean(t.enumerable)),f(t,"configurable")&&(e["[[Configurable]]"]=this.ToBoolean(t.configurable)),f(t,"value")&&(e["[[Value]]"]=t.value),f(t,"writable")&&(e["[[Writable]]"]=this.ToBoolean(t.writable)),f(t,"get")){var r=t.get;if(void 0!==r&&!this.IsCallable(r))throw new TypeError("getter must be a function");e["[[Get]]"]=r}if(f(t,"set")){var n=t.set;if(void 0!==n&&!this.IsCallable(n))throw new TypeError("setter must be a function");e["[[Set]]"]=n}if((f(e,"[[Get]]")||f(e,"[[Set]]"))&&(f(e,"[[Value]]")||f(e,"[[Writable]]")))throw new TypeError("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}};e.exports=l},{"./helpers/isFinite":13,"./helpers/isNaN":14,"./helpers/mod":15,"./helpers/sign":16,"es-to-primitive/es5":17,has:26,"is-callable":30}],13:[function(t,e,r){var n=Number.isNaN||function(t){return t!==t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!n(t)&&t!==1/0&&t!==-1/0}},{}],14:[function(t,e,r){e.exports=Number.isNaN||function(t){return t!==t}},{}],15:[function(t,e,r){e.exports=function(t,e){var r=t%e;return Math.floor(r>=0?r:r+e)}},{}],16:[function(t,e,r){e.exports=function(t){return t>=0?1:-1}},{}],17:[function(t,e,r){"use strict";var n=Object.prototype.toString,i=t("./helpers/isPrimitive"),o=t("is-callable"),s={"[[DefaultValue]]":function(t,e){var r=e||("[object Date]"===n.call(t)?String:Number);if(r===String||r===Number){var s,a,u=r===String?["toString","valueOf"]:["valueOf","toString"];for(a=0;a0&&this._events[t].length>r&&(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},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(s(r)){for(a=o;a-- >0;)if(r[a]===e||r[a].listener&&r[a].listener===e){n=a;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;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(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],20:[function(t,e,r){function n(t,e,r){for(var n=0,i=t.length;ne.length?t:e,s=t.length>e.length?e:t,a=o.indexOf(s);if(-1!=a)return i=[[1,o.substring(0,a)],[0,s],[1,o.substring(a+s.length)]],t.length>e.length&&(i[0][0]=i[2][0]=-1),i;if(1==s.length)return[[-1,t],[1,e]];var u=this.diff_halfMatch_(t,e);if(u){var f=u[0],l=u[1],c=u[2],h=u[3],p=u[4],d=this.diff_main(f,c,r,n),g=this.diff_main(l,h,r,n);return d.concat([[0,p]],g)}return r&&t.length>100&&e.length>100?this.diff_lineMode_(t,e,n):this.diff_bisect_(t,e,n)},n.prototype.diff_lineMode_=function(t,e,r){var n=this.diff_linesToChars_(t,e);t=n.chars1,e=n.chars2;var i=n.lineArray,o=this.diff_main(t,e,!1,r);this.diff_charsToLines_(o,i),this.diff_cleanupSemantic(o),o.push([0,""]);for(var s=0,a=0,u=0,f="",l="";s=1&&u>=1){o.splice(s-a-u,a+u),s=s-a-u;for(var c=(n=this.diff_main(f,l,!1,r)).length-1;c>=0;c--)o.splice(s,0,n[c]);s+=n.length}u=0,a=0,f="",l=""}s++}return o.pop(),o},n.prototype.diff_bisect_=function(t,e,r){for(var n=t.length,i=e.length,o=Math.ceil((n+i)/2),s=o,a=2*o,u=new Array(a),f=new Array(a),l=0;lr);b++){for(var m=-b+p;m<=b-d;m+=2){for(var v,w=s+m,_=(v=m==-b||m!=b&&u[w-1]n)d+=2;else if(_>i)p+=2;else if(h&&(E=s+c-m)>=0&&E=(k=n-f[E]))return this.diff_bisectSplit_(t,e,v,_,r)}for(var x=-b+g;x<=b-y;x+=2){for(var k,E=s+x,S=(k=x==-b||x!=b&&f[E-1]n)y+=2;else if(S>i)g+=2;else if(!h&&(w=s+c-x)>=0&&w=k)return this.diff_bisectSplit_(t,e,v,_,r)}}}return[[-1,t],[1,e]]},n.prototype.diff_bisectSplit_=function(t,e,r,n,i){var o=t.substring(0,r),s=e.substring(0,n),a=t.substring(r),u=e.substring(n),f=this.diff_main(o,s,!1,i),l=this.diff_main(a,u,!1,i);return f.concat(l)},n.prototype.diff_linesToChars_=function(t,e){function r(t){for(var e="",r=0,o=-1,s=n.length;on?t=t.substring(r-n):r=t.length?[n,i,o,a,l]:null}if(this.Diff_Timeout<=0)return null;var n=t.length>e.length?t:e,i=t.length>e.length?e:t;if(n.length<4||2*i.lengthu[4].length?a:u:a;var f,l,c,h;return t.length>e.length?(f=o[0],l=o[1],c=o[2],h=o[3]):(c=o[0],h=o[1],f=o[2],l=o[3]),[f,l,c,h,o[4]]},n.prototype.diff_cleanupSemantic=function(t){for(var e=!1,r=[],n=0,i=null,o=0,s=0,a=0,u=0,f=0;o0?r[n-1]:-1,s=0,a=0,u=0,f=0,i=null,e=!0)),o++;for(e&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),o=1;o=p?(h>=l.length/2||h>=c.length/2)&&(t.splice(o,0,[0,c.substring(0,h)]),t[o-1][1]=l.substring(0,l.length-h),t[o+1][1]=c.substring(h),o++):(p>=l.length/2||p>=c.length/2)&&(t.splice(o,0,[0,l.substring(0,p)]),t[o-1][0]=1,t[o-1][1]=c.substring(0,c.length-p),t[o+1][0]=-1,t[o+1][1]=l.substring(p),o++),o++}o++}},n.prototype.diff_cleanupSemanticLossless=function(t){function e(t,e){if(!t||!e)return 6;var r=t.charAt(t.length-1),i=e.charAt(0),o=r.match(n.nonAlphaNumericRegex_),s=i.match(n.nonAlphaNumericRegex_),a=o&&r.match(n.whitespaceRegex_),u=s&&i.match(n.whitespaceRegex_),f=a&&r.match(n.linebreakRegex_),l=u&&i.match(n.linebreakRegex_),c=f&&t.match(n.blanklineEndRegex_),h=l&&e.match(n.blanklineStartRegex_);return c||h?5:f||l?4:o&&!a&&u?3:a||u?2:o||s?1:0}for(var r=1;r=h&&(h=p,f=i,l=o,c=s)}t[r-1][1]!=f&&(f?t[r-1][1]=f:(t.splice(r-1,1),r--),t[r][1]=l,c?t[r+1][1]=c:(t.splice(r+1,1),r--))}r++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){for(var e=!1,r=[],n=0,i=null,o=0,s=!1,a=!1,u=!1,f=!1;o0?r[n-1]:-1,u=f=!1),e=!0)),o++;e&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push([0,""]);for(var e,r=0,n=0,i=0,o="",s="";r1?(0!==n&&0!==i&&(0!==(e=this.diff_commonPrefix(s,o))&&(r-n-i>0&&0==t[r-n-i-1][0]?t[r-n-i-1][1]+=s.substring(0,e):(t.splice(0,0,[0,s.substring(0,e)]),r++),s=s.substring(e),o=o.substring(e)),0!==(e=this.diff_commonSuffix(s,o))&&(t[r][1]=s.substring(s.length-e)+t[r][1],s=s.substring(0,s.length-e),o=o.substring(0,o.length-e))),0===n?t.splice(r-i,n+i,[1,s]):0===i?t.splice(r-n,n+i,[-1,o]):t.splice(r-n-i,n+i,[-1,o],[1,s]),r=r-n-i+(n?1:0)+(i?1:0)+1):0!==r&&0==t[r-1][0]?(t[r-1][1]+=t[r][1],t.splice(r,1)):r++,i=0,n=0,o="",s=""}""===t[t.length-1][1]&&t.pop();var a=!1;for(r=1;re));r++)o=n,s=i;return t.length!=r&&-1===t[r][0]?s:s+(e-o)},n.prototype.diff_prettyHtml=function(t){for(var e=[],r=/&/g,n=//g,o=/\n/g,s=0;s");switch(a){case 1:e[s]=''+u+"";break;case-1:e[s]=''+u+"";break;case 0:e[s]=""+u+""}}return e.join("")},n.prototype.diff_text1=function(t){for(var e=[],r=0;rthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(e),o=this,s=this.Match_Threshold,a=t.indexOf(e,r);-1!=a&&(s=Math.min(n(0,a),s),-1!=(a=t.lastIndexOf(e,r+e.length))&&(s=Math.min(n(0,a),s)));var u=1<=d;b--){var m=i[t.charAt(b-1)];if(y[b]=0===p?(y[b+1]<<1|1)&m:(y[b+1]<<1|1)&m|(c[b+1]|c[b])<<1|1|c[b+1],y[b]&u){var v=n(p,b-1);if(v<=s){if(s=v,!((a=b-1)>r))break;d=Math.max(1,2*r-a)}}}if(n(p+1,r)>s)break;c=y}return a},n.prototype.match_alphabet_=function(t){for(var e={},r=0;r2&&(this.diff_cleanupSemantic(o),this.diff_cleanupEfficiency(o));else if(t&&"object"==typeof t&&void 0===e&&void 0===r)o=t,i=this.diff_text1(o);else if("string"==typeof t&&e&&"object"==typeof e&&void 0===r)i=t,o=e;else{if("string"!=typeof t||"string"!=typeof e||!r||"object"!=typeof r)throw new Error("Unknown call format to patch_make.");i=t,o=r}if(0===o.length)return[];for(var s=[],a=new n.patch_obj,u=0,f=0,l=0,c=i,h=i,p=0;p=2*this.Patch_Margin&&u&&(this.patch_addContext_(a,c),s.push(a),a=new n.patch_obj,u=0,c=h,f=l)}1!==d&&(f+=g.length),-1!==d&&(l+=g.length)}return u&&(this.patch_addContext_(a,c),s.push(a)),s},n.prototype.patch_deepCopy=function(t){for(var e=[],r=0;rthis.Match_MaxBits?-1!=(s=this.match_main(e,u.substring(0,this.Match_MaxBits),a))&&(-1==(f=this.match_main(e,u.substring(u.length-this.Match_MaxBits),a+u.length-this.Match_MaxBits))||s>=f)&&(s=-1):s=this.match_main(e,u,a),-1==s)i[o]=!1,n-=t[o].length2-t[o].length1;else{i[o]=!0,n=s-a;var l;if(l=-1==f?e.substring(s,s+u.length):e.substring(s,f+this.Match_MaxBits),u==l)e=e.substring(0,s)+this.diff_text2(t[o].diffs)+e.substring(s+u.length);else{var c=this.diff_main(u,l,!1);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(c)/u.length>this.Patch_DeleteThreshold)i[o]=!1;else{this.diff_cleanupSemanticLossless(c);for(var h,p=0,d=0;do[0][1].length){s=e-o[0][1].length;o[0][1]=r.substring(o[0][1].length)+o[0][1],i.start1-=s,i.start2-=s,i.length1+=s,i.length2+=s}if(i=t[t.length-1],0==(o=i.diffs).length||0!=o[o.length-1][0])o.push([0,r]),i.length1+=e,i.length2+=e;else if(e>o[o.length-1][1].length){var s=e-o[o.length-1][1].length;o[o.length-1][1]+=r.substring(0,s),i.length1+=s,i.length2+=s}return r},n.prototype.patch_splitMax=function(t){for(var e=this.Match_MaxBits,r=0;r2*e?(u.length1+=c.length,o+=c.length,f=!1,u.diffs.push([l,c]),i.diffs.shift()):(c=c.substring(0,e-u.length1-this.Patch_Margin),u.length1+=c.length,o+=c.length,0===l?(u.length2+=c.length,s+=c.length):f=!1,u.diffs.push([l,c]),c==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(c.length))}a=(a=this.diff_text2(u.diffs)).substring(a.length-this.Patch_Margin);var h=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);""!==h&&(u.length1+=h.length,u.length2+=h.length,0!==u.diffs.length&&0===u.diffs[u.diffs.length-1][0]?u.diffs[u.diffs.length-1][1]+=h:u.diffs.push([0,h])),f||t.splice(++r,0,u)}}},n.prototype.patch_toText=function(t){for(var e=[],r=0;r>1,l=-7,c=r?i-1:0,h=r?-1:1,p=t[e+c];for(c+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+c],c+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u,f=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=l?(a=0,s=l):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,f-=8);t[r+p-d]|=128*g}},{}],28:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],29:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function i(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}e.exports=function(t){return null!=t&&(n(t)||i(t)||!!t._isBuffer)}},{}],30:[function(t,e,r){"use strict";var n=Function.prototype.toString,i=/^\s*class /,o=function(t){try{var e=n.call(t).replace(/\/\/.*\n/g,"").replace(/\/\*[.\s\S]*\*\//g,"").replace(/\n/gm," ").replace(/ {2}/g," ");return i.test(e)}catch(t){return!1}},s=function(t){try{return!o(t)&&(n.call(t),!0)}catch(t){return!1}},a=Object.prototype.toString,u="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return s(t);if(o(t))return!1;var e=a.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],31:[function(t,e,r){e.exports=function(t){var e=n.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var n=Object.prototype.toString},{}],32:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],33:[function(t,e,r){function n(t){return String(t).replace(/"/g,""")}function i(t){return"[object Array]"===p(t)}function o(t){return"[object Date]"===p(t)}function s(t){return"[object RegExp]"===p(t)}function a(t){return"[object Error]"===p(t)}function u(t){return"[object Symbol]"===p(t)}function f(t){return"[object String]"===p(t)}function l(t){return"[object Number]"===p(t)}function c(t){return"[object Boolean]"===p(t)}function h(t,e){return D.call(t,e)}function p(t){return L.call(t)}function d(t){if(t.name)return t.name;var e=String(t).match(/^function\s*([\w$]+)/);return e?e[1]:void 0}function g(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r0?"0":"-0":String(e);r||(r={});var E=void 0===r.depth?5:r.depth;if(void 0===h&&(h=0),h>=E&&E>0&&"object"==typeof e)return"[Object]";if(void 0===p)p=[];else if(g(p,e)>=0)return"[Circular]";if("function"==typeof e){var S=d(e);return"[Function"+(S?": "+S:"")+"]"}if(u(e)){var A=Symbol.prototype.toString.call(e);return"object"==typeof e?_(A):A}if(m(e)){for(var T="<"+String(e.nodeName).toLowerCase(),L=e.attributes||[],D=0;D"}if(i(e))return 0===e.length?"[]":"[ "+k(e,w).join(", ")+" ]";if(a(e))return 0===(I=k(e,w)).length?"["+String(e)+"]":"{ ["+String(e)+"] "+I.join(", ")+" }";if("object"==typeof e&&"function"==typeof e.inspect)return e.inspect();if(y(e)){I=[];return j.call(e,function(t,r){I.push(w(r,e)+" => "+w(t,e))}),x("Map",C.call(e),I)}if(b(e)){var I=[];return O.call(e,function(t){I.push(w(t,e))}),x("Set",M.call(e),I)}if(l(e))return _(Number(e));if(c(e))return _(q.call(e));if(f(e))return _(w(String(e)));if(!o(e)&&!s(e)){var B=k(e,w);return 0===B.length?"{}":"{ "+B.join(", ")+" }"}return String(e)};var D=Object.prototype.hasOwnProperty||function(t){return t in this}},{}],34:[function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Array.prototype.slice,s=t("./isArguments"),a=Object.prototype.propertyIsEnumerable,u=!a.call({toString:null},"toString"),f=a.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(t){var e=t.constructor;return e&&e.prototype===t},h={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{c(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),d=function(t){if("undefined"==typeof window||!p)return c(t);try{return c(t)}catch(t){return!1}},g=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),o=s(t),a=e&&"[object String]"===i.call(t),c=[];if(!e&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var h=f&&r;if(a&&t.length>0&&!n.call(t,0))for(var p=0;p0)for(var g=0;g=0&&"[object Function]"===n.call(t.callee)),r}},{}],36:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),o="/"===s(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"))||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),s=Math.min(i.length,o.length),a=s,u=0;u1)for(var r=1;r0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===N.prototype||(e=i(e)),n?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):l(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?l(t,s,e,!1):m(t,s)):l(t,s,e,!1))):n||(s.reading=!1)}return h(s)}function l(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&y(t)),m(t,e)}function c(t,e){var r;return o(e)||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function h(t){return!t.ended&&(t.needReadable||t.length=z?t=z:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function d(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=p(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function g(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,y(t)}}function y(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(F("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?q(b,t):b(t))}function b(t){F("emit readable"),t.emit("readable"),E(t)}function m(t,e){e.readingMore||(e.readingMore=!0,q(v,t,e))}function v(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=C(t,e.buffer,e.decoder),r}function C(t,e,r){var n;return to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}function A(t,e){var r=N.allocUnsafe(t),n=e.head,i=1;for(n.data.copy(r),t-=n.data.length;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}function T(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,q(M,e,t))}function M(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function O(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return F("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?T(this):y(this),null;if(0===(t=d(t,e))&&e.ended)return 0===e.length&&T(this),null;var n=e.needReadable;F("need readable",n),(0===e.length||e.length-t0?S(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&T(this)),null!==i&&this.emit("data",i),i},u.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},u.prototype.pipe=function(t,e){function n(t,e){F("onunpipe"),t===h&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,o())}function i(){F("onend"),t.end()}function o(){F("cleanup"),t.removeListener("close",f),t.removeListener("finish",l),t.removeListener("drain",g),t.removeListener("error",u),t.removeListener("unpipe",n),h.removeListener("end",i),h.removeListener("end",c),h.removeListener("data",a),y=!0,!p.awaitDrain||t._writableState&&!t._writableState.needDrain||g()}function a(e){F("ondata"),b=!1,!1!==t.write(e)||b||((1===p.pipesCount&&p.pipes===t||p.pipesCount>1&&-1!==O(p.pipes,t))&&!y&&(F("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++,b=!0),h.pause())}function u(e){F("onerror",e),c(),t.removeListener("error",u),0===I(t,"error")&&t.emit("error",e)}function f(){t.removeListener("finish",l),c()}function l(){F("onfinish"),t.removeListener("close",f),c()}function c(){F("unpipe"),h.unpipe(t)}var h=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=t;break;case 1:p.pipes=[p.pipes,t];break;default:p.pipes.push(t)}p.pipesCount+=1,F("pipe count=%d opts=%j",p.pipesCount,e);var d=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?i:c;p.endEmitted?q(d):h.once("end",d),t.on("unpipe",n);var g=w(h);t.on("drain",g);var y=!1,b=!1;return h.on("data",a),s(t,"error",u),t.once("close",f),t.once("finish",l),t.emit("pipe",h),p.flowing||(F("pipe resume"),h.resume()),t},u.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o-1?setImmediate:j;f.WritableState=u;var M=t("core-util-is");M.inherits=t("inherits");var O={deprecate:t("util-deprecate")},q=t("./internal/streams/stream"),L=t("safe-buffer").Buffer,D=n.Uint8Array||function(){},I=t("./internal/streams/destroy");M.inherits(f,q),u.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(u.prototype,"buffer",{get:O.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}();var B;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(B=Function.prototype[Symbol.hasInstance],Object.defineProperty(f,Symbol.hasInstance,{value:function(t){return!!B.call(this,t)||t&&t._writableState instanceof u}})):B=function(t){return t instanceof this},f.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},f.prototype.write=function(t,e,r){var n=this._writableState,i=!1,u=s(t)&&!n.objectMode;return u&&!L.isBuffer(t)&&(t=o(t)),"function"==typeof e&&(r=e,e=null),u?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=a),n.ended?l(this,r):(u||c(this,n,t,r))&&(n.pendingcb++,i=p(this,n,u,t,e,r)),i},f.prototype.cork=function(){this._writableState.corked++},f.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||w(this,t))},f.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},f.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},f.prototype._writev=null,f.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||S(this,n,r)},Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),f.prototype.destroy=I.destroy,f.prototype._undestroy=I.undestroy,f.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":40,"./internal/streams/destroy":46,"./internal/streams/stream":47,_process:38,"core-util-is":6,inherits:28,"process-nextick-args":37,"safe-buffer":53,"util-deprecate":67}],45:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e,r){t.copy(e,r)}var o=t("safe-buffer").Buffer;e.exports=function(){function t(){n(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var e=o.allocUnsafe(t>>>0),r=this.head,n=0;r;)i(r.data,e,n),n+=r.data.length,r=r.next;return e},t}()},{"safe-buffer":53}],46:[function(t,e,r){"use strict";function n(t,e){t.emit("error",e)}var i=t("process-nextick-args");e.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;o||s?e?e(t):!t||this._writableState&&this._writableState.errorEmitted||i(n,this,t):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(i(n,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}))},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":37}],47:[function(t,e,r){e.exports=t("events").EventEmitter},{events:19}],48:[function(t,e,r){e.exports=t("./readable").PassThrough},{"./readable":49}],49:[function(t,e,r){(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":40,"./lib/_stream_passthrough.js":41,"./lib/_stream_readable.js":42,"./lib/_stream_transform.js":43,"./lib/_stream_writable.js":44}],50:[function(t,e,r){e.exports=t("./readable").Transform},{"./readable":49}],51:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":44}],52:[function(t,e,r){(function(r){var n=t("through"),i="undefined"!=typeof setImmediate?setImmediate:r.nextTick;e.exports=function(t,e){var r=n(t,e);r.pause();var o=r.resume,s=r.pause,a=!1;return r.pause=function(){return a=!0,s.apply(this,arguments)},r.resume=function(){return a=!1,o.apply(this,arguments)},i(function(){a||r.resume()}),r}}).call(this,t("_process"))},{_process:38,through:66}],53:[function(t,e,r){function n(t,e){for(var r in t)e[r]=t[r]}function i(t,e,r){return s(t,e,r)}var o=t("buffer"),s=o.Buffer;s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?e.exports=o:(n(o,r),r.Buffer=i),n(s,i),i.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return s(t,e,r)},i.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=s(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},i.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return s(t)},i.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o.SlowBuffer(t)}},{buffer:5}],54:[function(t,e,r){function n(){i.call(this)}e.exports=n;var i=t("events").EventEmitter;t("inherits")(n,i),n.Readable=t("readable-stream/readable.js"),n.Writable=t("readable-stream/writable.js"),n.Duplex=t("readable-stream/duplex.js"),n.Transform=t("readable-stream/transform.js"),n.PassThrough=t("readable-stream/passthrough.js"),n.Stream=n,n.prototype.pipe=function(t,e){function r(e){t.writable&&!1===t.write(e)&&f.pause&&f.pause()}function n(){f.readable&&f.resume&&f.resume()}function o(){l||(l=!0,t.end())}function s(){l||(l=!0,"function"==typeof t.destroy&&t.destroy())}function a(t){if(u(),0===i.listenerCount(this,"error"))throw t}function u(){f.removeListener("data",r),t.removeListener("drain",n),f.removeListener("end",o),f.removeListener("close",s),f.removeListener("error",a),t.removeListener("error",a),f.removeListener("end",u),f.removeListener("close",u),t.removeListener("close",u)}var f=this;f.on("data",r),t.on("drain",n),t._isStdio||e&&!1===e.end||(f.on("end",o),f.on("close",s));var l=!1;return f.on("error",a),t.on("error",a),f.on("end",u),f.on("close",u),t.on("close",u),t.emit("pipe",f),t}},{events:19,inherits:28,"readable-stream/duplex.js":39,"readable-stream/passthrough.js":48,"readable-stream/readable.js":49,"readable-stream/transform.js":50,"readable-stream/writable.js":51}],55:[function(t,e,r){"use strict";var n=t("function-bind"),i=t("es-abstract/es5"),o=n.call(Function.call,String.prototype.replace),s=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,a=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;e.exports=function(){var t=i.ToString(i.CheckObjectCoercible(this));return o(o(t,s,""),a,"")}},{"es-abstract/es5":12,"function-bind":23}],56:[function(t,e,r){"use strict";var n=t("function-bind"),i=t("define-properties"),o=t("./implementation"),s=t("./polyfill"),a=t("./shim"),u=n.call(Function.call,s());i(u,{getPolyfill:s,implementation:o,shim:a}),e.exports=u},{"./implementation":55,"./polyfill":57,"./shim":58,"define-properties":10,"function-bind":23}],57:[function(t,e,r){"use strict";var n=t("./implementation");e.exports=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:n}},{"./implementation":55}],58:[function(t,e,r){"use strict";var n=t("define-properties"),i=t("./polyfill");e.exports=function(){var t=i();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},{"./polyfill":57,"define-properties":10}],59:[function(t,e,r){"use strict";function n(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function i(t){var e=n(t);if("string"!=typeof e&&(y.isEncoding===b||!b(t)))throw new Error("Unknown encoding: "+t);return e||t}function o(t){this.encoding=i(t);var e;switch(this.encoding){case"utf16le":this.text=l,this.end=c,e=4;break;case"utf8":this.fillLast=f,e=4;break;case"base64":this.text=h,this.end=p,e=3;break;default:return this.write=d,void(this.end=g)}this.lastNeed=0,this.lastTotal=0,this.lastChar=y.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:-1}function a(t,e,r){var n=e.length-1;if(n=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}function u(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�".repeat(r);if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�".repeat(r+1);if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�".repeat(r+2)}}function f(t){var e=this.lastTotal-this.lastNeed,r=u(this,t,e);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function p(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function g(t){return t&&t.length?this.write(t):""}var y=t("safe-buffer").Buffer,b=y.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};r.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r"+t[1]+""}),i}function i(t){var e=document.createElement("DIV");e.id=t.id,e.setAttribute("class","test");var r=document.createElement("P");return r.setAttribute("class","name"),r.appendChild(document.createTextNode(t.name)),e.appendChild(r),d=e,p.appendChild(e),e}function o(t,e){var r=document.createElement("P");r.setAttribute("class","assert "+(t.ok?"ok":"fail"));var n=document.createElement("SPAN");if(n.setAttribute("class","ok"),n.appendChild(document.createTextNode(t.ok?"OK":"FAIL")),r.appendChild(n),t.name){var i=document.createElement("SPAN");i.setAttribute("class","name"),i.appendChild(document.createTextNode(t.name)),r.appendChild(i)}return e.appendChild(r),r.scrollIntoView({block:"end",behavior:"smooth"}),r}function s(t,e){var r=document.createElement("P");return r.setAttribute("class","comment"),r.appendChild(document.createTextNode(t)),e.appendChild(r),r}function a(t,e){var r=document.createElement("P");return r.setAttribute("class","end"),e.appendChild(r),r}function u(t,e){var r=t.actual,i=t.expected;r&&i&&"object"==typeof r&&"object"==typeof i&&(r=JSON.stringify(r),i=JSON.stringify(i));var o=document.createElement("SPAN");o.setAttribute("class","actual"),o.appendChild(document.createTextNode(r)),e.appendChild(o);var s=document.createElement("SPAN");if(s.setAttribute("class","expected"),s.appendChild(document.createTextNode(i)),e.appendChild(s),t.file){var a=document.createElement("SPAN");a.setAttribute("class","line");var u=/\/([^\/]+)$/.exec(t.file)[1];a.appendChild(document.createTextNode(u)),e.appendChild(a),console.warn(t.error.stack)}if(r&&i&&r.constructor==String&&i.constructor==String){var f=document.createElement("P");f.setAttribute("class","diff"),f.innerHTML=n(r,i),e.appendChild(f)}}function f(t){if("test"===t.type)d=i(t,d);else if("assert"===t.type){var e=o(t,d);t.ok||u(t,e)}else"end"===t.type?(a(t,d),d=d.parentNode):t.constructor===String?s(t,d):console.warn("tape-dom row",t.type,t)}function l(t){t.createStream({objectMode:!0}).on("data",f)}function c(){var t=document.createElement("style");t.setAttribute("type","text/css");var e=document.createTextNode(y);t.appendChild(e),document.head.appendChild(t)}function h(t){return"object"==typeof window&&(c(),l(t)),h}var p,d,g=new(t("googlediff")),y=t("./tape_css");"object"==typeof document&&((p=document.getElementById("tests"))||((p=document.createElement("div")).setAttribute("id","tests"),document.body.appendChild(p)),d=p),h.installCSS=c,h.stream=l,e.exports=h},{"./tape_css":61,googlediff:24}],61:[function(t,e,r){"use strict";e.exports="div.test{width:100%;border-top:1px dotted grey;margin-top:1em;background:#eef;font-weight:700;margin-bottom:1em}div#tests{margin-bottom:5em}p.assert{margin-top:0;margin-bottom:0;font-weight:400;width:100%}p.assert.ok{background:#efe;color:grey}p.assert.fail{background:#faa}p.comment{background:#eef;color:grey;font-style:italic;margin-top:.2em;margin-bottom:.2em;padding-left:2.4em}p.end{border-bottom:1px dotted grey;margin-top:1em;background:#eef;margin-top:.2em;margin-bottom:.2em}p.diff{background:#ffe;margin-top:0;margin-bottom:0;padding-top:.25em;padding-bottom:.25em;padding-left:4em;font-weight:400;white-space:pre-wrap}ins{background:#afa}del{background:#faa;text-decoration:strike}span.ok{font-weight:700}span.actual,span.expected,span.name{padding-left:1em;font-style:italic;max-width:25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}p.assert.fail span.name{color:#555}span.expected:before{content:'!=';padding-right:1em}span.line{padding-left:1em;float:right;text-align:right;overflow:hidden;text-overflow:ellipsis;font-family:monospace;color:#888}"},{}],62:[function(t,e,r){(function(n){function i(t){t||(t={});var e=o({autoclose:s(t.autoclose,!1)}),r=e.createStream({objectMode:t.objectMode}),i=r.pipe(t.stream||a());c&&i.on("error",function(t){e._exitCode=1});var u=!1;if(r.on("end",function(){u=!0}),!1===t.exit)return e;if(!c||!h)return e;return n.on("exit",function(t){if(0===t){if(!u)for(var r=e._results._only,i=0;i65||s(n)||s(i)?(r+=" expected: |-\n "+n+"\n",r+=" actual: |-\n "+i+"\n"):(r+=" expected: "+n+"\n",r+=" actual: "+i+"\n")}t.at&&(r+=" at: "+t.at+"\n");var o=t.actual&&t.actual.stack,u=t.error&&t.error.stack,f=a(o,u);if(f){var l=String(f).split("\n");r+=" stack: |-\n";for(var c=0;c=1&&t&&this.ifError(t),this.calledEnd&&this.fail(".end() called twice"),this.calledEnd=!0,this._end()},i.prototype._end=function(t){var e=this;if(this._progeny.length){var r=this._progeny.shift();return r.on("end",function(){e._end()}),void r.run()}this.ended||this.emit("end");var n=this._pendingAsserts();!this._planError&&void 0!==this._plan&&n&&(this._planError=!0,this.fail("plan != count",{expected:this._plan,actual:this.assertCount})),this.ended=!0},i.prototype._exit=function(){void 0===this._plan||this._planError||this.assertCount===this._plan?this.ended||this.fail("test exited without ending",{exiting:!0}):(this._planError=!0,this.fail("plan != count",{expected:this._plan,actual:this.assertCount,exiting:!0}))},i.prototype._pendingAsserts=function(){return void 0===this._plan?1:this._plan-(this._progeny.length+this.assertCount)},i.prototype._assert=function(t,e){var r=this,i=e.extra||{},o={id:r.assertCount++,ok:Boolean(t),skip:s(i.skip,e.skip),name:s(i.message,e.message,"(unnamed assert)"),operator:s(i.operator,e.operator),objectPrintDepth:r._objectPrintDepth};if((l(e,"actual")||l(i,"actual"))&&(o.actual=s(i.actual,e.actual)),(l(e,"expected")||l(i,"expected"))&&(o.expected=s(i.expected,e.expected)),this._ok=Boolean(this._ok&&t),t||(o.error=s(i.error,e.error,new Error(o.name))),!t)for(var u=(new Error("exception").stack||"").split("\n"),f=a.dirname(n)+a.sep,c=0;c0;i("hotkeys 单元测试",function(t){o("w",function(e){t.equal(e.keyCode,87,"单个按键 w keyCode == 87")}),n(document.body,87),o("enter",function(e){t.equal(e.keyCode,13,"单个特殊键按键 enter,enter验证 keyCode == 13")}),o("return",function(e){t.equal(e.keyCode,13,"单个特殊键按键 return,return验证 keyCode == 13")}),n(document.body,13),o("space",function(e){t.equal(e.keyCode,32,"单个特殊键按键 space,space验证 keyCode == 32")}),n(document.body,32),o("backspace",function(e){t.equal(e.keyCode,8,"单个特殊键按键 backspace,backspace 验证 keyCode == 8")}),n(document.body,8),o("tab",function(e){t.equal(e.keyCode,9,"单个特殊键按键 tab,tab 验证 keyCode == 9")}),n(document.body,9),o("clear",function(e){t.equal(e.keyCode,12,"单个特殊键按键 clear,clear 验证 keyCode == 12")}),n(document.body,12),o(",",function(e){t.equal(e.keyCode,188,"单个特殊键按键 , ,, 验证 keyCode == 188")}),n(document.body,188),o(".",function(e){t.equal(e.keyCode,190,"单个特殊键按键 . ,. 验证 keyCode == 190")}),n(document.body,190),o(".",function(e){t.equal(e.keyCode,190,"单个特殊键按键 . ,. 验证 keyCode == 190")}),n(document.body,190),o("/",function(e){t.equal(e.keyCode,191,"单个特殊键按键 / ,/ 验证 keyCode == 191")}),n(document.body,191),o("`",function(e){t.equal(e.keyCode,192,"单个特殊键按键 ` ,` 验证 keyCode == 192")}),n(document.body,192),o("-",function(e){t.equal(e.keyCode,s?173:189,"单个特殊键按键 -,- 验证 keyCode == 火狐?173:189")}),n(document.body,s?173:189),o("=",function(e){t.equal(e.keyCode,s?61:187,"单个特殊键按键 =,= 验证 keyCode == 火狐?61:187")}),n(document.body,s?61:187),o(";",function(e){t.equal(e.keyCode,s?59:186,"单个特殊键按键 ; ,; 验证 keyCode == 火狐?59:186")}),n(document.body,s?59:186),o("'".toString(),function(e){t.equal(e.keyCode,222,"单个特殊键按键 ' ,' 验证 keyCode == 222 ")}),n(document.body,222),o("\\".toString(),function(e){t.equal(e.keyCode,220,"单个特殊键按键 \\ ,\\ 验证 keyCode == 220 ")}),n(document.body,220),o("[".toString(),function(e){t.equal(e.keyCode,219,"单个特殊键按键 [ ,[ 验证 keyCode == 219 ")}),n(document.body,219),o("]".toString(),function(e){t.equal(e.keyCode,221,"单个特殊键按键 ] ,] 验证 keyCode == 221 ")}),n(document.body,221),o("left",function(e){t.equal(e.keyCode,37,"单个特殊键按键 left,left 验证 keyCode == 37")}),n(document.body,37),o("up",function(e){t.equal(e.keyCode,38,"单个特殊键按键 up,up 验证 keyCode == 38")}),n(document.body,38),o("del",function(e){t.equal(e.keyCode,46,"单个特殊键按键 del,del 验证 keyCode == 46")}),o("delete",function(e){t.equal(e.keyCode,46,"单个特殊键按键 delete,delete 验证 keyCode == 46")}),n(document.body,46),o("home",function(e){t.equal(e.keyCode,36,"单个特殊键按键 home,home 验证 keyCode == 36")}),n(document.body,36),o("pageup",function(e){t.equal(e.keyCode,33,"单个特殊键按键 pageup,pageup 验证 keyCode == 33")}),n(document.body,33),o("pagedown",function(e){t.equal(e.keyCode,34,"单个特殊键按键 pagedown,pagedown 验证 keyCode == 34")}),n(document.body,34),o("end",function(e){t.equal(e.keyCode,35,"单个特殊键按键 end,end 验证 keyCode == 35")}),n(document.body,35),o("right",function(e){t.equal(e.keyCode,39,"单个特殊键按键 right,right 验证 keyCode == 39")}),n(document.body,39),o("down",function(e){t.equal(e.keyCode,40,"单个特殊键按键 down,down 验证 keyCode == 40")}),n(document.body,40),o("esc",function(e){t.equal(e.keyCode,27,"单个特殊键按键 esc,esc 验证 keyCode == 27")}),o("escape",function(e){t.equal(e.keyCode,27,"单个特殊键按键 escape,escape 验证 keyCode == 27")}),n(document.body,27),o("CapsLock",function(e){t.equal(e.keyCode,20,"单个特殊键按键 CapsLock,CapsLock验证 keyCode == 20")}),o("⇪",function(e){t.equal(e.keyCode,20,"单个特殊键按键 ⇪,⇪验证 keyCode == 20")}),n(document.body,20),o("⌘+d",function(e){return t.equal(e.keyCode,82,"组合键 ⌘+d,d验证 keyCode == 82"),t.equal(e.metaKey,!0,"组合键 ⌘+d,alt验证 metaKey == true"),!1}),n(document.body,82,{metaKey:!0}),o("alt+d",function(e){t.equal(e.keyCode,68,"组合键 alt+d,d验证 keyCode == 68"),t.equal(e.altKey,!0,"组合键 alt+d,alt验证 altKey == true")}),n(document.body,68,{altKey:!0}),o("shift+a",function(e){t.equal(e.keyCode,65,"组合键 shift+a,a验证 keyCode == 65"),t.equal(e.shiftKey,!0,"组合键 shift+a,shift验证 shiftKey == true")}),n(document.body,65,{shiftKey:!0}),o("⇧+a",function(e){t.equal(e.keyCode,65,"组合键 ⇧+a,a验证 keyCode == 65"),t.equal(e.shiftKey,!0,"组合键 ⇧+a,⇧验证 shiftKey == true")}),n(document.body,65,{shiftKey:!0}),o("⌘+a",function(e){t.equal(e.keyCode,65,"组合键 ⌘+a,a验证 keyCode == 65"),t.equal(e.metaKey,!0,"组合键 ⌘+a,⌘验证 metaKey == true")}),n(document.body,65,{metaKey:!0}),o("⌃+a",function(e){t.equal(e.keyCode,65,"组合键 ⌃+a,a验证 keyCode == 65"),t.equal(e.ctrlKey,!0,"组合键 ⌃+a,⌃验证 ctrlKey == true")}),n(document.body,65,{ctrlKey:!0}),o.unbind("⌃+a"),o("⌥+a",function(e){t.equal(e.keyCode,65,"组合键 ⌥+a,a验证 keyCode == 65"),t.equal(e.altKey,!0,"组合键 ⌥+a,⌥验证 altKey == true")}),n(document.body,65,{altKey:!0}),o("ctrl+,,ctrl+d",function(e){t.equal(e.keyCode,188,"组合键 ctrl+,,,验证 keyCode == 65"),t.equal(e.ctrlKey,!0,"组合键 ctrl+,,ctrl验证 ctrlKey == true")}),n(document.body,188,{ctrlKey:!0}),o.unbind("ctrl+,,ctrl+d"),o("Ctrl+A",function(e){t.equal(e.keyCode,65,"大小写组合键 Ctrl+A,A验证 keyCode == 65"),t.equal(e.ctrlKey,!0,"大小写组合键 Ctrl+A,Ctrl验证 ctrlKey == true")}),n(document.body,65,{ctrlKey:!0}),o.unbind("Ctrl+A"),o("CTRL+A",function(e){t.equal(e.keyCode,65,"大小写组合键 CTRL+A,A验证 keyCode == 65"),t.equal(e.ctrlKey,!0,"大小写组合键 CTRL+A,CTRL验证 ctrlKey == true")}),n(document.body,65,{ctrlKey:!0}),o.unbind("CTRL+A"),o("⌃+a",function(){t.equal(o.getScope(),"all"," 验证 getScope() == all")}),n(document.body,65,{ctrlKey:!0}),o.unbind("⌃+a"),o("⌃+a","scope1",function(){t.equal(o.getScope(),"scope1"," 验证 getScope() == scope1")}),n(document.body,65,{ctrlKey:!0}),o("⌃+a","scope2",function(){t.equal(o.getScope(),"scope2"," 验证 getScope() == scope2")}),o.setScope("scope1"),n(document.body,65,{ctrlKey:!0}),o.setScope("scope2"),n(document.body,65,{ctrlKey:!0})})},{"../dist/hotkeys.js":1,tape:62,"tape-dom":60}]},{},[68]); +!function(){return function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r||t)},l,l.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s=0;e--)if(this[e]===t)return e;return-1});for(var t,e="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0,r={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,"⇪":20,capslock:20,",":188,".":190,"/":191,"`":192,"-":e?173:189,"=":e?61:187,";":e?59:186,"'":222,"[":219,"]":221,"\\":220},n="all",i={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":e?224:91,cmd:e?224:91,command:e?224:91},o=[],s={16:"shiftKey",18:"altKey",17:"ctrlKey"},a={16:!1,18:!1,17:!1},u={},f=1;f<20;f++)r["f"+f]=111+f;function l(t){return r[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)}function c(t){n=t||"all"}function h(){return n||"all"}function p(t,e,r){t.addEventListener?t.addEventListener(e,r,!1):t.attachEvent&&t.attachEvent("on"+e,function(){r(window.event)})}function d(t,e,r){var n;if(e.scope===r||"all"===e.scope){for(var i in n=e.mods.length>0,a)(!a[i]&&e.mods.indexOf(+i)>-1||a[i]&&-1===e.mods.indexOf(+i))&&(n=!1);(0!==e.mods.length||a[16]||a[18]||a[17]||a[91])&&!n&&"*"!==e.shortcut||!1===e.method(t,e)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function g(t,e){for(var r=t.length>=e.length?t:e,n=t.length>=e.length?e:t,i=0;i=0;)e[r-1]+=",",e.splice(r,1),r=e.lastIndexOf("");return e}function m(t,e,r){var n=b(t),i=[],o=0;for(void 0===r&&(r=e,e="all");o1&&(i=y(t)),(t="*"===(t=t[t.length-1])?"*":l(t))in u||(u[t]=[]),u[t].push({shortcut:n[o],scope:e,method:r,key:n[o],mods:i})}for(var v in s[e?224:91]="metaKey",a[e?224:91]=!1,"undefined"!=typeof document&&(p(document,"keydown",function(t){!function(t){var e,r=t.keyCode||t.which||t.charCode,n=u["*"];if(-1===o.indexOf(r)&&o.push(r),93!==r&&224!==r||(r=91),r in a){for(var f in a[r]=!0,i)i[f]===r&&(m[f]=!0);if(!n)return}for(var l in a)a[l]=t[s[l]];if(m.filter.call(this,t)){if(e=h(),n)for(c=0;c=0&&o.splice(r,1);93!==e&&224!==e||(e=91);if(e in a)for(var n in a[e]=!1,i)i[n]===e&&(m[n]=!1)}(t)})),t={setScope:c,getScope:h,deleteScope:function(t,e){var r,n,i;for(r in t||(t=h()),u)for(n=u[r],i=0;i1&&(o=y(r)),t="*"===(t=r[r.length-1])?"*":l(t),e||(e=h()),!u[t])return;for(var a=0;a0?u-4:u;var l=0;for(e=0;e>16&255,a[l++]=n>>8&255,a[l++]=255&n;2===s?(n=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,a[l++]=255&n):1===s&&(n=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,a[l++]=n>>8&255,a[l++]=255&n);return a},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o="",s=[],a=0,u=r-i;au?u:a+16383));1===i?(e=t[r-1],o+=n[e>>2],o+=n[e<<4&63],o+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],o+=n[e>>10],o+=n[e>>4&63],o+=n[e<<2&63],o+="=");return s.push(o),s.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function l(t,e,r){for(var i,o,s=[],a=e;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],3:[function(t,e,r){},{}],4:[function(t,e,r){arguments[4][3][0].apply(r,arguments)},{dup:3}],5:[function(t,e,r){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=a,r.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function s(t){if(t>o)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=a.prototype,e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(t)}return u(t,e,r)}function u(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return B(t)?function(t,e,r){if(e<0||t.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function p(t,e){if(a.isBuffer(t))return t.length;if(N(t)||B(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(n)return L(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),R(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var c=!0,h=0;hi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(l=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&f)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,c=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}return function(t){var e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return w(this,e,r);case"ascii":return x(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return v(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},a.prototype.compare=function(t,e,r,n,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),u=Math.min(o,s),f=this.slice(n,i),l=t.slice(e,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o,s,a,u,f,l,c,h,p,d=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return h=e,p=r,I(L(t,(c=this).length-h),c,h,p);case"ascii":return m(this,t,e,r);case"latin1":case"binary":return m(this,t,e,r);case"base64":return u=this,f=e,l=r,I(D(t),u,f,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s=e,a=r,I(function(t,e){for(var r,n,i,o=[],s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,(o=this).length-s),o,s,a);default:if(d)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function x(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function A(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(t,e,r,n,o){return e=+e,r>>>=0,o||A(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,o){return e=+e,r>>>=0,o||A(t,0,r,8),i.write(t,e,r,n,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return T(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return T(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function D(t){return n.toByteArray(function(t){if((t=t.trim().replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function I(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function B(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function N(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function R(t){return t!=t}},{"base64-js":2,ieee754:27}],6:[function(t,e,r){(function(t){function e(t){return Object.prototype.toString.call(t)}r.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},r.isBoolean=function(t){return"boolean"==typeof t},r.isNull=function(t){return null===t},r.isNullOrUndefined=function(t){return null==t},r.isNumber=function(t){return"number"==typeof t},r.isString=function(t){return"string"==typeof t},r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=function(t){return void 0===t},r.isRegExp=function(t){return"[object RegExp]"===e(t)},r.isObject=function(t){return"object"==typeof t&&null!==t},r.isDate=function(t){return"[object Date]"===e(t)},r.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},r.isFunction=function(t){return"function"==typeof t},r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t.isBuffer}).call(this,{isBuffer:t("../../is-buffer/index.js")})},{"../../is-buffer/index.js":29}],7:[function(t,e,r){var n=Array.prototype.slice,i=t("./lib/keys.js"),o=t("./lib/is_arguments.js"),s=e.exports=function(t,e,r){return r||(r={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?r.strict?t===e:t==e:function(t,e,r){var f,l;if(a(t)||a(e))return!1;if(t.prototype!==e.prototype)return!1;if(o(t))return!!o(e)&&(t=n.call(t),e=n.call(e),s(t,e,r));if(u(t)){if(!u(e))return!1;if(t.length!==e.length)return!1;for(f=0;f=0;f--)if(c[f]!=h[f])return!1;for(f=c.length-1;f>=0;f--)if(l=c[f],!s(t[l],e[l],r))return!1;return typeof t==typeof e}(t,e,r))};function a(t){return null==t}function u(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}},{"./lib/is_arguments.js":8,"./lib/keys.js":9}],8:[function(t,e,r){var n="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function i(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function o(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}(r=e.exports=n?i:o).supported=i,r.unsupported=o},{}],9:[function(t,e,r){function n(t){var e=[];for(var r in t)e.push(r);return e}(e.exports="function"==typeof Object.keys?Object.keys:n).shim=n},{}],10:[function(t,e,r){"use strict";var n=t("object-keys"),i=t("foreach"),o="function"==typeof Symbol&&"symbol"==typeof Symbol(),s=Object.prototype.toString,a=Object.defineProperty&&function(){var t={};try{for(var e in Object.defineProperty(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),u=function(t,e,r,n){var i;e in t&&("function"!=typeof(i=n)||"[object Function]"!==s.call(i)||!n())||(a?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},f=function(t,e){var r=arguments.length>2?arguments[2]:{},s=n(e);o&&(s=s.concat(Object.getOwnPropertySymbols(e))),i(s,function(n){u(t,n,e[n],r[n])})};f.supportsDescriptors=!!a,e.exports=f},{foreach:21,"object-keys":34}],11:[function(t,e,r){e.exports=function(){for(var t=0;t>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(n(e)||0===e||!i(e))return 0;var r=o(e)*Math.floor(Math.abs(e));return s(r,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:a,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0},IsPropertyDescriptor:function(t){if("Object"!==this.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(f(t,r)&&!e[r])return!1;var n=f(t,"[[Value]]"),i=f(t,"[[Get]]")||f(t,"[[Set]]");if(n&&i)throw new TypeError("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");return!(!f(t,"[[Get]]")&&!f(t,"[[Set]]"))},IsDataDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");return!(!f(t,"[[Value]]")&&!f(t,"[[Writable]]"))},IsGenericDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");return!this.IsAccessorDescriptor(t)&&!this.IsDataDescriptor(t)},FromPropertyDescriptor:function(t){if(void 0===t)return t;if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");if(this.IsDataDescriptor(t))return{value:t["[[Value]]"],writable:!!t["[[Writable]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};if(this.IsAccessorDescriptor(t))return{get:t["[[Get]]"],set:t["[[Set]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};throw new TypeError("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(t){if("Object"!==this.Type(t))throw new TypeError("ToPropertyDescriptor requires an object");var e={};if(f(t,"enumerable")&&(e["[[Enumerable]]"]=this.ToBoolean(t.enumerable)),f(t,"configurable")&&(e["[[Configurable]]"]=this.ToBoolean(t.configurable)),f(t,"value")&&(e["[[Value]]"]=t.value),f(t,"writable")&&(e["[[Writable]]"]=this.ToBoolean(t.writable)),f(t,"get")){var r=t.get;if(void 0!==r&&!this.IsCallable(r))throw new TypeError("getter must be a function");e["[[Get]]"]=r}if(f(t,"set")){var n=t.set;if(void 0!==n&&!this.IsCallable(n))throw new TypeError("setter must be a function");e["[[Set]]"]=n}if((f(e,"[[Get]]")||f(e,"[[Set]]"))&&(f(e,"[[Value]]")||f(e,"[[Writable]]")))throw new TypeError("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}};e.exports=l},{"./helpers/isFinite":13,"./helpers/isNaN":14,"./helpers/mod":15,"./helpers/sign":16,"es-to-primitive/es5":17,has:26,"is-callable":30}],13:[function(t,e,r){var n=Number.isNaN||function(t){return t!=t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!n(t)&&t!==1/0&&t!==-1/0}},{}],14:[function(t,e,r){e.exports=Number.isNaN||function(t){return t!=t}},{}],15:[function(t,e,r){e.exports=function(t,e){var r=t%e;return Math.floor(r>=0?r:r+e)}},{}],16:[function(t,e,r){e.exports=function(t){return t>=0?1:-1}},{}],17:[function(t,e,r){"use strict";var n=Object.prototype.toString,i=t("./helpers/isPrimitive"),o=t("is-callable"),s=function(t,e){var r=e||("[object Date]"===n.call(t)?String:Number);if(r===String||r===Number){var s,a,u=r===String?["toString","valueOf"]:["valueOf","toString"];for(a=0;a0&&this._events[t].length>r&&(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},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){if(!i(e))throw TypeError("listener must be a function");var r=!1;function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var r,n,s,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(s=(r=this._events[t]).length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(a=s;a-- >0;)if(r[a]===e||r[a].listener&&r[a].listener===e){n=a;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;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(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],20:[function(t,e,r){var n=t("is-function");e.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this);"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;ne.length?t:e,s=t.length>e.length?e:t,a=o.indexOf(s);if(-1!=a)return i=[[1,o.substring(0,a)],[0,s],[1,o.substring(a+s.length)]],t.length>e.length&&(i[0][0]=i[2][0]=-1),i;if(1==s.length)return[[-1,t],[1,e]];var u=this.diff_halfMatch_(t,e);if(u){var f=u[0],l=u[1],c=u[2],h=u[3],p=u[4],d=this.diff_main(f,c,r,n),g=this.diff_main(l,h,r,n);return d.concat([[0,p]],g)}return r&&t.length>100&&e.length>100?this.diff_lineMode_(t,e,n):this.diff_bisect_(t,e,n)},n.prototype.diff_lineMode_=function(t,e,r){t=(l=this.diff_linesToChars_(t,e)).chars1,e=l.chars2;var n=l.lineArray,i=this.diff_main(t,e,!1,r);this.diff_charsToLines_(i,n),this.diff_cleanupSemantic(i),i.push([0,""]);for(var o=0,s=0,a=0,u="",f="";o=1&&a>=1){i.splice(o-s-a,s+a),o=o-s-a;for(var l,c=(l=this.diff_main(u,f,!1,r)).length-1;c>=0;c--)i.splice(o,0,l[c]);o+=l.length}a=0,s=0,u="",f=""}o++}return i.pop(),i},n.prototype.diff_bisect_=function(t,e,r){for(var n=t.length,i=e.length,o=Math.ceil((n+i)/2),s=o,a=2*o,u=new Array(a),f=new Array(a),l=0;lr);b++){for(var m=-b+p;m<=b-d;m+=2){for(var v=s+m,w=(S=m==-b||m!=b&&u[v-1]n)d+=2;else if(w>i)p+=2;else if(h){if((k=s+c-m)>=0&&k=(x=n-f[k]))return this.diff_bisectSplit_(t,e,S,w,r)}}for(var _=-b+g;_<=b-y;_+=2){for(var x,k=s+_,E=(x=_==-b||_!=b&&f[k-1]n)y+=2;else if(E>i)g+=2;else if(!h){if((v=s+c-_)>=0&&v=(x=n-x))return this.diff_bisectSplit_(t,e,S,w,r)}}}}return[[-1,t],[1,e]]},n.prototype.diff_bisectSplit_=function(t,e,r,n,i){var o=t.substring(0,r),s=e.substring(0,n),a=t.substring(r),u=e.substring(n),f=this.diff_main(o,s,!1,i),l=this.diff_main(a,u,!1,i);return f.concat(l)},n.prototype.diff_linesToChars_=function(t,e){var r=[],n={};function i(t){for(var e="",i=0,o=-1,s=r.length;on?t=t.substring(r-n):re.length?t:e,n=t.length>e.length?e:t;if(r.length<4||2*n.length=t.length?[n,o,s,a,l]:null}var s,a,u,f,l,c=o(r,n,Math.ceil(r.length/4)),h=o(r,n,Math.ceil(r.length/2));return c||h?(s=h?c&&c[4].length>h[4].length?c:h:c,t.length>e.length?(a=s[0],u=s[1],f=s[2],l=s[3]):(f=s[0],l=s[1],a=s[2],u=s[3]),[a,u,f,l,s[4]]):null},n.prototype.diff_cleanupSemantic=function(t){for(var e=!1,r=[],n=0,i=null,o=0,s=0,a=0,u=0,f=0;o0?r[n-1]:-1,s=0,a=0,u=0,f=0,i=null,e=!0)),o++;for(e&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),o=1;o=p?(h>=l.length/2||h>=c.length/2)&&(t.splice(o,0,[0,c.substring(0,h)]),t[o-1][1]=l.substring(0,l.length-h),t[o+1][1]=c.substring(h),o++):(p>=l.length/2||p>=c.length/2)&&(t.splice(o,0,[0,l.substring(0,p)]),t[o-1][0]=1,t[o-1][1]=c.substring(0,c.length-p),t[o+1][0]=-1,t[o+1][1]=l.substring(p),o++),o++}o++}},n.prototype.diff_cleanupSemanticLossless=function(t){function e(t,e){if(!t||!e)return 6;var r=t.charAt(t.length-1),i=e.charAt(0),o=r.match(n.nonAlphaNumericRegex_),s=i.match(n.nonAlphaNumericRegex_),a=o&&r.match(n.whitespaceRegex_),u=s&&i.match(n.whitespaceRegex_),f=a&&r.match(n.linebreakRegex_),l=u&&i.match(n.linebreakRegex_),c=f&&t.match(n.blanklineEndRegex_),h=l&&e.match(n.blanklineStartRegex_);return c||h?5:f||l?4:o&&!a&&u?3:a||u?2:o||s?1:0}for(var r=1;r=h&&(h=p,f=i,l=o,c=s)}t[r-1][1]!=f&&(f?t[r-1][1]=f:(t.splice(r-1,1),r--),t[r][1]=l,c?t[r+1][1]=c:(t.splice(r+1,1),r--))}r++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){for(var e=!1,r=[],n=0,i=null,o=0,s=!1,a=!1,u=!1,f=!1;o0?r[n-1]:-1,u=f=!1),e=!0)),o++;e&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push([0,""]);for(var e,r=0,n=0,i=0,o="",s="";r1?(0!==n&&0!==i&&(0!==(e=this.diff_commonPrefix(s,o))&&(r-n-i>0&&0==t[r-n-i-1][0]?t[r-n-i-1][1]+=s.substring(0,e):(t.splice(0,0,[0,s.substring(0,e)]),r++),s=s.substring(e),o=o.substring(e)),0!==(e=this.diff_commonSuffix(s,o))&&(t[r][1]=s.substring(s.length-e)+t[r][1],s=s.substring(0,s.length-e),o=o.substring(0,o.length-e))),0===n?t.splice(r-i,n+i,[1,s]):0===i?t.splice(r-n,n+i,[-1,o]):t.splice(r-n-i,n+i,[-1,o],[1,s]),r=r-n-i+(n?1:0)+(i?1:0)+1):0!==r&&0==t[r-1][0]?(t[r-1][1]+=t[r][1],t.splice(r,1)):r++,i=0,n=0,o="",s=""}""===t[t.length-1][1]&&t.pop();var a=!1;for(r=1;re));r++)o=n,s=i;return t.length!=r&&-1===t[r][0]?s:s+(e-o)},n.prototype.diff_prettyHtml=function(t){for(var e=[],r=/&/g,n=//g,o=/\n/g,s=0;s");switch(a){case 1:e[s]=''+u+"";break;case-1:e[s]=''+u+"";break;case 0:e[s]=""+u+""}}return e.join("")},n.prototype.diff_text1=function(t){for(var e=[],r=0;rthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var n=this.match_alphabet_(e),i=this;function o(t,n){var o=t/e.length,s=Math.abs(r-n);return i.Match_Distance?o+s/i.Match_Distance:s?1:o}var s=this.Match_Threshold,a=t.indexOf(e,r);-1!=a&&(s=Math.min(o(0,a),s),-1!=(a=t.lastIndexOf(e,r+e.length))&&(s=Math.min(o(0,a),s)));var u,f,l=1<=d;b--){var m=n[t.charAt(b-1)];if(y[b]=0===p?(y[b+1]<<1|1)&m:(y[b+1]<<1|1)&m|(c[b+1]|c[b])<<1|1|c[b+1],y[b]&l){var v=o(p,b-1);if(v<=s){if(s=v,!((a=b-1)>r))break;d=Math.max(1,2*r-a)}}}if(o(p+1,r)>s)break;c=y}return a},n.prototype.match_alphabet_=function(t){for(var e={},r=0;r2&&(this.diff_cleanupSemantic(o),this.diff_cleanupEfficiency(o));else if(t&&"object"==typeof t&&void 0===e&&void 0===r)o=t,i=this.diff_text1(o);else if("string"==typeof t&&e&&"object"==typeof e&&void 0===r)i=t,o=e;else{if("string"!=typeof t||"string"!=typeof e||!r||"object"!=typeof r)throw new Error("Unknown call format to patch_make.");i=t,o=r}if(0===o.length)return[];for(var s=[],a=new n.patch_obj,u=0,f=0,l=0,c=i,h=i,p=0;p=2*this.Patch_Margin&&u&&(this.patch_addContext_(a,c),s.push(a),a=new n.patch_obj,u=0,c=h,f=l)}1!==d&&(f+=g.length),-1!==d&&(l+=g.length)}return u&&(this.patch_addContext_(a,c),s.push(a)),s},n.prototype.patch_deepCopy=function(t){for(var e=[],r=0;rthis.Match_MaxBits?-1!=(s=this.match_main(e,f.substring(0,this.Match_MaxBits),u))&&(-1==(l=this.match_main(e,f.substring(f.length-this.Match_MaxBits),u+f.length-this.Match_MaxBits))||s>=l)&&(s=-1):s=this.match_main(e,f,u),-1==s)i[o]=!1,n-=t[o].length2-t[o].length1;else if(i[o]=!0,n=s-u,f==(a=-1==l?e.substring(s,s+f.length):e.substring(s,l+this.Match_MaxBits)))e=e.substring(0,s)+this.diff_text2(t[o].diffs)+e.substring(s+f.length);else{var c=this.diff_main(f,a,!1);if(f.length>this.Match_MaxBits&&this.diff_levenshtein(c)/f.length>this.Patch_DeleteThreshold)i[o]=!1;else{this.diff_cleanupSemanticLossless(c);for(var h,p=0,d=0;do[0][1].length){var s=e-o[0][1].length;o[0][1]=r.substring(o[0][1].length)+o[0][1],i.start1-=s,i.start2-=s,i.length1+=s,i.length2+=s}if(0==(o=(i=t[t.length-1]).diffs).length||0!=o[o.length-1][0])o.push([0,r]),i.length1+=e,i.length2+=e;else if(e>o[o.length-1][1].length){s=e-o[o.length-1][1].length;o[o.length-1][1]+=r.substring(0,s),i.length1+=s,i.length2+=s}return r},n.prototype.patch_splitMax=function(t){for(var e=this.Match_MaxBits,r=0;r2*e?(u.length1+=c.length,o+=c.length,f=!1,u.diffs.push([l,c]),i.diffs.shift()):(c=c.substring(0,e-u.length1-this.Patch_Margin),u.length1+=c.length,o+=c.length,0===l?(u.length2+=c.length,s+=c.length):f=!1,u.diffs.push([l,c]),c==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(c.length))}a=(a=this.diff_text2(u.diffs)).substring(a.length-this.Patch_Margin);var h=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);""!==h&&(u.length1+=h.length,u.length2+=h.length,0!==u.diffs.length&&0===u.diffs[u.diffs.length-1][0]?u.diffs[u.diffs.length-1][1]+=h:u.diffs.push([0,h])),f||t.splice(++r,0,u)}}},n.prototype.patch_toText=function(t){for(var e=[],r=0;r>1,l=-7,c=r?i-1:0,h=r?-1:1,p=t[e+c];for(c+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+c],c+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u,f=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=l?(a=0,s=l):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,f-=8);t[r+p-d]|=128*g}},{}],28:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],29:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}e.exports=function(t){return null!=t&&(n(t)||"function"==typeof(e=t).readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))||!!t._isBuffer);var e}},{}],30:[function(t,e,r){"use strict";var n=Function.prototype.toString,i=/^\s*class /,o=function(t){try{var e=n.call(t).replace(/\/\/.*\n/g,"").replace(/\/\*[.\s\S]*\*\//g,"").replace(/\n/gm," ").replace(/ {2}/g," ");return i.test(e)}catch(t){return!1}},s=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(a)return function(t){try{return!o(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(o(t))return!1;var e=s.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],31:[function(t,e,r){e.exports=function(t){var e=n.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var n=Object.prototype.toString},{}],32:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],33:[function(t,e,r){var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,f=a&&u&&"function"==typeof u.get?u.get:null,l=a&&Set.prototype.forEach,c=Boolean.prototype.valueOf,h=Object.prototype.toString;function p(t){return"[object Array]"===y(t)}e.exports=function t(e,r,n,i){if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return"'"+e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,b)+"'";if("number"==typeof e)return 0===e?1/0/e>0?"0":"-0":String(e);r||(r={});var a,u=void 0===r.depth?5:r.depth;if(void 0===n&&(n=0),n>=u&&u>0&&"object"==typeof e)return"[Object]";if(void 0===i)i=[];else if(function(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r=0)return"[Circular]";function h(e,o){return o&&(i=i.slice()).push(o),t(e,r,n+1,i)}if("function"==typeof e){var d=function(t){if(t.name)return t.name;var e=String(t).match(/^function\s*([\w$]+)/);if(e)return e[1]}(e);return"[Function"+(d?": "+d:"")+"]"}if("[object Symbol]"===y(e)){var g=Symbol.prototype.toString.call(e);return"object"==typeof e?m(g):g}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var _="<"+String(e.nodeName).toLowerCase(),x=e.attributes||[],k=0;k"}if(p(e))return 0===e.length?"[]":"[ "+w(e,h).join(", ")+" ]";if("[object Error]"===y(e))return 0===(E=w(e,h)).length?"["+String(e)+"]":"{ ["+String(e)+"] "+E.join(", ")+" }";if("object"==typeof e&&"function"==typeof e.inspect)return e.inspect();if(function(t){if(!o)return!1;try{o.call(t);try{f.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var E=[];return s.call(e,function(t,r){E.push(h(r,e)+" => "+h(t,e))}),v("Map",o.call(e),E)}if(function(t){if(!f)return!1;try{f.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){E=[];return l.call(e,function(t){E.push(h(t,e))}),v("Set",f.call(e),E)}if("[object Number]"===y(e))return m(Number(e));if("[object Boolean]"===y(e))return m(c.call(e));if("[object String]"===y(e))return m(h(String(e)));if("[object Date]"!==y(e)&&"[object RegExp]"!==y(e)){var S=w(e,h);return 0===S.length?"{}":"{ "+S.join(", ")+" }"}return String(e)};var d=Object.prototype.hasOwnProperty||function(t){return t in this};function g(t,e){return d.call(t,e)}function y(t){return h.call(t)}function b(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+e.toString(16)}function m(t){return"Object("+t+")"}function v(t,e,r){return t+" ("+e+") {"+r.join(", ")+"}"}function w(t,e){var r=p(t),n=[];if(r){n.length=t.length;for(var i=0;i0&&!n.call(t,0))for(var g=0;g0)for(var y=0;y=0&&"[object Function]"===n.call(t.callee)),r}},{}],36:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(t){return n.exec(t).slice(1)};function o(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!n;i--){var s=i>=0?arguments[i]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,n="/"===s.charAt(0))}return(n?"/":"")+(r=e(o(r.split("/"),function(t){return!!t}),!n).join("/"))||"."},r.normalize=function(t){var n=r.isAbsolute(t),i="/"===s(t,-1);return(t=e(o(t.split("/"),function(t){return!!t}),!n).join("/"))||n||(t="."),t&&i&&(t+="/"),(n?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(o(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),s=Math.min(i.length,o.length),a=s,u=0;u1)for(var r=1;r0?("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===f.prototype||(s=e,e=f.from(s)),n?u.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,u,e,!0):u.ended?t.emit("error",new Error("stream.push() after EOF")):(u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?_(t,u,e,!1):C(t,u)):_(t,u,e,!1))):n||(u.reading=!1));return!(a=u).ended&&(a.needReadable||a.lengthe.highWaterMark&&(e.highWaterMark=((r=t)>=x?r=x:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0));var r}function E(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(p("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i(S,t):S(t))}function S(t){p("emit readable"),t.emit("readable"),M(t)}function C(t,e){e.readingMore||(e.readingMore=!0,i(j,t,e))}function j(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=f.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function q(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i(L,e,t))}function L(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function D(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return p("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?q(this):E(this),null;if(0===(t=k(t,e))&&e.ended)return 0===e.length&&q(this),null;var n,i=e.needReadable;return p("need readable",i),(0===e.length||e.length-t0?O(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&q(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,p("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:w;function f(e,r){p("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),t.removeListener("close",m),t.removeListener("finish",v),t.removeListener("drain",h),t.removeListener("error",b),t.removeListener("unpipe",f),n.removeListener("end",l),n.removeListener("end",w),n.removeListener("data",y),d=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function l(){p("onend"),t.end()}o.endEmitted?i(u):n.once("end",u),t.on("unpipe",f);var c,h=(c=n,function(){var t=c._readableState;p("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(c,"data")&&(t.flowing=!0,M(c))});t.on("drain",h);var d=!1;var g=!1;function y(e){p("ondata"),g=!1,!1!==t.write(e)||g||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==D(o.pipes,t))&&!d&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,g=!0),n.pause())}function b(e){p("onerror",e),w(),t.removeListener("error",b),0===a(t,"error")&&t.emit("error",e)}function m(){t.removeListener("finish",v),w()}function v(){p("onfinish"),t.removeListener("close",m),w()}function w(){p("unpipe"),n.unpipe(t)}return n.on("data",y),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",b),t.once("close",m),t.once("finish",v),t.emit("pipe",n),o.flowing||(p("pipe resume"),n.resume()),t},v.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o-1?setImmediate:i;b.WritableState=y;var u=t("core-util-is");u.inherits=t("inherits");var f={deprecate:t("util-deprecate")},l=t("./internal/streams/stream"),c=t("safe-buffer").Buffer,h=n.Uint8Array||function(){};var p,d=t("./internal/streams/destroy");function g(){}function y(e,r){s=s||t("./_stream_duplex"),e=e||{},this.objectMode=!!e.objectMode,r instanceof s&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,u=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if(p=r,p.writing=!1,p.writecb=null,p.length-=p.writelen,p.writelen=0,e)u=t,f=r,l=n,c=e,h=o,--f.pendingcb,l?(i(h,c),i(k,u,f),u._writableState.errorEmitted=!0,u.emit("error",c)):(h(c),u._writableState.errorEmitted=!0,u.emit("error",c),k(u,f));else{var s=_(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||w(t,r),n?a(v,t,r,s,o):v(t,r,s,o)}var u,f,l,c,h;var p}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function b(e){if(s=s||t("./_stream_duplex"),!(p.call(b,this)||this instanceof s))return new b(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function m(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function v(t,e,r,n){var i,o;r||(i=t,0===(o=e).length&&o.needDrain&&(o.needDrain=!1,i.emit("drain"))),e.pendingcb--,n(),k(t,e)}function w(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,m(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e)}else{for(;r;){var f=r.chunk,l=r.encoding,c=r.callback;if(m(t,e,!1,e.objectMode?1:f.length,f,l,c),r=r.next,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function x(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),k(t,e)})}function k(t,e){var r,n,o=_(e);return o&&(r=t,(n=e).prefinished||n.finalCalled||("function"==typeof r._final?(n.pendingcb++,n.finalCalled=!0,i(x,r,n)):(n.prefinished=!0,r.emit("prefinish"))),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),o}u.inherits(b,l),y.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(y.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||t&&t._writableState instanceof y}})):p=function(t){return t instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(t,e,r){var n,o,s,a,u,f,l,p,d,y,b,v=this._writableState,w=!1,_=(n=t,(c.isBuffer(n)||n instanceof h)&&!v.objectMode);return _&&!c.isBuffer(t)&&(o=t,t=c.from(o)),"function"==typeof e&&(r=e,e=null),_?e="buffer":e||(e=v.defaultEncoding),"function"!=typeof r&&(r=g),v.ended?(d=this,y=r,b=new Error("write after end"),d.emit("error",b),i(y,b)):(_||(s=this,a=v,f=r,l=!0,p=!1,null===(u=t)?p=new TypeError("May not write null values to stream"):"string"==typeof u||void 0===u||a.objectMode||(p=new TypeError("Invalid non-string/buffer chunk")),p&&(s.emit("error",p),i(f,p),l=!1),l))&&(v.pendingcb++,w=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},b.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,k(t,e),r&&(e.finished?i(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),b.prototype.destroy=d.destroy,b.prototype._undestroy=d.undestroy,b.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":40,"./internal/streams/destroy":46,"./internal/streams/stream":47,_process:38,"core-util-is":6,inherits:28,"process-nextick-args":37,"safe-buffer":53,"util-deprecate":67}],45:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer;e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,r=o,i=a,e.copy(r,i),a+=s.data.length,s=s.next;return o},t}()},{"safe-buffer":53}],46:[function(t,e,r){"use strict";var n=t("process-nextick-args");function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;o||s?e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n(i,this,t):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(n(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}))},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":37}],47:[function(t,e,r){e.exports=t("events").EventEmitter},{events:19}],48:[function(t,e,r){e.exports=t("./readable").PassThrough},{"./readable":49}],49:[function(t,e,r){(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":40,"./lib/_stream_passthrough.js":41,"./lib/_stream_readable.js":42,"./lib/_stream_transform.js":43,"./lib/_stream_writable.js":44}],50:[function(t,e,r){e.exports=t("./readable").Transform},{"./readable":49}],51:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":44}],52:[function(t,e,r){(function(r){var n=t("through"),i="undefined"!=typeof setImmediate?setImmediate:r.nextTick;e.exports=function(t,e){var r=n(t,e);r.pause();var o=r.resume,s=r.pause,a=!1;return r.pause=function(){return a=!0,s.apply(this,arguments)},r.resume=function(){return a=!1,o.apply(this,arguments)},i(function(){a||r.resume()}),r}}).call(this,t("_process"))},{_process:38,through:66}],53:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=s),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:5}],54:[function(t,e,r){e.exports=i;var n=t("events").EventEmitter;function i(){n.call(this)}t("inherits")(i,n),i.Readable=t("readable-stream/readable.js"),i.Writable=t("readable-stream/writable.js"),i.Duplex=t("readable-stream/duplex.js"),i.Transform=t("readable-stream/transform.js"),i.PassThrough=t("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(l(),0===n.listenerCount(this,"error"))throw t}function l(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",l),r.removeListener("close",l),t.removeListener("close",l)}return r.on("error",f),t.on("error",f),r.on("end",l),r.on("close",l),t.on("close",l),t.emit("pipe",r),t}},{events:19,inherits:28,"readable-stream/duplex.js":39,"readable-stream/passthrough.js":48,"readable-stream/readable.js":49,"readable-stream/transform.js":50,"readable-stream/writable.js":51}],55:[function(t,e,r){"use strict";var n=t("function-bind"),i=t("es-abstract/es5"),o=n.call(Function.call,String.prototype.replace),s=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,a=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;e.exports=function(){var t=i.ToString(i.CheckObjectCoercible(this));return o(o(t,s,""),a,"")}},{"es-abstract/es5":12,"function-bind":23}],56:[function(t,e,r){"use strict";var n=t("function-bind"),i=t("define-properties"),o=t("./implementation"),s=t("./polyfill"),a=t("./shim"),u=n.call(Function.call,s());i(u,{getPolyfill:s,implementation:o,shim:a}),e.exports=u},{"./implementation":55,"./polyfill":57,"./shim":58,"define-properties":10,"function-bind":23}],57:[function(t,e,r){"use strict";var n=t("./implementation");e.exports=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:n}},{"./implementation":55}],58:[function(t,e,r){"use strict";var n=t("define-properties"),i=t("./polyfill");e.exports=function(){var t=i();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},{"./polyfill":57,"define-properties":10}],59:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=l,this.end=c,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:-1}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�".repeat(r);if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�".repeat(r+1);if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�".repeat(r+2)}}(this,t,e);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}r.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":53}],60:[function(t,e,r){"use strict";var n,i,o=new(t("googlediff")),s=t("./tape_css");function a(t,e){var r=t.actual,n=t.expected;r&&n&&"object"==typeof r&&"object"==typeof n&&(r=JSON.stringify(r),n=JSON.stringify(n));var i=document.createElement("SPAN");i.setAttribute("class","actual"),i.appendChild(document.createTextNode(r)),e.appendChild(i);var s=document.createElement("SPAN");if(s.setAttribute("class","expected"),s.appendChild(document.createTextNode(n)),e.appendChild(s),t.file){var a=document.createElement("SPAN");a.setAttribute("class","line");var u=/\/([^\/]+)$/.exec(t.file)[1];a.appendChild(document.createTextNode(u)),e.appendChild(a),console.warn(t.error.stack)}if(r&&n&&r.constructor==String&&n.constructor==String){var f=document.createElement("P");f.setAttribute("class","diff"),f.innerHTML=function(t,e){var r=o.diff_main(e,t);o.diff_cleanupSemantic(r);var n,i="";return r.forEach(function(t){switch(t[0]){case 0:n="span";break;case 1:n="ins";break;case-1:n="del"}i+="<"+n+">"+t[1]+""}),i}(r,n),e.appendChild(f)}}function u(t){if("test"===t.type)i=function(t){var e=document.createElement("DIV");e.id=t.id,e.setAttribute("class","test");var r=document.createElement("P");return r.setAttribute("class","name"),r.appendChild(document.createTextNode(t.name)),e.appendChild(r),i=e,n.appendChild(e),e}(t);else if("assert"===t.type){var e=function(t,e){var r=document.createElement("P");r.setAttribute("class","assert "+(t.ok?"ok":"fail"));var n=document.createElement("SPAN");if(n.setAttribute("class","ok"),n.appendChild(document.createTextNode(t.ok?"OK":"FAIL")),r.appendChild(n),t.name){var i=document.createElement("SPAN");i.setAttribute("class","name"),i.appendChild(document.createTextNode(t.name)),r.appendChild(i)}return e.appendChild(r),r.scrollIntoView({block:"end",behavior:"smooth"}),r}(t,i);t.ok||a(t,e)}else"end"===t.type?(u=i,(f=document.createElement("P")).setAttribute("class","end"),u.appendChild(f),i=i.parentNode):t.constructor===String?(r=t,o=i,(s=document.createElement("P")).setAttribute("class","comment"),s.appendChild(document.createTextNode(r)),o.appendChild(s)):console.warn("tape-dom row",t.type,t);var r,o,s,u,f}function f(t){t.createStream({objectMode:!0}).on("data",u)}function l(){var t=document.createElement("style");t.setAttribute("type","text/css");var e=document.createTextNode(s);t.appendChild(e),document.head.appendChild(t)}function c(t){return"object"==typeof window&&(l(),f(t)),c}"object"==typeof document&&((n=document.getElementById("tests"))||((n=document.createElement("div")).setAttribute("id","tests"),document.body.appendChild(n)),i=n),c.installCSS=l,c.stream=f,e.exports=c},{"./tape_css":61,googlediff:24}],61:[function(t,e,r){"use strict";e.exports="div.test{width:100%;border-top:1px dotted grey;margin-top:1em;background:#eef;font-weight:700;margin-bottom:1em}div#tests{margin-bottom:5em}p.assert{margin-top:0;margin-bottom:0;font-weight:400;width:100%}p.assert.ok{background:#efe;color:grey}p.assert.fail{background:#faa}p.comment{background:#eef;color:grey;font-style:italic;margin-top:.2em;margin-bottom:.2em;padding-left:2.4em}p.end{border-bottom:1px dotted grey;margin-top:1em;background:#eef;margin-top:.2em;margin-bottom:.2em}p.diff{background:#ffe;margin-top:0;margin-bottom:0;padding-top:.25em;padding-bottom:.25em;padding-left:4em;font-weight:400;white-space:pre-wrap}ins{background:#afa}del{background:#faa;text-decoration:strike}span.ok{font-weight:700}span.actual,span.expected,span.name{padding-left:1em;font-style:italic;max-width:25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}p.assert.fail span.name{color:#555}span.expected:before{content:'!=';padding-right:1em}span.line{padding-left:1em;float:right;text-align:right;overflow:hidden;text-overflow:ellipsis;font-family:monospace;color:#888}"},{}],62:[function(t,e,r){(function(n){var i=t("defined"),o=t("./lib/default_stream"),s=t("./lib/test"),a=t("./lib/results"),u=t("through"),f=void 0!==n&&n&&"function"==typeof n.on&&!0!==n.browser,l=void 0!==n&&n&&"function"==typeof n.exit;"undefined"!=typeof setImmediate?setImmediate:n.nextTick;function c(t){t||(t={});var e=a();!1!==t.autoclose&&e.once("done",function(){e.close()});var r=function(t,n,i){var o=new s(t,n,i);return r._tests.push(o),function t(e){e.on("test",function(e){t(e)}),e.on("result",function(t){t.ok||"string"==typeof t||(r._exitCode=1)})}(o),e.push(o),o};r._results=e,r._tests=[],r.createStream=function(t){return e.createStream(t)},r.onFinish=function(t){e.on("done",t)};var n=!1;return r.only=function(){if(n)throw new Error("there can only be one only test");n=!0;var t=r.apply(null,arguments);return e.only(t),t},r._exitCode=0,r.close=function(){e.close()},r}(r=e.exports=function(){var t,e=function(){return r().apply(this,arguments)};return e.only=function(){return r().only.apply(this,arguments)},e.createStream=function(e){if(e||(e={}),!t){var n=u();return r({stream:n,objectMode:e.objectMode}),n}return t.createStream(e)},e.onFinish=function(){return r().onFinish.apply(this,arguments)},e.getHarness=r,e;function r(e){return e||(e={}),e.autoclose=!f,t||(t=function(t){t||(t={});var e=c({autoclose:i(t.autoclose,!1)}),r=e.createStream({objectMode:t.objectMode}),s=r.pipe(t.stream||o());f&&s.on("error",function(t){e._exitCode=1});var a=!1;if(r.on("end",function(){a=!0}),!1===t.exit)return e;if(!f||!l)return e;return n.on("exit",function(t){if(0===t){if(!a)for(var r=e._results._only,i=0;i65||y(o)||y(s)?(r+=" expected: |-\n "+o+"\n",r+=" actual: |-\n "+s+"\n"):(r+=i+"expected: "+o+"\n",r+=i+"actual: "+s+"\n")}t.at&&(r+=i+"at: "+t.at+"\n");var a=t.actual&&t.actual.stack,f=t.error&&t.error.stack,c=n(a,f);if(c){var h=String(c).split("\n");r+=i+"stack: |-\n";for(var p=0;p=1&&t&&this.ifError(t),this.calledEnd&&this.fail(".end() called twice"),this.calledEnd=!0,this._end()},b.prototype._end=function(t){var e=this;if(this._progeny.length){var r=this._progeny.shift();return r.on("end",function(){e._end()}),void r.run()}this.ended||this.emit("end");var n=this._pendingAsserts();!this._planError&&void 0!==this._plan&&n&&(this._planError=!0,this.fail("plan != count",{expected:this._plan,actual:this.assertCount})),this.ended=!0},b.prototype._exit=function(){void 0===this._plan||this._planError||this.assertCount===this._plan?this.ended||this.fail("test exited without ending",{exiting:!0}):(this._planError=!0,this.fail("plan != count",{expected:this._plan,actual:this.assertCount,exiting:!0}))},b.prototype._pendingAsserts=function(){return void 0===this._plan?1:this._plan-(this._progeny.length+this.assertCount)},b.prototype._assert=function(t,e){var r=this,i=e.extra||{},a={id:r.assertCount++,ok:Boolean(t),skip:o(i.skip,e.skip),name:o(i.message,e.message,"(unnamed assert)"),operator:o(i.operator,e.operator),objectPrintDepth:r._objectPrintDepth};if((f(e,"actual")||f(i,"actual"))&&(a.actual=o(i.actual,e.actual)),(f(e,"expected")||f(i,"expected"))&&(a.expected=o(i.expected,e.expected)),this._ok=Boolean(this._ok&&t),t||(a.error=o(i.error,e.error,new Error(a.name))),!t)for(var u=(new Error("exception").stack||"").split("\n"),l=s.dirname(n)+s.sep,c=0;c0;function s(t,e,r){var n=document.createEventObject?document.createEventObject():document.createEvent("Events");if(n.initEvent&&n.initEvent("keydown",!0,!0),n.keyCode=e,n.which=e,r)for(var i in r)n[i]=r[i];t.dispatchEvent?t.dispatchEvent(n):t.fireEvent("onkeydown",n)}n("hotkeys 单元测试",function(t){i("w",function(e){t.equal(e.keyCode,87,"单个按键 w keyCode == 87")}),s(document.body,87),i("enter",function(e){t.equal(e.keyCode,13,"单个特殊键按键 enter,enter验证 keyCode == 13")}),i("return",function(e){t.equal(e.keyCode,13,"单个特殊键按键 return,return验证 keyCode == 13")}),s(document.body,13),i("space",function(e){t.equal(e.keyCode,32,"单个特殊键按键 space,space验证 keyCode == 32")}),s(document.body,32),i("backspace",function(e){t.equal(e.keyCode,8,"单个特殊键按键 backspace,backspace 验证 keyCode == 8")}),s(document.body,8),i("tab",function(e){t.equal(e.keyCode,9,"单个特殊键按键 tab,tab 验证 keyCode == 9")}),s(document.body,9),i("clear",function(e){t.equal(e.keyCode,12,"单个特殊键按键 clear,clear 验证 keyCode == 12")}),s(document.body,12),i(",",function(e){t.equal(e.keyCode,188,"单个特殊键按键 , ,, 验证 keyCode == 188")}),s(document.body,188),i(".",function(e){t.equal(e.keyCode,190,"单个特殊键按键 . ,. 验证 keyCode == 190")}),s(document.body,190),i(".",function(e){t.equal(e.keyCode,190,"单个特殊键按键 . ,. 验证 keyCode == 190")}),s(document.body,190),i("/",function(e){t.equal(e.keyCode,191,"单个特殊键按键 / ,/ 验证 keyCode == 191")}),s(document.body,191),i("`",function(e){t.equal(e.keyCode,192,"单个特殊键按键 ` ,` 验证 keyCode == 192")}),s(document.body,192),i("-",function(e){t.equal(e.keyCode,o?173:189,"单个特殊键按键 -,- 验证 keyCode == 火狐?173:189")}),s(document.body,o?173:189),i("=",function(e){t.equal(e.keyCode,o?61:187,"单个特殊键按键 =,= 验证 keyCode == 火狐?61:187")}),s(document.body,o?61:187),i(";",function(e){t.equal(e.keyCode,o?59:186,"单个特殊键按键 ; ,; 验证 keyCode == 火狐?59:186")}),s(document.body,o?59:186),i("'".toString(),function(e){t.equal(e.keyCode,222,"单个特殊键按键 ' ,' 验证 keyCode == 222 ")}),s(document.body,222),i("\\".toString(),function(e){t.equal(e.keyCode,220,"单个特殊键按键 \\ ,\\ 验证 keyCode == 220 ")}),s(document.body,220),i("[".toString(),function(e){t.equal(e.keyCode,219,"单个特殊键按键 [ ,[ 验证 keyCode == 219 ")}),s(document.body,219),i("]".toString(),function(e){t.equal(e.keyCode,221,"单个特殊键按键 ] ,] 验证 keyCode == 221 ")}),s(document.body,221),i("left",function(e){t.equal(e.keyCode,37,"单个特殊键按键 left,left 验证 keyCode == 37")}),s(document.body,37),i("up",function(e){t.equal(e.keyCode,38,"单个特殊键按键 up,up 验证 keyCode == 38")}),s(document.body,38),i("del",function(e){t.equal(e.keyCode,46,"单个特殊键按键 del,del 验证 keyCode == 46")}),i("delete",function(e){t.equal(e.keyCode,46,"单个特殊键按键 delete,delete 验证 keyCode == 46")}),s(document.body,46),i("home",function(e){t.equal(e.keyCode,36,"单个特殊键按键 home,home 验证 keyCode == 36")}),s(document.body,36),i("pageup",function(e){t.equal(e.keyCode,33,"单个特殊键按键 pageup,pageup 验证 keyCode == 33")}),s(document.body,33),i("pagedown",function(e){t.equal(e.keyCode,34,"单个特殊键按键 pagedown,pagedown 验证 keyCode == 34")}),s(document.body,34),i("end",function(e){t.equal(e.keyCode,35,"单个特殊键按键 end,end 验证 keyCode == 35")}),s(document.body,35),i("right",function(e){t.equal(e.keyCode,39,"单个特殊键按键 right,right 验证 keyCode == 39")}),s(document.body,39),i("down",function(e){t.equal(e.keyCode,40,"单个特殊键按键 down,down 验证 keyCode == 40")}),s(document.body,40),i("esc",function(e){t.equal(e.keyCode,27,"单个特殊键按键 esc,esc 验证 keyCode == 27")}),i("escape",function(e){t.equal(e.keyCode,27,"单个特殊键按键 escape,escape 验证 keyCode == 27")}),s(document.body,27),i("CapsLock",function(e){t.equal(e.keyCode,20,"单个特殊键按键 CapsLock,CapsLock验证 keyCode == 20")}),i("⇪",function(e){t.equal(e.keyCode,20,"单个特殊键按键 ⇪,⇪验证 keyCode == 20")}),s(document.body,20),i("⌘+d",function(e){return t.equal(e.keyCode,82,"组合键 ⌘+d,d验证 keyCode == 82"),t.equal(e.metaKey,!0,"组合键 ⌘+d,alt验证 metaKey == true"),!1}),s(document.body,82,{metaKey:!0}),i("alt+d",function(e){t.equal(e.keyCode,68,"组合键 alt+d,d验证 keyCode == 68"),t.equal(e.altKey,!0,"组合键 alt+d,alt验证 altKey == true")}),s(document.body,68,{altKey:!0}),i("shift+a",function(e){t.equal(e.keyCode,65,"组合键 shift+a,a验证 keyCode == 65"),t.equal(e.shiftKey,!0,"组合键 shift+a,shift验证 shiftKey == true")}),s(document.body,65,{shiftKey:!0}),i("⇧+a",function(e){t.equal(e.keyCode,65,"组合键 ⇧+a,a验证 keyCode == 65"),t.equal(e.shiftKey,!0,"组合键 ⇧+a,⇧验证 shiftKey == true")}),s(document.body,65,{shiftKey:!0}),i("⌘+a",function(e){t.equal(e.keyCode,65,"组合键 ⌘+a,a验证 keyCode == 65"),t.equal(e.metaKey,!0,"组合键 ⌘+a,⌘验证 metaKey == true")}),s(document.body,65,{metaKey:!0}),i("⌃+a",function(e){t.equal(e.keyCode,65,"组合键 ⌃+a,a验证 keyCode == 65"),t.equal(e.ctrlKey,!0,"组合键 ⌃+a,⌃验证 ctrlKey == true")}),s(document.body,65,{ctrlKey:!0}),i.unbind("⌃+a"),i("⌥+a",function(e){t.equal(e.keyCode,65,"组合键 ⌥+a,a验证 keyCode == 65"),t.equal(e.altKey,!0,"组合键 ⌥+a,⌥验证 altKey == true")}),s(document.body,65,{altKey:!0}),i("ctrl+,,ctrl+d",function(e){t.equal(e.keyCode,188,"组合键 ctrl+,,,验证 keyCode == 65"),t.equal(e.ctrlKey,!0,"组合键 ctrl+,,ctrl验证 ctrlKey == true")}),s(document.body,188,{ctrlKey:!0}),i.unbind("ctrl+,,ctrl+d"),i("Ctrl+A",function(e){t.equal(e.keyCode,65,"大小写组合键 Ctrl+A,A验证 keyCode == 65"),t.equal(e.ctrlKey,!0,"大小写组合键 Ctrl+A,Ctrl验证 ctrlKey == true")}),s(document.body,65,{ctrlKey:!0}),i.unbind("Ctrl+A"),i("CTRL+A",function(e){t.equal(e.keyCode,65,"大小写组合键 CTRL+A,A验证 keyCode == 65"),t.equal(e.ctrlKey,!0,"大小写组合键 CTRL+A,CTRL验证 ctrlKey == true")}),s(document.body,65,{ctrlKey:!0}),i.unbind("CTRL+A"),i("⌃+a",function(){t.equal(i.getScope(),"all"," 验证 getScope() == all")}),s(document.body,65,{ctrlKey:!0}),i.unbind("⌃+a"),i("⌃+a","scope1",function(){t.equal(i.getScope(),"scope1"," 验证 getScope() == scope1")}),s(document.body,65,{ctrlKey:!0}),i("⌃+a","scope2",function(){t.equal(i.getScope(),"scope2"," 验证 getScope() == scope2")}),i.setScope("scope1"),s(document.body,65,{ctrlKey:!0}),i.setScope("scope2"),s(document.body,65,{ctrlKey:!0})})},{"../dist/hotkeys.js":1,tape:62,"tape-dom":60}]},{},[68]);