/
key.min.js
1 lines (1 loc) · 6.56 KB
/
key.min.js
1
(function(){var e=function(t,n){var r=e.resolve(t,n||"/"),i=e.modules[r];if(!i)throw new Error("Failed to resolve module "+t+", tried "+r);var s=e.cache[r],o=s?s.exports:i();return o};e.paths=[],e.modules={},e.cache={},e.extensions=[".js",".coffee",".json"],e._core={assert:!0,events:!0,fs:!0,path:!0,vm:!0},e.resolve=function(){return function(t,n){function u(t){var n,i;t=r.normalize(t);if(e.modules[t])return t;for(n=0;n<e.extensions.length;n++){i=e.extensions[n];if(e.modules[t+i])return t+i}}function a(t){var n,i,s,o;t=t.replace(/\/+$/,""),n=r.normalize(t+"/package.json");if(e.modules[n]){i=e.modules[n](),s=i.browserify;if(typeof s=="object"&&s.main){o=u(r.resolve(t,s.main));if(o)return o}else if(typeof s=="string"){o=u(r.resolve(t,s));if(o)return o}else if(i.main){o=u(r.resolve(t,i.main));if(o)return o}}return u(t+"/index")}function f(e,t){var n,r,i,s,o=l(t);for(n=0;n<o.length;n++){r=o[n],i=u(r+"/"+e);if(i)return i;s=a(r+"/"+e);if(s)return s}i=u(e);if(i)return i}function l(e){var t,n,i,s;e==="/"?t=[""]:t=r.normalize(e).split("/"),n=[];for(i=t.length-1;i>=0;i--){if(t[i]==="node_modules")continue;s=t.slice(0,i+1).join("/")+"/node_modules",n.push(s)}return n}var r,i,s,o;n||(n="/");if(e._core[t])return t;r=e.modules.path(),n=r.resolve("/",n),i=n||"/";if(t.match(/^(?:\.\.?\/|\/)/)){s=u(r.resolve(i,t))||a(r.resolve(i,t));if(s)return s}o=f(t,i);if(o)return o;throw new Error("Cannot find module '"+t+"'")}}(),e.alias=function(t,n){var r,i,s,o,u,a=e.modules.path(),f=null;try{f=e.resolve(t+"/package.json","/")}catch(l){f=e.resolve(t,"/")}r=a.dirname(f),i=(Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t})(e.modules);for(s=0;s<i.length;s++)o=i[s],o.slice(0,r.length+1)===r+"/"?(u=o.slice(r.length),e.modules[n+u]=e.modules[r+u]):o===r&&(e.modules[n]=e.modules[r])},function(){var t={},n=typeof window!="undefined"?window:{},r=!1;e.define=function(i,s){var o,u,a;!r&&e.modules.__browserify_process&&(t=e.modules.__browserify_process(),r=!0),o=e._core[i]?"":e.modules.path().dirname(i),u=function(t){var n=e(t,o),r=e.cache[e.resolve(t,o)];return r&&r.parent===null&&(r.parent=a),n},u.resolve=function(t){return e.resolve(t,o)},u.modules=e.modules,u.define=e.define,u.cache=e.cache,a={id:i,filename:i,exports:{},loaded:!1,parent:null},e.modules[i]=function(){return e.cache[i]=a,s.call(a.exports,u,a,a.exports,o,i,t,n),a.loaded=!0,a.exports}}}(),e.define("path",function(e,t,n,r,i,s){function u(e,t){var n,r=[];for(n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}function a(e,t){var n,r,i=0;for(n=e.length;n>=0;n--)r=e[n],r=="."?e.splice(n,1):r===".."?(e.splice(n,1),i++):i&&(e.splice(n,1),i--);if(t)for(;i--;i)e.unshift("..");return e}var o;o=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/,n.resolve=function(){var e,t,n="",r=!1;for(e=arguments.length;e>=-1&&!r;e--){t=e>=0?arguments[e]:s.cwd();if(typeof t!="string"||!t)continue;n=t+"/"+n,r=t.charAt(0)==="/"}return n=a(u(n.split("/"),function(e){return!!e}),!r).join("/"),(r?"/":"")+n||"."},n.normalize=function(e){var t=e.charAt(0)==="/",n=e.slice(-1)==="/";return e=a(u(e.split("/"),function(e){return!!e}),!t).join("/"),!e&&!t&&(e="."),e&&n&&(e+="/"),(t?"/":"")+e},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(u(e,function(e){return e&&typeof e=="string"}).join("/"))},n.dirname=function(e){var t=o.exec(e)[1]||"",n=!1;return t?t.length===1||n&&t.length<=3&&t.charAt(1)===":"?t:t.substring(0,t.length-1):"."},n.basename=function(e,t){var n=o.exec(e)[2]||"";return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},n.extname=function(e){return o.exec(e)[3]||""}}),e.define("__browserify_process",function(e,t,n,r,i,s){var s=t.exports={};s.nextTick=function(){var e,t=typeof window!="undefined"&&window.setImmediate,n=typeof window!="undefined"&&window.postMessage&&window.addEventListener;return t?window.setImmediate:n?(e=[],window.addEventListener("message",function(t){var n;t.source===window&&t.data==="browserify-tick"&&(t.stopPropagation(),e.length>0&&(n=e.shift(),n()))},!0),function(t){e.push(t),window.postMessage("browserify-tick","*")}):function(e){setTimeout(e,0)}}(),s.title="browser",s.browser=!0,s.env={},s.argv=[],s.binding=function(t){if(t==="evals")return e("vm");throw new Error("No such module. (Possibly not yet loaded)")},function(){var t,n="/";s.cwd=function(){return n},s.chdir=function(r){t||(t=e("path")),n=t.resolve(r,n)}}()}),e.define("/ref.coffee",function(e,t){(function(){"use strict";var e=function(){function e(e,t){this.name=e,this.code=t}return e}(),n=function(t,n){return new e(t,n)},r=function(t){return t instanceof e},i=function(e){if(!r(e))throw new Error("Invalid reference");return e};t.exports={ref:n,isRef:r,assertRef:i}}).call(this)}),e.define("/code/special.coffee",function(e,t){(function(){"use strict";var n=e("../ref").ref;t.exports={backspace:n("Backspace",8),tab:n("Tab",9),enter:n("Enter",13),shift:n("Shift",16),ctrl:n("Ctrl",17),alt:n("Alt",18),caps:n("Caps Lock",20),esc:n("Escape",27),space:n("Space",32),num:n("Num Lock",144)}}).call(this)}),e.define("/code/arrow.coffee",function(e,t){(function(){"use strict";var n=e("../ref").ref;t.exports={left:n("Left",37),up:n("Up",38),right:n("Right",39),down:n("Down",40)}}).call(this)}),e.define("/code/alnum.coffee",function(e,t){(function(){"use strict";var n=e("../ref").ref;t.exports={0:n("0",48),1:n("1",49),2:n("2",50),3:n("3",51),4:n("4",52),5:n("5",53),6:n("6",54),7:n("7",55),8:n("8",56),9:n("9",57),a:n("A",65),b:n("B",66),c:n("C",67),d:n("D",68),e:n("E",69),f:n("F",70),g:n("G",71),h:n("H",72),i:n("I",73),j:n("J",74),k:n("K",75),l:n("L",76),m:n("M",77),n:n("N",78),o:n("O",79),p:n("P",80),q:n("Q",81),r:n("R",82),s:n("S",83),t:n("T",84),u:n("U",85),v:n("V",86),w:n("W",87),x:n("X",88),y:n("Y",89),z:n("Z",90)}}).call(this)}),e.define("/code/brand.coffee",function(e,t){(function(){"use strict";var n=e("../ref").ref;t.exports={apple:n("Apple ⌘",224),windows:{left:n("Windows start",91),right:n("Windows start",92),menu:n("Windows menu",93)}}}).call(this)}),e.define("/key.coffee",function(e,t){(function(){"use strict";var n,r=this,i=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},s={}.hasOwnProperty,o=e("./ref").isRef,u={};u.code={special:e("./code/special"),arrow:e("./code/arrow"),alnum:e("./code/alnum"),brand:e("./code/brand")},u.get=function(e){return n(u.code,e)},u.is=function(e,t){return o(e)||(e=n(e,t)),o(e)?o(t)?t===e:t===e.code||i.call(e.code,t)>=0:t===e},n=function(e,t){var r,i,a;for(r in e){if(!s.call(e,r))continue;a=e[r];if(o(a)){if(u.is(a,t))return a}else{i=n(a,t);if(o(i))return i}}},typeof window!="undefined"&&(window.key=u),t.exports=u}).call(this)}),e("/key.coffee")})();